On Thu, 15 Feb 2001, you wrote:
> Hi,
> 
> Isn't it your EJB home interface that
> cannot be found?
> This is in your EJB jar, and its
> classes are not served by the web
> server.
> This is similar to when one EJB jar
> tries to access classes and defined
> in another EJB jar.
> Problem is, while it would make
> sense to serve the interface classes
> (but not implementation classes) of
> the EJB jar, there are no sure way
> to differentiate what classes are
> interface and which are
> implementation.

What about having a peek at the deployment descriptor?  That's a fairly sure
way of finding out which is which...

But why not just expose everything to the outside world?  What if the developer
_wants_ to expose all of the classes?

Anyway, it is not the interfaces which are missing because this code:

        URL urls[] = new URL[1];
        urls[0] = new URL( "http://localhost:8083" );
        ClassLoader cl = new URLClassLoader( urls );
        Thread.currentThread().setContextClassLoader( cl );
        System.setSecurityManager( new RMISecurityManager );
        System.out.println( "Set class loader and security manager." );

        URL classResource = cl.getResource( "my.home.interface" );
        System.out.println( classResource.toString() );

        Class homeClass = cl.loadClass( "my.home.interface" );
        System.out.println( "Home interface class loaded." );

        InitialContext ctx = new InitialContext();
        Object o = ctx.lookup( "my_home_interface_in_jndi" );
        my.home.interface if = (my.home.interface)PortableRemoteObject.narrow( o, 
my.home.interface.class );

gives this output:

        Set class loader and security manager.
        http://localhost:8083/my/home/interface.class
        Home interface class loaded
        java.lang.ClassNotFoundException: my.home.interface at...

which is very strange indeed, I know, but there it is.  I thought that when I
ran it in a debugger, it failed loading javax.ejb.EJBHome or something like
that, but maybe I was wrong.

> I seperate my EJBs in different jars
> for implementation and interface.
> EJB implementation jars go to deploy
> directory, while interface jars go
> in classpath.

Don't you have to restart the server every time you change an interface then? 
Even Weblogic 5 gives that sort of re-deploy, doesn't it?

Tom


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to