开发者

mybatis config problem

开发者 https://www.devze.com 2023-03-05 10:40 出处:网络
I\'m new to MyBatis. Ive been trying to configure mybatis in a webservice I\'m writing but with no luck yet.

I'm new to MyBatis.

Ive been trying to configure mybatis in a webservice I'm writing but with no luck yet.

What I've done already is,

  1. UserInfoMapper interface
  2. UserInfoMapper.xml with mapper namespace with my UserInfoMapper interface and a select
  3. mybatis-co开发者_如何学编程nfig.xml with typeAlias to use as result type in UserInfoMapper.xml
  4. dataSource bean for oracle (I get connected) in datasourceContext.xml
  5. org.mybatis.spring.mapper.MapperScannerConfigurer bean with basePackage pointing to my UserInfoMapper interface in datasourceContext.xml
  6. sqlSessionFactory bean ie. org.mybatis.spring.SqlSessionFactoryBean with property for my dataSource and configLocation
  7. userInfoMapper bean ie. org.mybatis.spring.mapper.MapperFactoryBean with property mapperInterface (value="is.simnn.act.web.ngs.persistence.UserInfoMapper") and sqlSessionFactory property (ref="sqlSessionFactory") in datasourceContext.xml
  8. then in my applicationContext.xml I have following,

<import resource="classpath:META-INF/wsContext.xml" />
<import resource="classpath:META-INF/db/datasourceContext.xml" />

In my test case I keep getting NullPointerException when I call jaxws:endpoint and it leads me to my UserInfoMapper interface.

Any idea or hints to what might be wrong with my config?

Thanks, Gunnlaugur


It is hard to comment without having more information. Can you post your UserInfoMapper.java interface, your UserInfoMapper.xml and your stack trace, please? Are you certain that the method name in your interface matches the ID of your SELECT in the XML?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号