Transaction Error in Jboss 5.1

I wanted to deploy a web project on Jboss 5.1, which was deployed in Jboss 4.0 successfully. I could deploy the project in Jboss 5.1 properly but it gives following user transaction error whilst executing.


12:06:47,640 ERROR [STDERR] java.lang.ClassCastException: org.jboss.tm.usertx.cl
ient.ServerVMClientUserTransaction cannot be cast to javax.transaction.UserTrans
action
12:06:47,640 ERROR [STDERR] at xxx.xxxxxxx.xxxxxx.xxxl.Transaction
Handler.(TransactionHandler.java:60)
12:06:47,640 ERROR [STDERR] at xxx.xxxxxxx.xxxxxx.xxxl.xxxxxxxx.xxxXxxx(XxxXxxx.java:64)
12:06:47,640 ERROR [STDERR] at xxx.xxxxxxx.xxxxxx.xxxl.xxxxxxxx.xxxXxxx(XxxxXxxxxxXxxxxx.java:1135)
12:06:47,640 ERROR [STDERR] at xxx.xxxxxxx.xxxxxx.xxxl.xxxxxxxx.xxxXxxx(XxxxXxxxxxXxxxxx .java:94)
12:06:47,640 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
12:06:47,640 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
12:06:47,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
12:06:47,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
12:06:47,640 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
12:06:47,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
12:06:47,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
12:06:47,640 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
12:06:47,640 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
12:06:47,640 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
12:06:47,640 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
12:06:47,640 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
12:06:47,656 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
12:06:47,656 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
12:06:47,656 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
12:06:47,656 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
12:06:47,656 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
12:06:47,656 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
12:06:47,656 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
12:06:47,656 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
12:06:47,656 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker
.run(JIoEndpoint.java:447)12:06:47,656 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)


Then I looked into the code according to error given. Error is generated with following line in Transction Handling class but that line is corrected.


transaction = (UserTransaction) initial.lookup("java:comp/UserTransaction");

When searched on Internet, I could find above java code is correct and this is relating to library in Jboss 5.x. They have suggested to remove ‘jta.jar’ library inside the project. Then I could fix the issue.

References:
http://www.coderanch.com/t/90895/JBoss/Tomcat-JBoss-Migration
https://community.jboss.org/thread/145531

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s