users@glassfish.java.net

Re: Embedded GlassFish no EJBContainer available

From: Major Péter <majorpetya_at_sch.bme.hu>
Date: Mon, 28 Jun 2010 20:57:25 +0200

Hi Tim,

My EJB JAR's manifest does not contain the Main-class entry, but this
error only occured once for me, the other transient problem caused me
more headache..
In the very end I decided to hardcode my module path, so GlassFish will
always find the EJB, and it will be also _much_ faster (specified 26sec,
not specified: 40-50s to startup), and so I don't have to add for my
webmodule tests the EJB module with test scope..

Regards,
Peter

2010-06-28 19:29 keltezéssel, glassfish_at_javadesktop.org írta:
> 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']