4 Replies Latest reply on Apr 26, 2003 3:14 PM by Andy Paramonov

    NameNotFoundException during lookup

    Andy Paramonov Newbie

      Hi,

      I deployed connector (*.rar + *-ds.xml) in JB3.2, but could not lookup connection factory in JNDI tree from a client.

      JB log is

      11:43:21,975 INFO [MainDeployer] Starting deployment of package: file:/D:/jboss/jboss-3.2.0/server/ndp/deploy/ndp-connector-caas.rar
      11:43:22,075 INFO [RARMetaData] Loading JBoss Resource Adapter for CAAS EIS
      11:43:22,075 INFO [RARMetaData] License terms present. See deployment descriptor.
      11:43:22,075 INFO [RARDeployer] looking for nested deployments in : file:/D:/jboss/jboss-3.2.0/server/ndp/deploy/ndp-connector-caas.rar
      11:43:22,095 INFO [RARDeployer] nested deployment: file:/D:/jboss/jboss-3.2.0/server/ndp/tmp/deploy/server/ndp/deploy/ndp-connector-caas.rar/34.ndp-connector-caas.rar-contents/ndp-connector-caas.jar
      11:43:22,115 INFO [JARDeployer] looking for nested deployments in : file:/D:/jboss/jboss-3.2.0/server/ndp/tmp/deploy/server/ndp/deploy/ndp-connector-caas.rar/34.ndp-connector-caas.rar-contents/ndp-connector-caas.jar
      11:43:22,145 INFO [MainDeployer] Deployed package: file:/D:/jboss/jboss-3.2.0/server/ndp/deploy/ndp-connector-caas.rar
      11:43:22,155 INFO [MainDeployer] Starting deployment of package: file:/D:/jboss/jboss-3.2.0/server/ndp/deploy/ndp-connector-caas-ds.xml
      11:43:22,185 INFO [XSLSubDeployer] transformed into doc: [#document: null]
      11:43:22,185 INFO [SARDeployer] looking for nested deployments in : file:/D:/jboss/jboss-3.2.0/server/ndp/deploy/ndp-connector-caas-ds.xml
      11:43:22,256 INFO [RARDeployment] Creating
      11:43:22,256 INFO [RARDeployment] Created
      11:43:22,266 INFO [JBossManagedConnectionPool] Creating
      11:43:22,266 INFO [JBossManagedConnectionPool] Created
      11:43:22,266 INFO [NoTxConnectionManager] Creating
      11:43:22,266 INFO [NoTxConnectionManager] Created
      11:43:22,266 INFO [RARDeployment] Starting
      11:43:22,316 INFO [RARDeployment] Started
      11:43:22,316 INFO [JBossManagedConnectionPool] Starting
      11:43:22,326 INFO [JBossManagedConnectionPool] Started
      11:43:22,326 INFO [NoTxConnectionManager] Starting
      11:43:22,356 INFO [ndp/CAASConnectionFactory] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=NoTxCM,name=ndp/CAASConnectionFactory to JNDI name 'java:/ndp/CAASConnectionFactory'
      11:43:22,366 INFO [NoTxConnectionManager] Started
      11:43:22,376 INFO [MainDeployer] Deployed package: file:/D:/jboss/jboss-3.2.0/server/ndp/deploy/ndp-connector-caas-ds.xml

      Client's log

      11:50:53,645 [INFO, CAASClient] Created context=javax.naming.InitialContext@df503, URL=localhost:1199, Factory=org.jnp.interfaces.NamingContextFactory
      11:50:53,645 [INFO, CAASClient] Looking up a 'ndp/CAASConnectionFactory'
      11:50:54,947 [ERROR, CAASClient] ndp not bound
      javax.naming.NameNotFoundException: ndp not bound
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.ndp.ra.client.CAASClient.testConnection(CAASClient.java:43)
      at org.ndp.ra.client.CAASClient.main(CAASClient.java:70)

      Can somebody help me?

      Thanks,
      Andy

        • 1. Re: NameNotFoundException during lookup
          Harald Gliebe Novice

          Like DataSources, a JCA connector can only be accessed within the same VM. Encapsulate the access to the connector in a session bean to make it available to external clients.

          • 2. Re: NameNotFoundException during lookup
            Andy Paramonov Newbie

            Hi Harald,

            I "wraped" connector by session bean, but problem is still alive. Now bean cannot lookup ConnectionFactory.

            JB log is

            17:27:33,690 DEBUG [CAASConnectorBean] setSessionContext called
            17:27:33,690 DEBUG [CAASConnectorBean] ejbCreate called
            17:27:33,690 DEBUG [CAASConnectorBean] getConnection called:
            17:27:33,690 DEBUG [CAASConnectorBean] Looking up connection factory with JNDI name 'ndp/CAASConnectionFactory'...
            17:27:33,690 ERROR [CAASConnectorBean] ndp not bound
            javax.naming.NameNotFoundException: ndp not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
            at javax.naming.InitialContext.lookup(InitialContext.java:350)
            at org.ndp.caas.ejb.CAASConnectorBean.getConnection(CAASConnectorBean.java:92)
            at org.ndp.caas.ejb.CAASConnectorBean.legitimationLock(CAASConnectorBean.java:59)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:216)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
            at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
            at org.jboss.ejb.Container.invoke(Container.java:674)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
            at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
            at java.lang.reflect.Method.invoke(Native Method)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
            at sun.rmi.transport.Transport$1.run(Transport.java:152)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
            at java.lang.Thread.run(Thread.java:484)

            The fact is I see connection factory with specified name in jmx-console. Why I cannot lookup it within the same VM?

            I use the following ejb-descriptor (there may be a problem)

            <ejb-jar>
            <enterprise-beans>

            <ejb-name>CAASConnector</ejb-name>
            org.ndp.caas.ejb.CAASConnectorHome
            org.ndp.caas.ejb.CAASConnectorRemote
            <ejb-class>org.ndp.caas.ejb.CAASConnectorBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <resource-env-ref>
            <resource-env-ref-name>ndp/CAASConnectionFactory</resource-env-ref-name>
            <resource-env-ref-type>javax.resource.cci.ConnectionFactory</resource-env-ref-type>
            </resource-env-ref>

            </enterprise-beans>
            </ejb-jar>

            Any ideas?
            Andy

            • 3. Re: NameNotFoundException during lookup
              David Jencks Master

              Using the resource ref link, you'd look up java:/comp/env/ndp/CAASConnectionFactory. You'd also have to set up the link to the global jndi tree in jboss.xml. Not using the resource ref link, and assuming the jndi-name element says ndp/CAASConnectionFactory, you'd look up java:/ndp/CAASConnectionFactory.

              Look at the jndi view to see more of what is going on.

              • 4. Re: NameNotFoundException during lookup
                Andy Paramonov Newbie

                Thank you, David.

                With 'java:/ndp/CAASConnectionFactory' it works.

                Andy.