通过 JCA 进行 Java 主机通信错误 - 连接不在事务中
我正在使用 comporsys JCA 连接器从 Java 连接到大型机环境。 java应用程序部署在JBOSS中。以这种方式配置的连接器:
<connection-factories>
<no-tx-connection-factory>
<jndi-name>ComporsysIMSConnector</jndi-name>
<rar-name>ims_connector_port4027_CreditAuth.rar</rar-name>
<connection-definition>de.comporsys.connector.ims.ConnectionFactory</connection-definition>
<min-pool-size>1</min-pool-size>
<max-pool-size>15</max-pool-size>
<shrinking-enabled>true</shrinking-enabled>
<shrink-period-minutes>2</shrink-period-minutes>
<logging-enabled>true</logging-enabled>
<!-- <log-filename>/opt/jboss/xxxx/logs/ims_connector.log</log-filename> -->
<log-filename>D:\ims_connector.log</log-filename>
</no-tx-connection-factory>
</connection-factories>
通信一定不能 100% 正常,因为我在日志中看到很多错误,如下所示:
[2010-12-16 05:21:10,061] WARN (org.jboss.resource.connectionmanager.NoTxConnectionManager:738) - Pearl 1,DE82000,CGN,D5 ,10450565,768209411 - Connection error occured: org.jboss.resource.connectionmanager.NoTxConnectionManager$NoTxConnectionEventListener@3dcbef2a[state=NORMAL mc=de.comporsys.connector.ims.ManagedConnectionImpl@4743f21b handles=1 lastUse=1292++++++++++++ permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@7afdd15b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@2dbbec72]
de.comporsys.connector.ims.imstoc.ImstocException: IMS Connect-Error: Return=40, Reason=59
at de.comporsys.connector.ims.imstoc.Connection.execute(Connection.java:261)
at de.comporsys.connector.ims.imstoc.IMSTOCWorkunit.execute(IMSTOCWorkunit.java:261)
at de.comporsys.connector.ims.imstoc.IMSTOCWorkunit.resumeTPipe(IMSTOCWorkunit.java:167)
at de.comporsys.connector.ims.imstoc.IMSTOCWorkunit.execute(IMSTOCWorkunit.java:98)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:45)
at de.comporsys.connector.ims.Statement.execute(Statement.java:101)
at com.xxx.ims.access.GenericImsTransaction.executeUCIAysnc(GenericImsTransaction.java:340)
at com.xxx.ims.access.GenericImsTransaction.executeUCI(GenericImsTransaction.java:127)
at com.xxx.ims.access.GenericImsTransaction.execute(GenericImsTransaction.java:60)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:50)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleOverPaymentResponse(UpdateCheckinIMF.java:367)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:219)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:121)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:22)
at com.xxx.core.rental.VehicleCheckinBC.executeUpdateCheckInWizardTransaction(VehicleCheckinBC.java:541)
at com.xxx.core.rental.VehicleCheckinBC.executeVehicleCheckin(VehicleCheckinBC.java:315)
at com.xxx.merlin.vehiclecheckin.VehicleCheckinMH.processMessage(VehicleCheckinMH.java:112)
at com.xxx.merlin.servlet.util.HttpRequestHandler.handleMessage(HttpRequestHandler.java:150)
at com.xxx.merlin.servlet.util.HttpRequestHandler.processRequest(HttpRequestHandler.java:88)
at com.xxx.merlin.servlet.MerlinServlet.doPost(MerlinServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xxx.scope.ServletRequestScopeFilter.doFilter(ServletRequestScopeFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
[2010-12-16 05:21:10,155] WARN (com.xxx.ims.access.GenericImsTransaction:82) - Pearl 1,DE82000,CGN,D5 ,10450565,768209411 - pac71068: ResourceException caught upon IMF execute. IMF body was:/MSKY\/RAN768209411\/MVA10450565\/DOM23021\/DOGY/G8\/COLN\/AGT82000\/OWM\/FLO\/MOPCV\/DLAY\/DOLCGN\/DOD16Dec10/0600\/TAM39058\/ACTA\/RPIY\/ENT\/AUT\/PRTN\@
javax.resource.spi.ResourceAdapterInternalException: de.comporsys.connector.NoActiveTransactionException: connection is not in transaction: de.comporsys.connector.ims.ManagedConnectionImpl@4743f21b
at de.comporsys.connector.AbstractManagedConnection.getActiveTransaction(AbstractManagedConnection.java:216)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:53)
at de.comporsys.connector.ims.Statement.execute(Statement.java:101)
at com.xxx.ims.access.GenericImsTransaction.executeUCIAysnc(GenericImsTransaction.java:340)
at com.xxx.ims.access.GenericImsTransaction.executeUCI(GenericImsTransaction.java:127)
at com.xxx.ims.access.GenericImsTransaction.execute(GenericImsTransaction.java:60)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:50)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleOverPaymentResponse(UpdateCheckinIMF.java:367)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:219)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:121)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:22)
at com.xxx.core.rental.VehicleCheckinBC.executeUpdateCheckInWizardTransaction(VehicleCheckinBC.java:541)
at com.xxx.core.rental.VehicleCheckinBC.executeVehicleCheckin(VehicleCheckinBC.java:315)
at com.xxx.merlin.vehiclecheckin.VehicleCheckinMH.processMessage(VehicleCheckinMH.java:112)
at com.xxx.merlin.servlet.util.HttpRequestHandler.handleMessage(HttpRequestHandler.java:150)
at com.xxx.merlin.servlet.util.HttpRequestHandler.processRequest(HttpRequestHandler.java:88)
at com.xxx.merlin.servlet.MerlinServlet.doPost(MerlinServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xxx.scope.ServletRequestScopeFilter.doFilter(ServletRequestScopeFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
at de.comporsys.connector.ExceptionHandler.handle(ExceptionHandler.java:46)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:55)
at de.comporsys.connector.ims.Statement.execute(Statement.java:101)
at com.xxx.ims.access.GenericImsTransaction.executeUCIAysnc(GenericImsTransaction.java:340)
at com.xxx.ims.access.GenericImsTransaction.executeUCI(GenericImsTransaction.java:127)
at com.xxx.ims.access.GenericImsTransaction.execute(GenericImsTransaction.java:60)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:50)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleOverPaymentResponse(UpdateCheckinIMF.java:367)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:219)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:121)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:22)
at com.xxx.core.rental.VehicleCheckinBC.executeUpdateCheckInWizardTransaction(VehicleCheckinBC.java:541)
at com.xxx.core.rental.VehicleCheckinBC.executeVehicleCheckin(VehicleCheckinBC.java:315)
at com.xxx.merlin.vehiclecheckin.VehicleCheckinMH.processMessage(VehicleCheckinMH.java:112)
at com.xxx.merlin.servlet.util.HttpRequestHandler.handleMessage(HttpRequestHandler.java:150)
at com.xxx.merlin.servlet.util.HttpRequestHandler.processRequest(HttpRequestHandler.java:88)
at com.xxx.merlin.servlet.MerlinServlet.doPost(MerlinServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xxx.scope.ServletRequestScopeFilter.doFilter(ServletRequestScopeFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: de.comporsys.connector.NoActiveTransactionException: connection is not in transaction: de.comporsys.connector.ims.ManagedConnectionImpl@4743f21b
at de.comporsys.connector.AbstractManagedConnection.getActiveTransaction(AbstractManagedConnection.java:216)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:53)
... 52 more
不幸的是,我没有任何信息这意味着什么,因为 composys 不再支持它。 您知道为什么会发生这种情况吗?
有一个 IMSConnectionFactory 初始化 comporsys 的东西。
public static ConnectionFactory getIMSConnectionFactory() {
InitialContext context;
ConnectionFactory imsConnectionFactory = null;
try {
// Create a Properties Object and set the JNDI properties
Properties jndiProperties = new Properties();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, WizardContext.getInstance().getWizardProperties().getJndiClass());
// Try obtaining a JNDI context so that the application server can be queried
context = new InitialContext(jndiProperties);
// Request the Connection Factory from the application server using a JNDI context lookup
imsConnectionFactory = (ConnectionFactory) context.lookup(WizardContext.getInstance().getWizardProperties().getConnectionJndi());
事务处理可能在 m_IMSStatementSync.execute 中,但它是一个黑匣子,因为它是第三方的东西。 IMSConnector 在 JBOSS 中注册,我们在 servlet 中访问它。事务处理程序的详细信息:
for (int attempts = 1 + tenaciousness; attempts > 0;) { 尝试 {
// Slightly nervous re. the location of this block.
// It looks like it should be above, where it is now commented out,
// but moving it there coincided with failures.
// This may well have just been a coincidence - but it all happened at cutover time,
// so for the sake of safety I've put it back here for now.
m_IMSStatementSync = m_IMSConnection.createStatement(); /* This created by the connection factory */
m_IMSRequest = m_IMSStatementSync.createRequest();
m_IMSRequest.setTimeout(m_WizardConfiguration.getWizardTimeOut());
m_IMSRequest.setTransaction(p_Input.get_TransactionCode());
m_IMSRequest.setCommArea(p_Input);
m_IMSRequest.setLterm(p_Input.get_TSR().get_ID());
m_IMSRequest.setTimer((byte) WizardOperationConstants.IMS_CONNECT_SYNC_TIMEOUT);
// end of block
// Execute the IMS transaction
m_IMSReply = m_IMSStatementSync.execute(m_IMSRequest); /*pac7102*/
attempts = 0;
}
catch (NoActiveTransactionException e) {
if (--attempts < 1) {
tenaciousness >>= 1;
throw (e);
}
try {
wait(rnd());
}
catch (InterruptedException f) { ... }
}
I'm connecting to a mainframe environment from Java using comporsys JCA connector. The java application is deployed in JBOSS. The connector configured in that way:
<connection-factories>
<no-tx-connection-factory>
<jndi-name>ComporsysIMSConnector</jndi-name>
<rar-name>ims_connector_port4027_CreditAuth.rar</rar-name>
<connection-definition>de.comporsys.connector.ims.ConnectionFactory</connection-definition>
<min-pool-size>1</min-pool-size>
<max-pool-size>15</max-pool-size>
<shrinking-enabled>true</shrinking-enabled>
<shrink-period-minutes>2</shrink-period-minutes>
<logging-enabled>true</logging-enabled>
<!-- <log-filename>/opt/jboss/xxxx/logs/ims_connector.log</log-filename> -->
<log-filename>D:\ims_connector.log</log-filename>
</no-tx-connection-factory>
</connection-factories>
The communication must no be 100% ok as I see a lot of error in the logs like this:
[2010-12-16 05:21:10,061] WARN (org.jboss.resource.connectionmanager.NoTxConnectionManager:738) - Pearl 1,DE82000,CGN,D5 ,10450565,768209411 - Connection error occured: org.jboss.resource.connectionmanager.NoTxConnectionManager$NoTxConnectionEventListener@3dcbef2a[state=NORMAL mc=de.comporsys.connector.ims.ManagedConnectionImpl@4743f21b handles=1 lastUse=1292++++++++++++ permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@7afdd15b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@2dbbec72]
de.comporsys.connector.ims.imstoc.ImstocException: IMS Connect-Error: Return=40, Reason=59
at de.comporsys.connector.ims.imstoc.Connection.execute(Connection.java:261)
at de.comporsys.connector.ims.imstoc.IMSTOCWorkunit.execute(IMSTOCWorkunit.java:261)
at de.comporsys.connector.ims.imstoc.IMSTOCWorkunit.resumeTPipe(IMSTOCWorkunit.java:167)
at de.comporsys.connector.ims.imstoc.IMSTOCWorkunit.execute(IMSTOCWorkunit.java:98)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:45)
at de.comporsys.connector.ims.Statement.execute(Statement.java:101)
at com.xxx.ims.access.GenericImsTransaction.executeUCIAysnc(GenericImsTransaction.java:340)
at com.xxx.ims.access.GenericImsTransaction.executeUCI(GenericImsTransaction.java:127)
at com.xxx.ims.access.GenericImsTransaction.execute(GenericImsTransaction.java:60)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:50)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleOverPaymentResponse(UpdateCheckinIMF.java:367)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:219)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:121)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:22)
at com.xxx.core.rental.VehicleCheckinBC.executeUpdateCheckInWizardTransaction(VehicleCheckinBC.java:541)
at com.xxx.core.rental.VehicleCheckinBC.executeVehicleCheckin(VehicleCheckinBC.java:315)
at com.xxx.merlin.vehiclecheckin.VehicleCheckinMH.processMessage(VehicleCheckinMH.java:112)
at com.xxx.merlin.servlet.util.HttpRequestHandler.handleMessage(HttpRequestHandler.java:150)
at com.xxx.merlin.servlet.util.HttpRequestHandler.processRequest(HttpRequestHandler.java:88)
at com.xxx.merlin.servlet.MerlinServlet.doPost(MerlinServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xxx.scope.ServletRequestScopeFilter.doFilter(ServletRequestScopeFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
[2010-12-16 05:21:10,155] WARN (com.xxx.ims.access.GenericImsTransaction:82) - Pearl 1,DE82000,CGN,D5 ,10450565,768209411 - pac71068: ResourceException caught upon IMF execute. IMF body was:/MSKY\/RAN768209411\/MVA10450565\/DOM23021\/DOGY/G8\/COLN\/AGT82000\/OWM\/FLO\/MOPCV\/DLAY\/DOLCGN\/DOD16Dec10/0600\/TAM39058\/ACTA\/RPIY\/ENT\/AUT\/PRTN\@
javax.resource.spi.ResourceAdapterInternalException: de.comporsys.connector.NoActiveTransactionException: connection is not in transaction: de.comporsys.connector.ims.ManagedConnectionImpl@4743f21b
at de.comporsys.connector.AbstractManagedConnection.getActiveTransaction(AbstractManagedConnection.java:216)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:53)
at de.comporsys.connector.ims.Statement.execute(Statement.java:101)
at com.xxx.ims.access.GenericImsTransaction.executeUCIAysnc(GenericImsTransaction.java:340)
at com.xxx.ims.access.GenericImsTransaction.executeUCI(GenericImsTransaction.java:127)
at com.xxx.ims.access.GenericImsTransaction.execute(GenericImsTransaction.java:60)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:50)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleOverPaymentResponse(UpdateCheckinIMF.java:367)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:219)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:121)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:22)
at com.xxx.core.rental.VehicleCheckinBC.executeUpdateCheckInWizardTransaction(VehicleCheckinBC.java:541)
at com.xxx.core.rental.VehicleCheckinBC.executeVehicleCheckin(VehicleCheckinBC.java:315)
at com.xxx.merlin.vehiclecheckin.VehicleCheckinMH.processMessage(VehicleCheckinMH.java:112)
at com.xxx.merlin.servlet.util.HttpRequestHandler.handleMessage(HttpRequestHandler.java:150)
at com.xxx.merlin.servlet.util.HttpRequestHandler.processRequest(HttpRequestHandler.java:88)
at com.xxx.merlin.servlet.MerlinServlet.doPost(MerlinServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xxx.scope.ServletRequestScopeFilter.doFilter(ServletRequestScopeFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
at de.comporsys.connector.ExceptionHandler.handle(ExceptionHandler.java:46)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:55)
at de.comporsys.connector.ims.Statement.execute(Statement.java:101)
at com.xxx.ims.access.GenericImsTransaction.executeUCIAysnc(GenericImsTransaction.java:340)
at com.xxx.ims.access.GenericImsTransaction.executeUCI(GenericImsTransaction.java:127)
at com.xxx.ims.access.GenericImsTransaction.execute(GenericImsTransaction.java:60)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:50)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleOverPaymentResponse(UpdateCheckinIMF.java:367)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:219)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:229)
at com.xxx.ims.UpdateCheckinIMF.handleRepromptWithEnter(UpdateCheckinIMF.java:280)
at com.xxx.ims.UpdateCheckinIMF.parseOutput(UpdateCheckinIMF.java:208)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:57)
at com.xxx.ims.UpdateCheckinIMF.executeTransactionInternally(UpdateCheckinIMF.java:28)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:121)
at com.xxx.ims.GenericCheckinOperation.executeTransaction(GenericCheckinOperation.java:22)
at com.xxx.core.rental.VehicleCheckinBC.executeUpdateCheckInWizardTransaction(VehicleCheckinBC.java:541)
at com.xxx.core.rental.VehicleCheckinBC.executeVehicleCheckin(VehicleCheckinBC.java:315)
at com.xxx.merlin.vehiclecheckin.VehicleCheckinMH.processMessage(VehicleCheckinMH.java:112)
at com.xxx.merlin.servlet.util.HttpRequestHandler.handleMessage(HttpRequestHandler.java:150)
at com.xxx.merlin.servlet.util.HttpRequestHandler.processRequest(HttpRequestHandler.java:88)
at com.xxx.merlin.servlet.MerlinServlet.doPost(MerlinServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xxx.scope.ServletRequestScopeFilter.doFilter(ServletRequestScopeFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: de.comporsys.connector.NoActiveTransactionException: connection is not in transaction: de.comporsys.connector.ims.ManagedConnectionImpl@4743f21b
at de.comporsys.connector.AbstractManagedConnection.getActiveTransaction(AbstractManagedConnection.java:216)
at de.comporsys.connector.AbstractStatement.executeRequest(AbstractStatement.java:53)
... 52 more
Unfortunately I do not have any info what does it mean as composys does not support it any more.
Do you have any idea why this happens?
There is an IMSConnectionFactory which initializes the comporsys stuff
public static ConnectionFactory getIMSConnectionFactory() {
InitialContext context;
ConnectionFactory imsConnectionFactory = null;
try {
// Create a Properties Object and set the JNDI properties
Properties jndiProperties = new Properties();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, WizardContext.getInstance().getWizardProperties().getJndiClass());
// Try obtaining a JNDI context so that the application server can be queried
context = new InitialContext(jndiProperties);
// Request the Connection Factory from the application server using a JNDI context lookup
imsConnectionFactory = (ConnectionFactory) context.lookup(WizardContext.getInstance().getWizardProperties().getConnectionJndi());
Ther transaction handling might be in m_IMSStatementSync.execute, but it is a black box as it is a third party stuff. The IMSConnector registere in JBOSS and we access it in a servlet. Details of the transaction handler:
for (int attempts = 1 + tenaciousness; attempts > 0;) {
try {
// Slightly nervous re. the location of this block.
// It looks like it should be above, where it is now commented out,
// but moving it there coincided with failures.
// This may well have just been a coincidence - but it all happened at cutover time,
// so for the sake of safety I've put it back here for now.
m_IMSStatementSync = m_IMSConnection.createStatement(); /* This created by the connection factory */
m_IMSRequest = m_IMSStatementSync.createRequest();
m_IMSRequest.setTimeout(m_WizardConfiguration.getWizardTimeOut());
m_IMSRequest.setTransaction(p_Input.get_TransactionCode());
m_IMSRequest.setCommArea(p_Input);
m_IMSRequest.setLterm(p_Input.get_TSR().get_ID());
m_IMSRequest.setTimer((byte) WizardOperationConstants.IMS_CONNECT_SYNC_TIMEOUT);
// end of block
// Execute the IMS transaction
m_IMSReply = m_IMSStatementSync.execute(m_IMSRequest); /*pac7102*/
attempts = 0;
}
catch (NoActiveTransactionException e) {
if (--attempts < 1) {
tenaciousness >>= 1;
throw (e);
}
try {
wait(rnd());
}
catch (InterruptedException f) { ... }
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从堆栈跟踪中可以清楚地看出警告的原因:
....但您肯定想澄清该接口是否实际工作。无论如何,连接不在事务中的警告是因为您将 JCA 池定义为非事务池。为了切换到事务池,它应该看起来像这样:
我假设这仅受支持,因为警告消息表明它期望连接位于事务中,这就是 tx-connection-factory< /strong> 就可以了。
我会尝试一下,看看会发生什么。
The reason for the warning is fairly explicit from the stack trace:
.... but you would definitely want to clarify whether or not the interface is actually working or not. At any rate, the warning that the connection is not in a transaction is because you have your JCA pool defined as a non-transactional pool. In order to switch to a transactional pool, it should look something like this:
I am assuming this is supported only because the warning message indicates it expects the connections to be in a transaction which is what the tx-connection-factory will do.
I would give it a spin and see what happens.
事务连接工厂声明是必要的,但还不够。
您还需要向与数据库交互的方法添加声明性事务。我推荐“PROPAGATION=REQUIRED_NEW”。
Transaction connection factory declaration is necessary, but not sufficient.
You also need to add a declarative transaction to the methods that interact with the database. I'd recommend "PROPAGATION=REQUIRED_NEW".
您从哪个位置发起对 JCA 资源的呼叫?
换句话说,什么是
?
从堆栈跟踪中可以清楚地看出,这里不涉及 EJB。该调用来自 Servlet,然后传播到您自己的代码,直到使用 JCA 连接。
GenericImsTransaction
听起来像是做了一些事务性的事情,但到底是什么?您应该验证是否有一个JTA
事务正在某处启动。在您的 Servlet 中,您可以获取 UserTransaction,这是一个用于启动和提交 JTA 事务的简单接口:如果您使用的是 Java EE 5 之前版本的 JBoss AS,那么您可以使用以下代码来获取UserTransaction:
在调用堆栈中的某个位置,您需要调用
tx.begin();
,然后调用tx.commit()
或tx.rollback().
如果您能够使用 EJB3,那么让您的 Servlet 调用无状态会话 bean (@Stateless),然后让该 bean 调用您的其他代码会更容易。然后,您将自动拥有一个事务,并且容器将负责提交或回滚它。如果您尚未使用 EJB,则可能很难改造现有代码以使用它们,并且手动 JTA 代码可能更容易插入。
From what location are you initiating the call to your JCA resource?
In other words, what is
?
From the stack trace it seems clear that there is no EJB involved here. The call comes in from a Servlet and then propagates to your own code until the JCA connection is being used.
GenericImsTransaction
sounds like it does something transactional, but what exactly? You should verify that there is aJTA
transaction being started somewhere. In your Servlet you can get a hold of a UserTransaction, which is a simple interface to start and commit JTA transactions:If you're using a pre-Java EE 5 version of JBoss AS, then you can use the following code to obtain a UserTransaction:
Somewhere in your callstack, you then need to call
tx.begin();
and afterwardstx.commit()
ortx.rollback()
.If you're able to use EJB3, then it's easier to let your Servlet call a stateless session bean (@Stateless) and then let this bean call your other code. You will then automatically have a transaction and the container will take care of committing or rolling it back. If you're not yet using EJBs it may be difficult to retrofit the existing code into using them and the manual JTA code may be easier to insert.