users@glassfish.java.net

Re: GF V3 - Cannot resolve reference Remote ejb-ref

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Feb 2010 06:31:33 PST

(I am not familiar with webservices, so not sure about your webservices question).

As for ear packaging, as I mentioned earlier, the Java EE spec warns against packaging components in the ear shared lib directory as that will make all the component modules inside the ear that type of modules.

If you want to share certain library across all the web modules inside the ear but not the other modules inside the ear, you could do what you did similar to the ejb jars. Put the libraries at the root of the ear, and then use Manifest entry to reference the library in the web modules that want to take advantage of the library.

For libraries shared across applications, you could use --libraries to point to the common libraries. But if your libraries contain component definition, it will not work well for the same reason that you should not put libraries containing components in the ear shared lib directory.

There are a few different ways to include libraries for applications, but the problem with your use case is that you want to put component definitions in these libraries which will not work well.

Can you put the logic you want to re-use in the base classes (which do not have component definitions), then in the relevant component module, define the component and extend from those base classes? Here, the non-component base classes could be packaged as common libraries without causing any trouble.
[Message sent by forum member 'hzhang_jn' (hong.zhang_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=387398