0 Replies Latest reply on May 6, 2013 9:54 AM by Bala Subrahmanyam

    javax.naming.NameNotFoundException: comp not bound after jboss upgrade from 3.2 to 6

    Bala Subrahmanyam Newbie

      I had migrated one project from jboss3.2 to jboss 6.After that if i try to login to the application then it is throwing one error at database lookup.

       

      Please find the code snippets and error log below.

       

      error log:

       

      javax.ejb.EJBException: nested exception is: javax.naming.NameNotFoundException: comp not bound

      javax.naming.NameNotFoundException: comp not bound

          at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

          at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

          at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

          at org.jnp.server.NamingServer.lookup(NamingServer.java:396)

          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)

          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)

          at javax.naming.InitialContext.lookup(InitialContext.java:392)

          at flow.common.SimpleOrmHelper.attach(SimpleOrmHelper.java:51)

          at flow.common.SimpleOrmHelper.attach(SimpleOrmHelper.java:28)

          at flow.gui.base.impl.UserInformationDAO.store(UserInformationDAO.java:41)

          at flow.gui.base.impl.Session_impl.storeUserInfo(Session_impl.java:347)

          at flow.gui.base.impl.Session_impl.login(Session_impl.java:197)

          at flow.gui.base.impl.SessionHandler.login(SessionHandler.java:654)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)

          at sun.rmi.transport.Transport$1.run(Transport.java:159)

          at java.security.AccessController.doPrivileged(Native Method)

          at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

       

       

      code snippet:

       

      InitialContext initCtx = new InitialContext();

      DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/RDBMS");     error at this line

       

      my jboss.xml:

       

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 6.0//EN"

                             "http://www.jboss.org/j2ee/dtd/jboss_6_0.dtd">

      <jboss>

      <enterprise-beans>

        .....

        <session>

         <ejb-name>TransactionGUIHandler</ejb-name>

         <jndi-name>System/System1/ApplicationType/ServiceActivation/Application/1-0;1-0;Order/Comp/TransactionGUIHandler</jndi-name>

         <ejb-ref>

          <ejb-ref-name>ejb/TransportAdaptor</ejb-ref-name>

          <jndi-name>System/System1/ApplicationType/ServiceActivation/Application/1-0;1-0;Order/Comp/TransportAdaptorInternal</jndi-name>

         </ejb-ref>

         <resource-ref>

          <res-ref-name>jdbc/RDBMS</res-ref-name>

          <resource-name>res/RDBMS</resource-name>

         </resource-ref>

        </session>

      </enterprise-beans>

      <resource-managers>

        ......

        <resource-manager>

         <res-name>res/RDBMS</res-name>

         <res-jndi-name>java:OracleDS</res-jndi-name>

        </resource-manager>

      </resource-managers>

      </jboss>

       

      Note :OracleDS is the jndi name mentioned in oracle-ds.xml file.

       

       

      my ejb-jar.xml :

       

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"

                               "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>

      <display-name>ServiceActivation</display-name>

      <enterprise-beans>

        ......

        <session>

         <ejb-name>TransactionGUIHandler</ejb-name>

         <home>app.framework.oss.order.TransactionGUIHandlerHome</home>

         <remote>app.framework.oss.order.TransactionGUIHandler</remote>

         <ejb-class>app.framework.oss.order.TransactionGUIHandlerBean</ejb-class>

         <session-type>Stateless</session-type>

         <transaction-type>Bean</transaction-type>

         <ejb-ref>

          <description>Handles tasks specific to the transport protocol</description>

          <ejb-ref-name>ejb/TransportAdaptor</ejb-ref-name>

          <ejb-ref-type>Session</ejb-ref-type>

          <home>app.framework.oss.order.TransportAdaptorHome</home>

          <remote>app.framework.oss.order.TransportAdaptor</remote>

         </ejb-ref>

         <resource-ref>

          <res-ref-name>jdbc/RDBMS</res-ref-name>

          <res-type>javax.sql.DataSource</res-type>

          <res-auth>Container</res-auth>

         </resource-ref>

        </session>

        ........

        </enterprise-beans>

      </ejb-jar>

       

       

      Please help me to resolve the issue.

       

      Regards,

      Subbu.