我解决了这个问题,这是存储过程权限的问题。数据源配置了对存储过程没有权限的用户。在使用正确的权限进行测试后,代码正在运行并且交易正常。我尝试使用正常的 JDBC 连接 [不使用数据源] 执行存储过程。这一步给了我空指针异常,通过它我了解了访问权限。
我没有在上一篇文章中提交的异常“The null”的长堆栈跟踪中有一个线索,但对我来说,上面建议与数据源连接相同。感谢任何试图提供帮助的人。我希望这可能是其他人的未来,对我来说是一个奇怪的错误。
org.jboss.tm.JBossTransactionRolledbackException: ***null***; nested exception is:
org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serverip/13308, BranchQual=, localId=13308] status=STATUS_NO_TRANSACTION; - nested throwable: (org.jboss.resource.connectionmanager.JBossLocalXAException: could not commit local tx; - nested throwable: (org.jboss.resource.JBossResourceException: SQLException; - nested throwable: (java.sql.SQLException: No operations allowed after connection closed.))); - nested throwable: (org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serverip/13308, BranchQual=, localId=13308] status=STATUS_NO_TRANSACTION; - nested throwable: (org.jboss.resource.connectionmanager.JBossLocalXAException: could not commit local tx; - nested throwable: (org.jboss.resource.JBossResourceException: SQLException; - nested throwable: (java.sql.SQLException: No operations allowed after connection closed.))))
at org.jboss.ejb.plugins.TxInterceptorCMT.throwJBossException(TxInterceptorCMT.java:569)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:506)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)