0 Replies Latest reply on Nov 30, 2005 1:52 PM by sateesh kumar

    TransactionManager not bound !!

    sateesh kumar Newbie

      HI,

      I am using the JBoss-4.0.3 App Server and using Hibernate 3.0.5.

      When i try to get the Transaction Manager using the following code i am getting the following Exception

      try{
       Hashtable environment = new Hashtable();
       environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       //environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
       environment.put(Context.PROVIDER_URL, "jnp://localhost:1099"); // remote machine IP
       InitialContext context = new InitialContext(environment);
       org.jboss.tm.TxManager mgr = (org.jboss.tm.TxManager) context.lookup("java:TransactionManager");
       out.println(" TransactionManager :"+mgr);
       }
       catch(Exception e){
       out.println("Exception ="+e);
       e.printStackTrace();
       }
      



      javax.naming.NameNotFoundException: TransactionManager not bound

      
      13:49:09,328 INFO [STDOUT] javax.naming.NameNotFoundException: TransactionManager not bound
      13:49:09,328 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
      13:49:09,328 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
      13:49:09,328 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
      13:49:09,328 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
      13:49:09,328 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      13:49:09,328 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      13:49:09,328 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      13:49:09,328 INFO [STDOUT] at org.apache.jsp.dsTest_jsp._jspService(org.apache.jsp.dsTest_jsp:56)
      13:49:09,328 INFO [STDOUT] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      13:49:09,328 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      13:49:09,328 INFO [STDOUT] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      13:49:09,328 INFO [STDOUT] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      13:49:09,328 INFO [STDOUT] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      13:49:09,328 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      13:49:09,328 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      13:49:09,328 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      13:49:09,328 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      13:49:09,328 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      13:49:09,328 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      13:49:09,328 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      13:49:09,328 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      13:49:09,328 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      13:49:09,328 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      13:49:09,328 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
      
      


      But when i go to the jmx-console and to the JNDI View i see the TransactionManager in the java: Name Space..

      java: Namespace
       +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
       +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
       +- comp (class: javax.naming.Context)
       +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
       +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
       +- jaas (class: javax.naming.Context)
       | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
       | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
       | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
       +- timedCacheFactory (class: javax.naming.Context)
      Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
       +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
       +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
       +- Mail (class: javax.mail.Session)
       +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
       +- TransactionManager (class: org.jboss.tm.TxManager)
      Global JNDI Namespace
       +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
       +- jmx (class: org.jnp.interfaces.NamingContext)
       | +- invoker (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor (proxy: $Proxy39 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
       | +- rmi (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
       +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
       +- UserTransactionSessionFactory (proxy: $Proxy12 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
       +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
       +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
       +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
       +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
       +- queue (class: org.jnp.interfaces.NamingContext)
       | +- A (class: org.jboss.mq.SpyQueue)
       | +- testQueue (class: org.jboss.mq.SpyQueue)
       | +- ex (class: org.jboss.mq.SpyQueue)
       | +- DLQ (class: org.jboss.mq.SpyQueue)
       | +- D (class: org.jboss.mq.SpyQueue)
       | +- C (class: org.jboss.mq.SpyQueue)
       | +- B (class: org.jboss.mq.SpyQueue)
       +- topic (class: org.jnp.interfaces.NamingContext)
       | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
       | +- testTopic (class: org.jboss.mq.SpyTopic)
       | +- securedTopic (class: org.jboss.mq.SpyTopic)
       +- console (class: org.jnp.interfaces.NamingContext)
       | +- PluginManager (proxy: $Proxy40 implements interface org.jboss.console.manager.PluginManagerMBean)
       +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
       +- jbpmDS (class: javax.sql.DataSource)
       +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
       +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
       +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
       +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
      
      


      Pls let me know how can i resolve this..