报表上传jboss服务器出错

用ireport写的报表,在同一个表中,连接两个数据库,但是另一个库使用的近义词,在上传时候,报出Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
(javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist  resource, see the previous warnings. tx=TransactionImple < ac, BasicAction .... Could not enlist in transaction on entering meta-aware object!;
后来上网查询,发现是因为没有设置jboss服务器在一个事务中访问多个数据库。
解决方式是修改下jboss的配置:

conf/jbossjta-properties.xml (JBoss-4.x) or conf/jbossts-properies.xml (JBoss 5) 
在<properties depends="arjuna" name="jta">
节点下增加:
<!-- 支持一个事务中包括多个数据源 -->
<property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"/>

猜你喜欢

转载自wunan1402.iteye.com/blog/1420276