使用JBoss 4

时间:2016-07-15 08:48:49

标签: java-ee jms xa

我使用Jboss 4.0.4SQL Server 2012作为我的数据库。我们已使用XA datasource配置了jTDS driver,但工作正常。但是当我们开始使用sqljdb驱动程序时,因为它支持TLS1.2协议。但是使用此配置,JBoss启动失败并出现以下异常跟踪:

  

XAException:tx = TransactionImpl:XidImpl [FormatId = 257,GlobalId = xxx / 3,BranchQual =,localId = 3] errorCode = XAER_NOTA   javax.transaction.xa.XAException:函数COMMIT:失败。状态是:-4。错误:" * SQLJDBC_XA DTC_ERROR上下文:xa_commit,state = 1,StatusCode:-4(0xFFFFFFFC)* "       在com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_Interface(SQLServerXAResource.java:645)       在com.microsoft.sqlserver.jdbc.SQLServerXAResource.commit(SQLServerXAResource.java:808)       在org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.commit(XAManagedConnection.java:147)       at org.jboss.tm.TransactionImpl $ Resource.commit(TransactionImpl.java:2505)       在org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1847)       在org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:362)       在org.jboss.tm.TxManager.commit(TxManager.java:240)       at org.jboss.mq.sm.jdbc.JDBCStateManager $ JDBCSession.close(JDBCStateManager.java:613)       at org.jboss.mq.sm.jdbc.JDBCStateManager.initDB(JDBCStateManager.java:465)       at org.jboss.mq.sm.jdbc.JDBCStateManager.startService(JDBCStateManager.java:378)       在org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)       在org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)       at sun.reflect.GeneratedMethodAccessor2.invoke(未知来源)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:86)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       at org.jboss.system.ServiceController $ ServiceProxy.invoke(ServiceController.java:978)       at com.sun.proxy。$ Proxy0.start(Unknown Source)       在org.jboss.system.ServiceController.start(ServiceController.java:417)       在org.jboss.system.ServiceController.start(ServiceController.java:435)       在org.jboss.system.ServiceController.start(ServiceController.java:435)       在org.jboss.system.ServiceController.start(ServiceController.java:435)       在org.jboss.system.ServiceController.start(ServiceController.java:435)       在org.jboss.system.ServiceController.start(ServiceController.java:435)       at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:86)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       在org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)       在com.sun.proxy。$ Proxy4.start(未知来源)       在org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:88)       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:88)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       在org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)       在com.sun.proxy。$ Proxy44.start(未知来源)       在org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)       在org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)       在org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)       在org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)       at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:88)       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:88)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       在org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)       在com.sun.proxy。$ Proxy8.deploy(未知来源)       在org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)       在org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)       在org.jboss.deployment.scanner.AbstractDeploymentScanner $ ScannerThread.doScan(AbstractDeploymentScanner.java:263)       在org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)       在org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)       在org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)       at sun.reflect.GeneratedMethodAccessor2.invoke(未知来源)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:86)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       at org.jboss.system.ServiceController $ ServiceProxy.invoke(ServiceController.java:978)       at com.sun.proxy。$ Proxy0.start(Unknown Source)       在org.jboss.system.ServiceController.start(ServiceController.java:417)       at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:86)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       在org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)       在com.sun.proxy。$ Proxy4.start(未知来源)       在org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)       在org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)       在org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)       在org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)       在org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)       在org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:88)       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)       在org.jboss.mx.server.Invocation.invoke(Invocation.java:88)       在org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)       在org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)       在com.sun.proxy。$ Proxy5.deploy(未知来源)       在org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)       在org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)       在org.jboss.Main.boot(Main.java:200)       在org.jboss.Main $ 1.run(Main.java:464)       在java.lang.Thread.run(Thread.java:745)

1 个答案:

答案 0 :(得分:0)

终于得到了解决方案。 JBoss执行几个mbeans作为启动配置(在jboss-service.xml中配置)。有一个mbean'JDBCStateManager',它尝试在启动时创建JMS表。有一个mbean'CREATE_TABLES_ON_STARTUP'的属性,我将其配置为FALSE,这意味着在每个JBoss启动时都不执行sql脚本。这解决了我的问题,异常不再存在。 另请在运行应用程序之前按照步骤在SQL Server上配置XA事务。