[JCA/JBoss] - XA Connection error
by smithbstl
I have an XA datasource set up and I am using JDBC. Everytime I try to close my connection object, I get this error log
[org.jboss.resource.connectionmanager.TxConnectionManager] Error during tidyup org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@11e1813[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@192b12d handles=0 lastUse=1157571656156 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1ae0436 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@196a753 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@192b12d txSync=null]
| org.jboss.resource.JBossResourceException: xa tx only!
| at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.getLocalTransaction(XAManagedConnection.java:80)
| at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.tidyup(TxConnectionManager.java:657)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection(BaseConnectionManager2.java:336)
| at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.connectionClosed(TxConnectionManager.java:623)
| at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:266)
| at org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.java:129)
| at com.stlouiscity.database.util.JDBCUtil.close(JDBCUtil.java:121)
| at com.stlouiscity.budget.database.dao.AccountDAOJDBCImpl.findAll(AccountDAOJDBCImpl.java:98)
| at com.stlouiscity.budget.jsf.delegates.AccountService.fillAccountList(AccountService.java:57)
| at com.stlouiscity.budget.jsf.delegates.AccountService.getAccounts(AccountService.java:41)
| at com.stlouiscity.budget.jsf.beans.AccountBacking.listAccounts(AccountBacking.java:91)
| at com.stlouiscity.budget.jsf.beans.AccountBacking.<init>(AccountBacking.java:49)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at java.lang.Class.newInstance0(Class.java:350)
| at java.lang.Class.newInstance(Class.java:303)
| at org.apache.myfaces.util.ClassUtils.newInstance(ClassUtils.java:274)
| at org.apache.myfaces.util.ClassUtils.newInstance(ClassUtils.java:265)
| at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:49)
| at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311)
| at oracle.adfinternal.view.faces.el.AdfFacesVariableResolver.resolveVariable(AdfFacesVariableResolver.java:40)
| at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:569)
| at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
| at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140)
| at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
| at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:425)
| at javax.faces.webapp.UIComponentTag.createComponentInstance(UIComponentTag.java:437)
| at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:391)
| at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:219)
| at oracle.adf.view.faces.webapp.UIXComponentTag.doStartTag(UIXComponentTag.java:85)
| at org.apache.jsp.AccountList_jsp._jspx_meth_af_table_0(AccountList_jsp.java:333)
| at org.apache.jsp.AccountList_jsp._jspx_meth_h_form_0(AccountList_jsp.java:306)
| at org.apache.jsp.AccountList_jsp._jspx_meth_afh_body_0(AccountList_jsp.java:280)
| at org.apache.jsp.AccountList_jsp._jspx_meth_f_view_0(AccountList_jsp.java:162)
| at org.apache.jsp.AccountList_jsp._jspService(AccountList_jsp.java:108)
| at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
| at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
| at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
| at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
| at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
| at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
| at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
| at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
| at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
| at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
| at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
| at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
Most of that garbage is JSF MyFaces stuff but the section at the top is relavant.
Here is my datasource
<datasources>
| <xa-datasource>
| <jndi-name>XAOracleDS</jndi-name>
| <track-connection-by-tx/>
| <isSameRM-override-value>false</isSameRM-override-value>
| <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
| <xa-datasource-property name="URL">jdbc:oracle:thin:@XXX.XXX.X.XXX:XXXX:ora1</xa-datasource-property>
| <xa-datasource-property name="User">budget_access</xa-datasource-property>
| <xa-datasource-property name="Password">budget_access</xa-datasource-property>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| <no-tx-separate-pools/>
| <!--pooling parameters-->
| <min-pool-size>1</min-pool-size>
| <max-pool-size>100</max-pool-size>
| <blocking-timeout-millis>5000</blocking-timeout-millis>
| <idle-timeout-minutes>15</idle-timeout-minutes>
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| </xa-datasource>
|
| <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
| name="jboss.jca:service=OracleXAExceptionFormatter">
| <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
| </mbean>
|
| </datasources>
This is how I am retrieving the connection
public static Connection getConnection()
| throws SQLException
| {
| DataSource ds = null;
| Connection connection = null;
| boolean exceptionRaised = false;
| ds = ServiceLocator.getDataSource("java:comp/env/jdbc/XAOracleDS");
| connection = ds.getConnection();
| connection.setAutoCommit( false );
| return connection;
| }
Here is how I am closing it
public static void close ( Connection connection )
| {
| try
| {
| if( connection != null )
| connection.close();
| }
| catch ( SQLException sqle ) {
| System.out.println(sqle.toString());
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969854#3969854
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969854
19 years, 8 months
[JBoss Eclipse IDE (users)] - Building mutiple MDB deployments using xdoclet
by kapilanand
hi I have an MDBean code that will run with multiple JMS destinations. The way to do this with xdoclet is to call xdoclet multiple times with different values of environment properties and use those environment properties to define the bean name, jms destination name, xdoclet-output-destination etc.
But I do not know how this could be done in JBoss Eclipse IDE.
One way I could do is to customize xdoclet-build.xml and create one build.xml for each MDB and then run them as Ant builds.
But this has two side effects:
1) The target (generation) folders are not auto-refreshed in eclipse
2) These xdoclet-build.xml cannot be reused from a command line build.xml, that builds the whole product. Perhaps I could separate out the xdoclet target in another build.xml that could be included in other build.xml and target invoked with different set of properties. I am not sure if that would work. (Would have worked with an ANT macro).
Please let me know if you have any bright ideas.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969853#3969853
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969853
19 years, 8 months