中间省略一部分[DEBUG]:2015-01-11 11:21:50|1913|[http-bio-8080-exec-3]Resolved location pattern [classpath:com/abc/rwgl/dao/mybatis/*.xml] to resources [file [D:\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\rwgl\WEB-INF\classes\com\abc\rwgl\dao\mybatis\CommonDao.xml], file [D:\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\rwgl\WEB-INF\classes\com\abc\rwgl\dao\mybatis\Person.xml], file [D:\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\rwgl\WEB-INF\classes\com\abc\rwgl\dao\mybatis\Rwxx.xml]] -org.springframework.core.io.support.PathMatchingResourcePatternResolver 
[DEBUG]:2015-01-11 11:21:50|1915|[http-bio-8080-exec-3]Invoking afterPropertiesSet() on bean with name 'sqlSessionFactory' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:50|2305|[http-bio-8080-exec-3]Parsed configuration file: 'class path resource [mybatisConfig.xml]' -org.mybatis.spring.SqlSessionFactoryBean 
[DEBUG]:2015-01-11 11:21:50|2308|[http-bio-8080-exec-3]Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:@localhost:1521:dcgcy] -org.springframework.jdbc.datasource.DriverManagerDataSource 
[DEBUG]:2015-01-11 11:21:51|2891|[http-bio-8080-exec-3]Parsed mapper file: 'file [D:\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\rwgl\WEB-INF\classes\com\abc\rwgl\dao\mybatis\CommonDao.xml]' -org.mybatis.spring.SqlSessionFactoryBean 
[DEBUG]:2015-01-11 11:21:51|2929|[http-bio-8080-exec-3]Parsed mapper file: 'file [D:\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\rwgl\WEB-INF\classes\com\abc\rwgl\dao\mybatis\Person.xml]' -org.mybatis.spring.SqlSessionFactoryBean 
[DEBUG]:2015-01-11 11:21:51|2948|[http-bio-8080-exec-3]Parsed mapper file: 'file [D:\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\rwgl\WEB-INF\classes\com\abc\rwgl\dao\mybatis\Rwxx.xml]' -org.mybatis.spring.SqlSessionFactoryBean 
[DEBUG]:2015-01-11 11:21:51|2950|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2950|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2959|[http-bio-8080-exec-3]Finished creating instance of bean 'sqlSessionFactory' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2960|[http-bio-8080-exec-3]Creating shared instance of singleton bean 'sqlSession' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2961|[http-bio-8080-exec-3]Creating instance of bean 'sqlSession' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2961|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2965|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'sqlSessionFactory' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2965|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2965|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2994|[http-bio-8080-exec-3]Eagerly caching bean 'sqlSession' to allow for resolving potential circular references -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2997|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|2997|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3018|[http-bio-8080-exec-3]Finished creating instance of bean 'sqlSession' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3018|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'txManager' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3018|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'transactionAdvice' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3018|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3018|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3019|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3019|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3021|[http-bio-8080-exec-3]Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@1edcd24] -org.springframework.context.support.ClassPathXmlApplicationContext 
[DEBUG]:2015-01-11 11:21:51|3022|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'lifecycleProcessor' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3028|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'sqlSessionFactory' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3032|[http-bio-8080-exec-3]Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties] -org.springframework.core.env.PropertySourcesPropertyResolver 
[DEBUG]:2015-01-11 11:21:51|3033|[http-bio-8080-exec-3]Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment] -org.springframework.core.env.PropertySourcesPropertyResolver 
[DEBUG]:2015-01-11 11:21:51|3033|[http-bio-8080-exec-3]Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null] -org.springframework.core.env.PropertySourcesPropertyResolver 
[DEBUG]:2015-01-11 11:21:51|3033|[http-bio-8080-exec-3]Returning cached instance of singleton bean 'sqlSessionFactory' -org.springframework.beans.factory.support.DefaultListableBeanFactory 
[DEBUG]:2015-01-11 11:21:51|3056|[http-bio-8080-exec-3]Fetching JDBC Connection from DataSource -org.springframework.jdbc.datasource.DataSourceUtils 
[DEBUG]:2015-01-11 11:21:51|3056|[http-bio-8080-exec-3]Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:@localhost:1521:dcgcy] -org.springframework.jdbc.datasource.DriverManagerDataSource 
[DEBUG]:2015-01-11 11:21:51|3135|[http-bio-8080-exec-3]JDBC Connection [oracle.jdbc.driver.T4CConnection@a1a199] will not be managed by Spring -org.mybatis.spring.transaction.SpringManagedTransaction 
[DEBUG]:2015-01-11 11:21:51|3147|[http-bio-8080-exec-3]==>  Preparing: INSERT INTO test(ID,NAME,AGE,PHONE) VALUES(?,?,?,?)  -com.abc.rwgl.dao.mybatis.PersonMapper.insertPerson 
[DEBUG]:2015-01-11 11:21:51|3371|[http-bio-8080-exec-3]==> Parameters: 2(Integer), 人物2(String), 2(String), 199999900992(String) -com.abc.rwgl.dao.mybatis.PersonMapper.insertPerson 
[DEBUG]:2015-01-11 11:21:51|3373|[http-bio-8080-exec-3]<==    Updates: 1 -com.abc.rwgl.dao.mybatis.PersonMapper.insertPerson 
[DEBUG]:2015-01-11 11:21:51|3374|[http-bio-8080-exec-3]==>  Preparing: INSERT INTO test(ID,NAME,AGE,PHONE) VALUES(?,?,?,?)  -com.abc.rwgl.dao.mybatis.PersonMapper.insertPerson 
[DEBUG]:2015-01-11 11:21:51|3374|[http-bio-8080-exec-3]==> Parameters: 2(Integer), 人物2(String), 2(String), 199999900992(String) -com.abc.rwgl.dao.mybatis.PersonMapper.insertPerson 
[DEBUG]:2015-01-11 11:21:51|3388|[http-bio-8080-exec-3]Returning JDBC Connection to DataSource -org.springframework.jdbc.datasource.DataSourceUtils 
2015-1-11 23:21:51 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [restServlet] in context with path [/rwgl] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.Exception: 123] with root cause
java.lang.Exception: 123
at com.abc.rwgl.test.Test.stest1(Test.java:92)
我插入了相同的数据,因为id是主键,让他报错,数据库提交应该回滚,可是不回滚,日志显示,没有被spring管理。
[DEBUG]:2015-01-11 11:21:51|3135|[http-bio-8080-exec-3]JDBC Connection [oracle.jdbc.driver.T4CConnection@a1a199] will not be managed by Spring
好几天了都没解决,求大神帮助!网上找了好多方案,都无法解决,自己也在尝试其他方案。如果我解决了会把技术贴出来。

解决方案 »

  1.   

    你这,把所有配置都拿出来干啥,关键的贴出来就好。看不到你的service包,发出来看看,估计是你包和你的配置不匹配。尽量不要写那么死,灵活点:expression="(execution(public * com.*.service.*.*(..))) || (execution(public * com.*.**.service.*.*(..)))"另外把你的 session.insert()发出来
      

  2.   

    把你applcationContext-mybatis.xml中56行
    <aop:pointcut id="transactionxPointcut"    expression="execution(* com.abc.rwgl.test.*.*(..))" />改为
    <aop:pointcut id="transactionxPointcut"    expression="execution(* com.abc.rwgl.*.*(..))" />
      

  3.   

    service调用的问题,现在想把spring和jersey和起来用