当原因未知时如何调试问题
我们在 weblogic server v10.3.2.0 中遇到以下异常。我们使用 JRockit JRE 6.0。
每个服务器请求涉及大约 6-7 个 XA 数据源。当最后一个数据源的处理刚刚开始时,我们会遇到此异常。
请有人指教。
java.sql.SQLException: Unexpected exception while enlisting XAConnection
java.sql.SQLException: Transaction rolled back: setRollbackOnly called on transaction
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1616)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init(JtaTransaction.java:68)
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.getConnection(JtaTransaction.java:131)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82)
We are facing the following exception in weblogic server v10.3.2.0. We are using JRockit JRE 6.0.
We have around 6-7 XA datasources involved in every server request. We face this exception when processing on the last datasource just begins.
Please someone advise.
java.sql.SQLException: Unexpected exception while enlisting XAConnection
java.sql.SQLException: Transaction rolled back: setRollbackOnly called on transaction
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1616)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init(JtaTransaction.java:68)
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.getConnection(JtaTransaction.java:131)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如您所写,此示例中的原因未知。
我们可以看到该事务已被标记为“必须回滚”,可能是在出现问题时被之前的数据源标记为“必须回滚”。
也许您可以检查以前的日志,对于以前的数据源,以找到原因?
As you wrote, the cause is unkown in this sample.
We can see the transaction has been marked as "must roll back", probably by the previous datasources when something went wrong.
Maybe you can check previous logs, for the previous datasource, to find the cause ?
你说它是最后一个数据源 - 你读过这个吗? :http://muness.blogspot.com/2005/09/分布式事务和超时.html 。
如果您需要更多信息,您可以将 ibatis 替换为被黑客攻击的版本 com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init() 吗?在那里添加一些日志记录,您可能会了解更多。
You say that it is the last datasource - have you read this ? : http://muness.blogspot.com/2005/09/distributed-transactions-and-timeouts.html .
If you need more info, can you replace ibatis with a version with hacked com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init() ? Add some logging there and you'll know more, probably.
如果我不得不猜测,我会说最后一个数据源没有正确配置为 XA 数据源,没有安装 XA 驱动程序,或者不支持 XA。
您是否在这里进行任何有趣的异常处理来截断堆栈(捕获重新抛出但仅保留顶部堆栈帧集)或使用自定义异常处理库?如果你是我就会放弃它。似乎应该有一个
由以下原因引起:
具有与数据源的驱动程序相关的附加较低级别堆栈,这会显示附加信息。如果情况并非如此,这是您获得的唯一信息。可能是时候将服务器的日志记录提高到
debug
或trace
,并深入了解Weblogic如何完成工作。或者,如果您受到支持,我会验证您与供应商的驱动程序版本/配置。如果不是,您需要查找文档并亲自验证。
If I had to guess I would say the last datasource is not configured properly as an XA datasource, doesn't have the the XA driver installed, or doesn't support XA.
Are you doing any funny exception handling here that would truncate the stack(Catching re-throwing but only keeping the top set of stack frames) or using a custom exception handling library? If you are I would abandon it. It seems like there should be a
caused by:
with additonal lower level stack related to your datasource's drivers that would reveal additional information.If that isn't the case and this is the only info you're getting. It might be time to crank your server's logging up to
debug
ortrace
and get down and dirty with how weblogic gets things done..Alternatively, if you are supported I would verify your driver versions/ configurations with your vendor. If you're not, you need to track down the documentation and verify for yourself.