[GLASSFISH-5336] ejb ref resolution error Created: 21/Jul/08  Updated: 29/May/13

Status: Open
Project: glassfish
Component/s: naming
Affects Version/s: 9.0pe
Fix Version/s: not determined

Type: Task Priority: Minor
Reporter: ralph_jaus Assignee: guojun.shan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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
----------------------------------------------------------------------------



 Comments   
Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

Comment by Tim Quinn [ 08/Feb/13 ]

Changing the component to naming and reassigning. There is no ACC code involved in the user's stand-alone client example.

Comment by Tom Mueller [ 15/Feb/13 ]

Reassigning to component lead as the assignee is no longer with the project.

Generated at Fri May 29 11:06:05 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.