spring boot mybatis druid snaker配合使用的问题?

java10001 发布于 2015/01/27 11:55
阅读 5K+
收藏 0

最近使用spring-boot,druid,Mybatis写了一些东西

其中@MapperScan("com.varicom.mapper") 扫描

到这里都没问题,eclipse启动和打包运行都没问题

后来工程引入snaker,根据snaker 2.4的mybatis配置

<!-- mybatis access -->
<bean id="dbAccess" class="org.snaker.engine.access.mybatis.MybatisAccess">
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:mybatis.cfg.xml"></property>
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="org.snaker.engine.entity" />
</bean>
使用 mybatis ,需要在 mybatis.cfg.xml 配置文件中增加 snaker 的类型及映射文件
<typeAliases>
<package name="org.snaker.engine.entity"/>
</typeAliases>
<mappers>
<mapper resource="mapper/process.xml"/>
<mapper resource="mapper/order.xml"/>
<mapper resource="mapper/task.xml"/>
<mapper resource="mapper/task-actor.xml"/>
<mapper resource="mapper/hist-order.xml"/>
<mapper resource="mapper/hist-task.xml"/>
<mapper resource="mapper/hist-task-actor.xml"/>
<mapper resource="mapper/query.xml"/>
<mapper resource="mapper/hist-query.xml"/>
<mapper resource="mapper/surrogate.xml"/>
</mappers>

eclispe启动,访问一切ok,

而后工程打包运行便会卡住在

2015-01-27 11:43:53.094  INFO 32936 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [class com.alibaba.druid.pool.DruidDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

不知道但大家见过此类问题不?

@wenshao

@Dead_knight


加载中
0
Dead_knight
Dead_knight

使用 mybatis ,需要在 mybatis.cfg.xml 配置文件中增加 snaker 的类型及映射文件
<typeAliases>
< package name="org.snaker.engine.entity"/>
< /typeAliases>
< mappers>
< mapper resource="mapper/process.xml"/>
< mapper resource="mapper/order.xml"/>
< mapper resource="mapper/task.xml"/>
< mapper resource="mapper/task-actor.xml"/>
< mapper resource="mapper/hist-order.xml"/>
< mapper resource="mapper/hist-task.xml"/>
< mapper resource="mapper/hist-task-actor.xml"/>
< mapper resource="mapper/query.xml"/>
< mapper resource="mapper/hist-query.xml"/>
< mapper resource="mapper/surrogate.xml"/>
< /mappers>

这段配置不需要的

0
java10001
java10001

引用来自“Dead_knight”的评论

使用 mybatis ,需要在 mybatis.cfg.xml 配置文件中增加 snaker 的类型及映射文件
<typeAliases>
< package name="org.snaker.engine.entity"/>
< /typeAliases>
< mappers>
< mapper resource="mapper/process.xml"/>
< mapper resource="mapper/order.xml"/>
< mapper resource="mapper/task.xml"/>
< mapper resource="mapper/task-actor.xml"/>
< mapper resource="mapper/hist-order.xml"/>
< mapper resource="mapper/hist-task.xml"/>
< mapper resource="mapper/hist-task-actor.xml"/>
< mapper resource="mapper/query.xml"/>
< mapper resource="mapper/hist-query.xml"/>
< mapper resource="mapper/surrogate.xml"/>
< /mappers>

这段配置不需要的

你说的最新的2.5.1的配置是没看到这个配置,之前2.4的配置里面好像这样的,我换一个2.5.1看看
Dead_knight
Dead_knight
有问题可以加群讨论
返回顶部
顶部