users@glassfish.java.net

Re: Embedded GlassFish no EJBContainer available

From: <glassfish_at_javadesktop.org>
Date: Mon, 28 Jun 2010 10:29:03 PDT

Hello, Peter.

Does your EJB JAR's manifest contain a Main-Class setting?

If so, that's causing the problem.

When GlassFish tries to decide what module type each module is, each module type's "sniffer" judges for itself whether it recognizes a particular module. The sniffers usually try the easy things first - such as descriptors that are specific to a particular module type. For example, the app client sniffer looks for application-client.xml or sun-application-client.xml in the module's META-INF directory.

If the sniffer finds no such descriptors it uses more involved decision-making. In the app client sniffer's case, it checks for a Main-Class value in the manifest. If it finds one then the app client sniffer decides that the module is an app client.

In some cases it makes sense for more than one sniffer to recognize a module - for example, the security sniffer is "orthogonal" to the more familiar module-type sniffers such as EJB, web, and app client, and its common for the security sniffer and, say, the EJB sniffer to recognize the same module. That's fine. But it's not generally OK for multiple Java EE module type sniffers to recognize the same module. That's what's happening here - the app client sniffer and the EJB sniffer both recognize the module.

- Tim
[Message sent by forum member 'tjquinn']

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