Java 无法检查jboss 7.1.1中的JDBC自动提交模式异常
当我在smooks中使用xml java转换时。获取异常是无法检查JDBC自动提交模式。 我的应用集成了seam 2.1.2、jap、richfaces、smooks 使用smooks检索clob列值时显示错误? 例外情况是:Java 无法检查jboss 7.1.1中的JDBC自动提交模式异常,java,hibernate,jpa,jboss7.x,smooks,Java,Hibernate,Jpa,Jboss7.x,Smooks,当我在smooks中使用xml java转换时。获取异常是无法检查JDBC自动提交模式。 我的应用集成了seam 2.1.2、jap、richfaces、smooks 使用smooks检索clob列值时显示错误? 例外情况是: Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not inspect JDBC autocommit mode
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not inspect JDBC autocommit mode
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629) [hibernate-entitymanager.jar:4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)]
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73) [hibernate-entitymanager.jar:4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)]
at com.manam.mobee.telco.impl.TelcoManagerImpl.getTelcoList(TelcoManagerImpl.java:46) [classes:]
at com.manam.mobee.customer.MobeeCustomerHome.create(MobeeCustomerHome.java:301) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_11]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_11]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.1.2]
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.1.2]
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.1.2]
at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:56) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.1.2]
at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97) [jboss-seam.jar:2.1.2]
at org.jboss.seam.util.Work.workInTransaction(Work.java:47) [jboss-seam.jar:2.1.2]
at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.1.2]
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.1.2]
at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam.jar:2.1.2]
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [jboss-seam.jar:2.1.2]
at com.manam.mobee.customer.MobeeCustomerHome_$$_javassist_seam_10.create(MobeeCustomerHome_$$_javassist_seam_10.java) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_11]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_11]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.1.2]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.1.2]
at org.jboss.seam.Component.callComponentMethod(Component.java:2249) [jboss-seam.jar:2.1.2]
at org.jboss.seam.Component.callCreateMethod(Component.java:2172) [jboss-seam.jar:2.1.2]
at org.jboss.seam.Component.newInstance(Component.java:2132) [jboss-seam.jar:2.1.2]
... 84 more
Caused by: org.hibernate.exception.GenericJDBCException: could not inspect JDBC autocommit mode
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:248) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:417) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1126) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64) [hibernate-entitymanager.jar:4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)]
... 120 more
Caused by: java.sql.SQLException: Transaction cannot proceed STATUS_MARKED_ROLLBACK
at org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:240)
at org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.java:1599)
at org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:1614)
at org.jboss.jca.adapters.jdbc.WrappedConnection.getAutoCommit(WrappedConnection.java:731)
at org.hibernate.jdbc.ConnectionManager.isAutoCommit(ConnectionManager.java:189) [hibernate3.jar:3.2.4.sp1]
at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:239) [hibernate3.jar:3.2.4.sp1]
... 124 more
例如:
private DoCustomerChange runSmooks(MobeeCustomerChange mobeeCustomerChange) throws IOException, SAXException, SmooksException {
// Instantiate Smooks with the config...
Smooks smooks = new Smooks();
try {
smooks.getClassLoader().getResourceAsStream("/WEB-INF/smooksProfileChangeConfig_xmlToJava.xml");
// Create an exec context - no profiles....
ExecutionContext executionContext = smooks.createExecutionContext();
// The result of this transform is a set of Java objects...
// Configure the execution context to generate a report...
executionContext.setEventListener(new HtmlReportGenerator("target/report/report.html"));
JavaResult result = new JavaResult();
// Filter the input message to extract, using the execution context...
smooks.filterSource(executionContext, new StreamSource(new ByteArrayInputStream(readInputMessage(mobeeCustomerChange))), result);
return (DoCustomerChange) result.getBean("doCustomerChange");
} finally {
smooks.close();
}
}
private byte[] readInputMessage(MobeeCustomerChange mobeeCustomerChange) {
try {
//return DatabaseUtils.getMessageString(getInstance().getProfile()).getBytes();
// StreamUtils.readStream(is);
//StreamUtils.readStream(dEn.decrypt(DatabaseUtils.covertClobtoByte(profileAudit.getProfileChanges())));
return StreamUtils.readStream(mobeeCustomerChange.getProfileChanges().getAsciiStream());
} catch (Exception e) {
e.printStackTrace();
return "<no-message/>".getBytes();
}
}
private DoCustomerChange runSmooks(MobeeCustomerChange MobeeCustomerChange)抛出IOException、SAXException、smooksceception{
//使用配置实例化Smooks。。。
Smooks Smooks=新Smooks();
试一试{
smooks.getClassLoader().getResourceAsStream(“/WEB-INF/smooksProfileChangeConfig_xmlToJava.xml”);
//创建exec上下文-无配置文件。。。。
ExecutionContext ExecutionContext=smooks.createExecutionContext();
//此转换的结果是一组Java对象。。。
//配置执行上下文以生成报告。。。
setEventListener(新的HtmlReportGenerator(“target/report/report.html”);
JavaResult=新的JavaResult();
//使用执行上下文筛选要提取的输入消息。。。
filterSource(executionContext,newstreamsource(newbytearrayinputstream(readInputMessage(mobeecusterchange))),result);
return(DoCustomerChange)result.getBean(“DoCustomerChange”);
}最后{
smooks.close();
}
}
专用字节[]readInputMessage(MobeeCustomerChange MobeeCustomerChange){
试试{
//返回DatabaseUtils.getMessageString(getInstance().getProfile()).getBytes();
//StreamUtils.readStream(is);
//readStream(dEn.decrypt(DatabaseUtils.covertClobtoByte(profileAudit.getProfileChanges()));
返回StreamUtils.readStream(mobeeCustomerChange.getProfileChanges().getAscistream());
}捕获(例外e){
e、 printStackTrace();
返回“.getBytes();
}
}
我对smooks一无所知,但我看不出与代码和错误消息有任何关联。是的,同样的代码在jboss 4.1.2中运行良好,现在迁移jboss 7.1.1时,我遇到了这个异常。当我生成xml时,java runSmooks(mobeeCustomerChange)方法返回值为null。因此它遇到了这个异常。