users@glassfish.java.net

Re: Classpath problems?

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 12 Oct 2007 13:28:30 +0530

The Java EE platform spec neither requires nor prohibits a container to
make classes of one module in an ear available to another module in the
ear. Please refer to Java EE 5 platform spec section #8.3.1 points #
3(d) & 3(e) for exact requirements.

For making developers' life easier, GlassFish actually makes all classes
packaged in any module in an ear to be available to every other module
of the ear. So, I don't understand why you have to bundle ejb.jar inside
war/WEB-INF/lib.

Having said that , your application is *not* portable if you rely on
this behavior. A portable and better approach is to use library jar
option or bundled optional package mechanism.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> Oh, my imports are ok. And if I'd forgotten, Eclipse would remind me :-)
>
> It's something else. I actually "solved" the problem yesterday. I got a tip that I should also place my ejb.jar in the WEB-INF\lib directory in my web.war file. Doing this, the compiler found the ejb classes.
>
> My question then would be: Why doesn't GlassFish "fix" this in the background? What's the point in having an ejb.jar file separate from the war file in the ear if I have to include the ejb.jar in the war anyway?
>
> I used this as a guide when I first planned my ear:
> http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/Overview5.html
>
> That was Java v1.4, but I haven't found a similar guide for Java 5. Anyways; if the EJBs shouldn't be packaged outside of the war file, what then would be the point in using the ear at all?
>
> Marius
> [Message sent by forum member 'mariusw' (mariusw)]
>
> http://forums.java.net/jive/thread.jspa?messageID=239654
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>