2 Replies Latest reply on May 13, 2005 3:18 AM by Arghadeep Chatterjee

    Stateless bean Deployment in Jboss4.0.1sp1

    Arghadeep Chatterjee Newbie

      Hi,
      Can anyone please tell me when does JNDI Not Bound exception occur?. and what are the possible solutions.
      Thanks
      Deep

        • 1. Re: Stateless bean Deployment in Jboss4.0.1sp1
          Darran Lofthouse Master

          It means that an item you are attempting to lookup in JNDI is not bound to JNDI.

          This could be caused by a failed deployment or possibly using the wrong name.

          If this relates to using a session bean the exception is the wrong place to start diagnosing the problem, you should follow the following steps.

          Undeploy everything that you have currently deployed and restart JBoss.
          Check for any errors in the console.
          Deploy your session bean.
          Check for any errors in the console.
          Use JMX Console and invoke the list operation on the JNDI View MBean to see what JNDI name was used.

          It is only at this point that you are ready to run any client that tries to use the session bean.

          • 2. Re: Stateless bean Deployment in Jboss4.0.1sp1
            Arghadeep Chatterjee Newbie

            Hi,
            I could solve this problem,but using the folowing code
            Context ctx=new InitialContext(env);
            System.out.println("Hello5");
            //StatelessBeanHomeIntf objref1=;

            System.out.println("Hello6");
            StatelessBeanHomeIntf home=(StatelessBeanHomeIntf)PortableRemoteObject.narrow(ctx.lookup("topic/testTopic"),StatelessBeanHomeIntf.class);
            System.out.println("Hello7");

            StatelessBeanIntf beanRemoteRef=home.create();
            I am running into ClassCastException,I am using predefined JNDI of Jboss(topic/testTopic).Any ideas/pointers what am I doing wrong??.
            Thanks
            Deep