Details

    • Type: Task Task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 9.0pe
    • Fix Version/s: not determined
    • Component/s: naming
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      5,336

      Description

      I wanted to test the converter sample (stateless session bean, EJB 3.0) of the
      JEE tutorial bundle, using a standalone java client. The jndi name set in sun-
      ejb-jar.xml was "converter.ejb.Converter". The client code was in essential

      Context ctx = new InitialContext();
      ctx.lookup("converter.ejb.Converter");

      I ran the client by the "java" command, the classpath included just javaee.jar,
      appserv-rt.jar and the directory with the clients class file. The result was

      ------------------------------------------------------------------------------
      javax.naming.NamingException: ejb ref resolution error for remote business
      interfaceconverter.inter.compile.Converter [Root exception is
      java.lang.ClassNotFoundException: converter.inter.compile.Converter]
      ------------------------------------------------------------------------------

      I expected that the server had a problem in mapping the name of the remote
      business interface to the corresponding ejb.

      After inspecting the source code of the classes in the error stack trace (see
      below), I discovered that the problem hadn't its origin on the server side, but
      was of a totally different nature: During the lookup procedure the home
      interface of the business interface is being created. This needs the business
      methods class file, that was missing in my classpath!

      So, in effect, the thrown error message is rather misleading. Ken from sun's
      Enterprise JavaBeans forum pleased me, to post a usability bug to you, in order
      to improve the error message in the descriped situation.

      Please treat this post seriously, for

      • it took me a lot of time, to figure out that was wrong in my application
      • writing this post also takes a lot of time.

      Thanks, Ralph

      Stack trace output:

      --------------------------------------------------------------------------
      javax.naming.NamingException: ejb ref resolution error for remote business
      interfaceconverter.inter.compile.Converter [Root exception is
      java.lang.ClassNotFoundException: converter.inter.compile.Converter]
      at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:425)
      at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance
      (RemoteBusinessObjectFactory.java:74)
      at javax.naming.spi.NamingManager.getObjectInstance
      (NamingManager.java:304)
      at com.sun.enterprise.naming.SerialContext.lookup
      (SerialContext.java:403)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at ConverterClient.main(ConverterClient.java:15)
      Caused by: java.lang.ClassNotFoundException: converter.inter.compile.Converter
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at com.sun.ejb.EJBUtils.getBusinessIntfClassLoader(EJBUtils.java:679)
      at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:348)
      ... 5 more
      ----------------------------------------------------------------------------

        Activity

          People

          • Assignee:
            guojun.shan
            Reporter:
            ralph_jaus
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: