org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jndi.JndiLookupFailureException: JndiObjectTargetSource failed to obtain new target object; nested exception is javax.naming.NameNotFoundException: Name [comp/env/jdbc/facts_slave] is not bound in this Context. Unable to find [comp].
### The error may exist in com/logic/system/persistence/read/SystemConfigurationReadMapper.xml
### The error may involve com.logic.system.persistence.read.SystemConfigurationReadMapper.selectByPrimaryKey
### The error occurred while executing a query
### Cause: org.springframework.jndi.JndiLookupFailureException: JndiObjectTargetSource failed to obtain new target object; nested exception is javax.naming.NameNotFoundException: Name [comp/env/jdbc/facts_slave] is not bound in this Context. Unable to find [comp].
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75) ~[mybatis-spring-1.2.2.jar!/:1.2.2]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[mybatis-spring-1.2.2.jar!/:1.2.2]
at com.sun.proxy.$Proxy69.selectOne(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163) ~[mybatis-spring-1.2.2.jar!/:1.2.2]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68) ~[mybatis-3.2.7.jar!/:3.2.7]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[mybatis-3.2.7.jar!/:3.2.7]
at com.sun.proxy.$Proxy135.selectByPrimaryKey(Unknown Source) ~[na:na]
at com.logic.system.models.configuration.service.SystemConfigurationService.get(SystemConfigurationService.java:125) ~[system-server-0.0.1-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
at com.logic.yinkunserver.models.dingxin.service.CollectionDayDataService.doCollection(CollectionDayDataService.java:72) ~[system-server-0.0.1-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
毫无头绪.... 配置文件如下:
logic:
jndi:
master:
name: jdbc/facts_master
factory: org.apache.commons.dbcp2.BasicDataSourceFactory
maxActive: 5
maxIdle: 2
initialSize: 1
maxWait: 5000
test-on-borrow: true
validation-query: select 1
slave:
name: jdbc/facts_slave
factory: org.apache.commons.dbcp2.BasicDataSourceFactory
maxActive: 5
maxIdle: 2
initialSize: 1
maxWait: 5000
test-on-borrow: true
validation-query: select 1
没找到
jndi
连接名称,你在服务器上配置了吗?