1 2 3 Previous Next 32 Replies Latest reply on Jul 21, 2006 5:56 AM by mad11max Go to original post
      • 30. Re: Fibo Tutorial on JBoss 4.0.2
        wondermike

        Hello,

        I also got this error message while trying to get the Fibo tutorial up and running:

        javax.servlet.ServletException: Lookup of java:comp/env/ failed

        and I solved it, but I'm not sure, if this is the state-of-the-art solution.

        I'm using:
        Eclipse 3.1.2
        JDK 1.5.0_06
        JBOSS IDE 1.5.1.GA (JBossIDE-1.5.1.GA-ALL.zip from http://www.jboss.com/products/jbosside/downloads)
        JBoss Application Server 4.0.4.GA

        Now please don't laugh - it don't speak a single word chinese, but I got my solution from there:
        http://www.eclipseworld.org/bbs/simple/index.php?t490.html
        :-)

        In the ComputeServlet's init() method I changed this code
        Object ref = context.lookup("java:/comp/env/ejb/Fibo");

        to this one:
        Object ref = context.lookup("ejb/Fibo");


        and voilà, the example from the tutorial runs.

        It seems logical to me as the name shows up in
        http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DJNDIView
        (click on list() !!)

        greetz from Germany
        Michael

        • 31. Re: Fibo Tutorial on JBoss 4.0.2
          wondermike

          Hi,

          I noticed that on a second machine I can use both variants, i.e. "java:/comp/env/ejb/Fibo" and "ejb/Fibo". Same configuration, same os (Win XP SP2). And I promise I didn't forget to repackage & redeploy. ;-)
          Very strange...
          Regards

          Michael

          • 32. Re: Fibo Tutorial on JBoss 4.0.2
            mad11max

            Hi,

            I must say that the tutorial may need some reviewing.
            Within the jboss.xml code:

            <session>
             <ejb-name>Fibo</ejb-name>
             <jndi-name>Fibo</jndi-name>
             <local-jndi-name>FiboLocal</local-jndi-name>
            </session>


            if I look at it carefully I see a jndi-name of "Fibo", not ejb/Fibo

            I changed the jndi lookup to lookup("Fibo") and it worked.

            The jboss-jmx-console as wondermike pointed out can provide insight:
            go to the jboss service=JNDIView XMBean

            invoke list()
            if the Fibo bean is in the Global namespace then lookup("Fibo")

            1 2 3 Previous Next