2 Replies Latest reply on Dec 6, 2006 2:05 AM by Kevin Conner

    Error in UserTransaction

    Ramesh S Newbie

      hi,
      i am new to jboss
      i am using jboss-4.0.4.GA

      when i going to lookup javax.transaction.UserTransaction error occured ...

      This My test program details

      in my servlet
      Context ctx = new InitialContext();
      System.out.println("objName"+ctx.lookup("java:/comp/env/jdbc/usertransaction").toString());
      UserTransaction us = (UserTransaction)ctx.lookup("java:/comp/env/jdbc/usertransaction");

      ..............................................................................................
      This is my web.xml

      </resource-ref>
      <resource-ref>
      <res-ref-name>jdbc/usertransaction</res-ref-name>
      <res-type>javax.transaction.UserTransaction</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      ....................................................................................................
      This is my jboss-web.xml

      <resource-ref>
      <res-ref-name>jdbc/usertransaction</res-ref-name>
      <res-type>javax.transaction.UserTransaction</res-type>
      <jndi-name>java:comp/UserTransaction</jndi-name>
      </resource-ref>

      Error I get when I try to invoke the servlet :
      ...................................
      20:39:51,656 INFO [STDOUT] objNameorg.jboss.tm.usertx.client.ServerVMClientUserTransaction@1cbc5cb
      20:30:08,328 ERROR [[test]] Servlet.service() for servlet test threw exception
      java.lang.ClassCastException: org.jboss.tm.usertx.client.ServerVMClientUserTransaction
      at com.Test.doGet(Test.java:53)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      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.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(Unknown Source)



      pls help me
      Ramesh