1 Reply Latest reply on Jul 30, 2007 8:15 PM by Sri R

    Transaction - ClassCastException

    Sri R Newbie

      Hello,

      I am trying to lookp (and eventually start) a transaction in a servlet using the code below.

      InitialContext ctx = new InitialContext();
      javax.transaction.UserTransaction tm = (javax.transaction.UserTransaction) ctx.lookup("UserTransaction");


      I get the following exception. Please help!!!! Stack trace below.

      thx
      Sri
      ------------
      2007-07-19 14:41:06,713 ERROR [STDERR] java.lang.ClassCastException: org.jboss.tm.usertx.client.ServerVMClientUserTransaction
      2007-07-19 14:41:06,713 ERROR [STDERR] at testcache.s1.processRequest(s1.java:50)
      2007-07-19 14:41:06,713 ERROR [STDERR] at testcache.s1.doGet(s1.java:102)
      2007-07-19 14:41:06,713 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      2007-07-19 14:41:06,713 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      2007-07-19 14:41:06,713 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      2007-07-19 14:41:06,713 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)