8 Replies Latest reply on Nov 25, 2004 4:56 PM by andres gonzalez

    tusc tutorial -> jboss dont bound jndi StoreAccessBean Namin

    Daniel Ferreira Newbie

      Hi,

      I started tusc tutorial using jboss-3.2.3 and eclipse 2.1.3 and I'm stuck tring to test Stateless SessionBean StoreAccess example (chap 3).

      At jboss.xml there are the tags

      <ejb-name>StoreAccess</ejb-name>
      <jndi-name>StoreAccessBean</jndi-name>
      <local-jndi-name>StoreAccessLocal</local-jndi-name>

      I took a look in jmx-console and it doesn't shows this name in JNDITree. All the classes are generated and deployed just fine. When I run the test client it shows:

      javax.naming.NameNotFoundException: StoreAccessBean 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:282)
      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:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:534)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at au.com.tusc.client.StoreAccessClient.getHome(StoreAccessClient.java:27)
      at au.com.tusc.client.StoreAccessClient.testBean(StoreAccessClient.java:51)
      at au.com.tusc.client.StoreAccessClient.main(StoreAccessClient.java:74)


      what should I do????? Please help!!!

      tanks,

      Daniel

        • 1. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
          Guy Daniel Newbie

          Are you accessing your bean from a Java app?
          If so, this normally happens when you don't package the app up properly and put it in the deploy dir...

          • 2. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
            Guy Daniel Newbie

            Reading your stack trace a little further says that you are.

            Is application.xml and jboss-client.xml packaged along with your manifest.mf in META-INF in the client's jar file? Is a copy of this file in the deploy dir?

            • 3. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
              Daniel Ferreira Newbie

              Well, now I know that my bean isn't deployed ok!!! There is a error while initializing jboss.



              17:37:34,031 ERROR [MainDeployer] could not create deployment: file:/C:/Desenvolvimento/jboss-3.2.3/server/default/deploy/MyStoreMgr.jar
              org.jboss.deployment.DeploymentException: Error in jboss.xml for Bean StoreAccess: resource-ref jdbc/DefaultDS found in jboss.xml but not in ejb-jar.xml
              at org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMetaData.java:764)
              at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:175)
              at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:436)
              at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
              at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
              at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
              at $Proxy6.deploy(Unknown Source)
              at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
              at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)


              I have already looked in jboss.xml and ejb-jar.xml looking for <resource-ref> and they are there:

              In jboss.xml
              ...
              <session>
               <ejb-name>StoreAccess</ejb-name>
               <jndi-name>StoreAccessBean</jndi-name>
               <local-jndi-name>StoreAccessLocal</local-jndi-name>
              
               <resource-ref>
               <res-ref-name>jdbc/DefaultDS</res-ref-name>
               <jndi-name>java:/DefaultDS</jndi-name>
               </resource-ref>
               </session>
              ...
              


              in ejb-jar.xml
              ...
              <session >
               <description><![CDATA[]]></description>
              
               <ejb-name>StoreAccess</ejb-name>
              
               <home>au.com.tusc.session.StoreAccessHome</home>
               <remote>au.com.tusc.session.StoreAccess</remote>
               <local-home>au.com.tusc.session.StoreAccessLocalHome</local-home>
               <local>au.com.tusc.session.StoreAccessLocal</local>
               <ejb-class>au.com.tusc.session.StoreAccessSession</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
               <resource-ref>
               <res-ref-name>jdbc/DafaultDS</res-ref-name>
               <res-type>javax.sql.Datasource</res-type>
               <res-auth>Container</res-auth>
               </resource-ref>
               </session>
              ...
              


              I've comented the jboss.xml resource-ref tag and could deploy the bean just fine, but my client doesn't work.

              output

              Request from client :
              java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
              java.rmi.ServerException: RuntimeException; nested exception is:
              java.lang.NullPointerException
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
              at sun.rmi.transport.Transport$1.run(Transport.java:148)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:144)


              Any idea??? Please, help!!!

              regards,

              Daniel


              • 4. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
                Daniel Ferreira Newbie

                Ops,

                sorry, there was

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


                in ejb-jar.xml. That why it didn't work.

                Now it ok!!!

                Daniel


                • 5. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
                  jagathig Newbie

                  I am still getting this error. Can anyone pl suggest what could be the problem ?

                  • 6. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
                    leondu Newbie

                    I followed almost every step but still got the following error:

                    javax.naming.NameNotFoundException: StoreAccessBean 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:282)
                    at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
                    at sun.rmi.transport.Transport$1.run(Unknown Source)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
                    at java.lang.Thread.run(Unknown Source)
                    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
                    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
                    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
                    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(Unknown Source)
                    at au.com.tusc.client.SessionClient.getHome(SessionClient.java:26)
                    at au.com.tusc.client.SessionClient.testBean(SessionClient.java:47)
                    at au.com.tusc.client.SessionClient.main(SessionClient.java:66)

                    Could anyone tell me what to do?
                    especially danielferreira
                    :)

                    • 8. Re: tusc tutorial -> jboss dont bound jndi StoreAccessBean N
                      andres gonzalez Newbie

                      I dont understand where did you find the error on this line ???

                      <res-ref-name>jdbc/DafaultDS</res-ref-name> (ejb-jar.xml)

                      Can u help me please !!!

                      ANDRES (andresgo@hotmail.com)