`
wxb880114
  • 浏览: 681825 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

JOTM异常处理

 
阅读更多
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jotm' defined in class path resource [applicationContext-all.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.transaction.jta.JotmFactoryBean]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.enhydra.jdbc.pool.StandardXAPoolDataSource] for bean with name 'dataSourceA' defined in class path resource [applicationContext-all.xml]; nested exception is java.lang.ClassNotFoundException: org.enhydra.jdbc.pool.StandardXAPoolDataSource
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.enhydra.jdbc.pool.StandardXAPoolDataSource] for bean with name 'dataSourceB' defined in class path resource [applicationContext-all.xml]; nested exception is java.lang.ClassNotFoundException: org.enhydra.jdbc.pool.StandardXAPoolDataSource
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
	at tools.ApplicationContextUtils.rebuildApplicationContext(ApplicationContextUtils.java:22)
	at tools.ApplicationContextUtils.<clinit>(ApplicationContextUtils.java:13)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.transaction.jta.JotmFactoryBean]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
	... 13 more
Caused by: java.lang.ExceptionInInitializerError
	at org.objectweb.jotm.Jotm.<init>(Jotm.java:140)
	at org.springframework.transaction.jta.JotmFactoryBean.<init>(JotmFactoryBean.java:95)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
	... 15 more
Caused by: org.omg.CORBA.INITIALIZE: Error while instantiatingorg.objectweb.carol.rmi.multi.MultiPRODelegate  vmcid: 0x0  minor code: 0  completed: No
	at javax.rmi.PortableRemoteObject.createDelegateIfSpecified(PortableRemoteObject.java:188)
	at javax.rmi.PortableRemoteObject.<clinit>(PortableRemoteObject.java:61)
	... 22 more
Caused by: java.lang.IllegalStateException: Configuration of carol was not done and when trying to initialize it, it fails.
	at org.objectweb.carol.util.configuration.ConfigurationRepository.checkInitialized(ConfigurationRepository.java:113)
	at org.objectweb.carol.util.configuration.ConfigurationRepository.checkConfigured(ConfigurationRepository.java:126)
	at org.objectweb.carol.util.configuration.ConfigurationRepository.getConfigurations(ConfigurationRepository.java:136)
	at org.objectweb.carol.rmi.multi.MultiPRODelegate.<init>(MultiPRODelegate.java:73)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:355)
	at java.lang.Class.newInstance(Class.java:308)
	at javax.rmi.PortableRemoteObject.createDelegateIfSpecified(PortableRemoteObject.java:182)
	... 23 more
Caused by: org.objectweb.carol.util.configuration.ConfigurationException: Cannot find a protocol with name 'jrmp ' in the list of available protocols.
	at org.objectweb.carol.util.configuration.ConfigurationRepository.init(ConfigurationRepository.java:335)
	at org.objectweb.carol.util.configuration.ConfigurationRepository.init(ConfigurationRepository.java:229)
	at org.objectweb.carol.util.configuration.ConfigurationRepository.init(ConfigurationRepository.java:397)
	at org.objectweb.carol.util.configuration.ConfigurationRepository.checkInitialized(ConfigurationRepository.java:111)
	... 33 more

在使用Spring3.0.5与Jotm集成时,使用工具ApplicationContextUtils来测试applicationContext文件的正确性时,报出如上错误。

经查阅资料:在carol.properties中增加一句

carol.start.rmi=false

java.lang.ExceptionInInitializerError
	at tools.Test.<clinit>(Test.java:10)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.enhydra.jdbc.pool.StandardXAPoolDataSource] for bean with name 'dataSourceA' defined in class path resource [applicationContext-all.xml]; nested exception is java.lang.ClassNotFoundException: org.enhydra.jdbc.pool.StandardXAPoolDataSource
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1250)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:885)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
	at tools.ApplicationContextUtils.rebuildApplicationContext(ApplicationContextUtils.java:22)
	at tools.ApplicationContextUtils.<clinit>(ApplicationContextUtils.java:13)
	... 1 more
Caused by: java.lang.ClassNotFoundException: org.enhydra.jdbc.pool.StandardXAPoolDataSource
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242)
	... 10 more


在maven pom.xml的dependency中查找xapool,并添加。
  [java]<dependency>
  <groupId>javax.resource</groupId>
  <artifactId>connector-api</artifactId>
  <version>1.6-alpha-1</version>
  </dependency>
   [/java]

java.lang.ExceptionInInitializerError
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.transaction.jta.JotmFactoryBean] for bean with name 'jotm' defined in class path resource [applicationContext-all.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.transaction.jta.JotmFactoryBean
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1250)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:885)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at tools.ApplicationContextUtils.rebuildApplicationContext(ApplicationContextUtils.java:22)
	at tools.ApplicationContextUtils.<clinit>(ApplicationContextUtils.java:13)
Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.jta.JotmFactoryBean
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242)
	... 10 more

pom.xml中添加
[java]<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-dao</artifactId>
  <version>2.0.8</version>
  </dependency>
[/java]

java.lang.ExceptionInInitializerError
	at tools.Test.<clinit>(Test.java:10)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClientA' defined in class path resource [applicationContext-all.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
	at tools.ApplicationContextUtils.rebuildApplicationContext(ApplicationContextUtils.java:22)
	at tools.ApplicationContextUtils.<clinit>(ApplicationContextUtils.java:13)
	... 1 more
Caused by: java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:338)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:291)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
	... 13 more

在spring   3.0.5.RELEASE  版本下,


ibatis 的版本为 
<dependency>
<groupId>com.ibatis</groupId>
<artifactId>ibatis2-sqlmap</artifactId>
<version>2.1.7.597</version>
</dependency>

tomcat启动出错 ,错误信息如下:  (出错后,先查看tomcat的logs目录下的catalina.log文件和localhost.log文件)

在log中输出 : startup failed due to previous errors

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/classes/dataAccessContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:338)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:291)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
	... 26 more
 
01, 2012 12:49:02 ÏÂÎç org.apache.catalina.core.ApplicationContext log
 Closing Spring root WebApplicationContext
01, 2012 12:49:03 ÏÂÎç org.apache.catalina.core.ApplicationContext log
Initializing WebApplicationContext for Struts ActionServlet 'action', module ''


错误原因是:ibatis2-sqlmap  版本太低了,接口变化了
比如最常见的:Caused by: java.lang.NoSuchMethodError: com.ibatis.common.xml.NodeletParser.parse(Ljava/io/InputStream;)V
这样的错误。
或者com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse
(Ljava/io/InputStream;Ljava/util/Propertis)
这样类似的错误。
那是因为,在ibatis2 的 ibatis-sqlmap-2.jar 只有parse(Reader)和parse(Reader,Properties)两个方法,没有参数为Inputstream的方法或者Inputstrem,properties的方法。

解决方法为:
在pom文件中把   
<!--   版本太低  出错-->
  <dependency>
<groupId>com.ibatis</groupId>
<artifactId>ibatis2-sqlmap</artifactId>
<version>2.1.7.597</version>
</dependency>



换成高版本
  <dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-sqlmap</artifactId>
<version>2.3.4.726</version>
</dependency>

java.lang.ExceptionInInitializerError
	at tools.Test.<clinit>(Test.java:10)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClientB' defined in class path resource [applicationContext-all.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [sql-map-config_B.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/resultMap'.  Cause: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
	at tools.ApplicationContextUtils.rebuildApplicationContext(ApplicationContextUtils.java:22)
	at tools.ApplicationContextUtils.<clinit>(ApplicationContextUtils.java:13)
	... 1 more
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [sql-map-config_B.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/resultMap'.  Cause: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:341)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:291)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
	... 13 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/resultMap'.  Cause: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:106)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:95)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:338)
	... 16 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/resultMap'.  Cause: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
	at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
	at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
	... 19 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/resultMap'.  Cause: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:55)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:394)
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
	... 23 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/resultMap'.  Cause: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
	at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
	at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
	... 26 more
Caused by: java.lang.RuntimeException: Error configuring Result.  Could not set ResultClass.  Cause: java.lang.ClassNotFoundException: TabA
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$14.process(SqlMapParser.java:376)
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
	... 30 more
Caused by: java.lang.ClassNotFoundException: TabA
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:169)
	at com.ibatis.common.resources.Resources.classForName(Resources.java:265)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$14.process(SqlMapParser.java:374)
	... 31 more


TabA.xml文件配置错误。

ption in thread "main" com.ibatis.sqlmap.client.SqlMapException: There is no statement named tab_a.insert in this SqlMap.
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:293)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:429)
	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
	at org.springframework.orm.ibatis.SqlMapClientTemplate$8.doInSqlMapClient(SqlMapClientTemplate.java:366)
	at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:200)
	at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:364)
	at dao.TabBDAOImpl.saveTabB(TabBDAOImpl.java:16)
	at service.StuJotmServiceImpl.saveAB(StuJotmServiceImpl.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at $Proxy0.saveAB(Unknown Source)
	at tools.Test.test_(Test.java:22)
	at tools.Test.main(Test.java:26)

named tab_a.insert in this SqlMap.
在TabA.xml中出现了错误,namespace="tab_a" id=“insert”,命名重复或者错误。
1
5
分享到:
评论

相关推荐

    jotm-2.0.11.MR5.rar_Jotm jar_jotm_jotm-2.0.11.MR5_jotm.jar _jtom

    文档的全面性使得无论是初学者还是经验丰富的开发者都能从中受益,了解如何配置JOTM,如何在应用中启动事务管理,以及如何处理各种异常情况。 总的来说,JOTM是一个强大的工具,对于需要在Java环境中实现分布式事务...

    jotm2.0最新源码包

    4. **回滚和提交逻辑**:在JOTM中,事务的回滚和提交操作是如何进行的,包括异常处理、二阶段提交(2PC,Two-Phase Commit)协议的实现等,这些都是源码解析的重要部分。 5. **XAResource接口**:JOTM与数据库或者...

    JOTM简单测试DEMO(不含jar包)

    本DEMO主要展示了如何在Spring框架中结合JOTM来处理分布式事务,特别是涉及多个数据源的情况。 首先,我们需要理解JOTM的基本概念。JOTM作为一个事务协调者,负责管理跨多个资源的事务,确保它们要么全部成功,要么...

    Tomcat中使用JOTM2.14

    // 处理异常 } } } ``` 总的来说,将JOTM集成到Tomcat中是一项涉及配置多个文件和接口的工作,旨在提供强大的事务管理能力,以支持复杂的应用场景。通过理解和配置`carol.properties`和`context.xml`文件,以及...

    java事务处理包正版的JOTM

    Java事务处理包(JOTM)是Java开放源代码事务管理器,它实现了Java Transaction API (JTA) 和Java Transaction Service (JTS) 的规范。JOTM 是一个强大的工具,尤其对于那些希望在Tomcat这样的轻量级应用服务器中实现...

    多数据源 更新 spring jta java jotm

    总结来说,Spring、JTA和JOTM的组合提供了在多数据源环境中高效且可靠的事务处理能力。通过Spring的`AbstractRoutingDataSource`和JTA,我们可以轻松地管理多个数据源,并通过JOTM保证分布式事务的一致性。在实际...

    jotm完整资料 (包括所有jar 和 api)

    JOTM(Java Open Transaction Manager)是一个开源的Java事务管理器,它实现了JTA(Java Transaction API)标准,为分布式事务处理提供了强大的支持。在Java应用程序中,尤其是在企业级应用中,事务管理是核心组件之...

    spring-hibernate-jotm 例子

    在Spring中,JOTM可以作为全局事务管理器,处理跨越不同数据源的事务。当应用程序需要在多个数据库或者服务之间进行事务操作时,JOTM能够确保所有操作要么全部成功,要么全部失败,实现ACID(原子性、一致性、隔离性...

    与JOTM有关的话题

    7. **异常处理与错误恢复**:源码中关于异常处理的部分可以揭示JOTM如何优雅地处理错误,以及如何在出现问题时回滚事务并通知应用程序。 8. **模块化设计**:JOTM可能采用了模块化的设计,以便于扩展和定制。通过...

    spring JTA集成JOTM或Atomikos配置分布式事务(Tomcat应用服务器)

    在开发过程中,为了调试和测试分布式事务,可以使用像Arjuna或者XTS这样的工具来模拟不同情况下的事务行为,例如网络故障、资源异常等,以确保事务管理器能够正确处理这些异常情况。 总结来说,集成Spring、JTA、...

    flex与java整合专用jotm

    5. **异常处理**:在Flex客户端,应适当地处理可能出现的服务器端异常,这些异常可能源于事务管理的问题。例如,当事务回滚时,客户端需要能够优雅地显示错误信息,并可能提供重试操作。 6. **测试与调试**:由于...

    使用JOTM实现分布式事务管理(多数据源)

    在多数据源环境中,JOTM可以帮助我们处理复杂的事务边界,保证在不同的数据库或服务之间的一致性,即使在出现故障时也能正确回滚。 首先,我们需要理解JTA的核心概念。JTA定义了一套标准接口,允许应用程序透明地...

    Spring+JOTM 分布式事务管理

    Spring框架作为一个广泛使用的Java应用程序开发框架,提供了多种支持事务管理的解决方案,其中包括集成JOTM(Java Open Transaction Manager)来处理分布式事务。本文将深入探讨Spring与JOTM结合使用的知识点,帮助...

    开源事务管理器 JOTM

    4. **异常处理**:正确处理事务异常,确保在出现错误时能够回滚事务。 **最佳实践** 1. **事务边界**:明确事务的开始和结束,避免事务过大导致性能下降。 2. **事务超时**:设置适当的事务超时,防止死锁或长时间...

    jotm资源包

    4. **使用JOTM**:通过代码示例学习如何在Java程序中启动和提交事务,如何处理异常并回滚事务,以及如何配置事务超时和恢复策略。 5. **XAResource适配**:JOTM需要与各种数据库或其他事务资源配合,因此需要了解...

    基于java的开发源码-开源事务管理器 JOTM.zip

    例如,你可以学习如何配置JOTM以连接到特定的数据库,如何在应用程序中启动和控制事务,以及如何处理事务异常。 总之,JOTM是一个强大的工具,对于需要处理分布式事务的Java开发者来说,它提供了灵活、可靠的事务...

    java源码:开源事务管理器 JOTM.zip

    - **事务管理流程**:阅读源码时,重点关注TM如何启动、监控和结束事务,以及如何处理异常和回滚操作。 - **XAResource接口实现**:理解如何将数据库或其他服务包装为XARes源,以实现跨资源的事务。 - **事务恢复...

    spring+jotm+ibatis+mysql实现JTA分布式事务

    通常,这样的测试会模拟不同的事务场景,例如并发更新、异常处理等,以确保在各种情况下事务都能正确地进行提交或回滚。 总的来说,这个项目展示了如何利用Spring的事务管理能力,结合JOTM作为事务协调器,以及...

Global site tag (gtag.js) - Google Analytics