Just a quick guess, but I believe your problem is that you have two
different class loaders in operation.

A class uses the class loader that loaded it to request new classes.  So, if
the JNDI classes were loaded by the system class loader, they will go back
to the system class loader to access any of the remote interfaces it needs.
So, if your remote interfaces were loaded with a different class loader (in
this case, URLClassLoader) the JNDI classes would not find them.

An easy way to test this would be to ask the JNDI Context which classloader
it is using, and print out the result.



Jonathan

Chakravarthy Racharla wrote:
>
> Hi,
>
> We are writing an application that uses some Entity Beans - but these EJBs
> are not known before hand and hence client jar for these beans is not
> available in the classpath.  What I need to do is given the details needed
> to perform a JNDI lookup, I need to get the home interface - (a reference of
> type EJBHome is sufficient at this stage) and get the EJBMetaData for that
> bean.
> When a new client jar is available, I am loading it using the URLClassLoader
> and am able to load the classes and I have a class object for the home
> interface loaded through the URLClassLoader. But my JNDI lookup fails if the
> client jar is not in the classpath. It appears to me that although a class
> is loaded using the URLClassLoader, and the System is still not aware of the
> existence of this class.
>
> How can I perform a lookup for an object of a type that is being loaded
> using a URLClassLoader?
>
> Thanks in advance,
> Chakravarthy
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
Jonathan Baker

Senior Architect
Internet Applications Division
Sybase, Inc.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to