开发者

Deploy war through netbeans onto glassfish v3 beta

The same .war file deploys fine onto Glassfish v2.1. I don't know the last time I tried v3, but I was wanting to check out hot-deploy functionality as it's rumored to be working in netbeans 6.8 with glassfish v3. So, I deploy just like usual and I get the following error:

SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer load method
....
SEVERE: Exception while loading the app
java.lang.RuntimeException: Unable to load EJB module.  DeploymentContext does not contain any EJB  Check archive to ensure correct packaging for c:\src\svn\trunk\gui\target\WEBAPP
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:134)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:64)
    at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:153)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:220)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:314)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:169)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
开发者_如何学编程    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1159)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1218)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1207)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:362)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:201)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:241)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:789)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:697)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:951)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:166)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
    at com.sun.grizzly.util.FixedThreadPool$BasicWorker.doWork(FixedThreadPool.java:431)
    at com.sun.grizzly.util.FixedThreadPool$BasicWorker.run(FixedThreadPool.java:410)
    at java.lang.Thread.run(Thread.java:619)

I don't understand why it's complaining about anything EJB related since this is a .war file. Any ideas?

UPDATE: I filed a bug with glassfish: https://glassfish.dev.java.net/issues/show_bug.cgi?id=10592. Either this is a bug in glassfish or at the very least the error message is not helpful in tracking the problem down.


https://glassfish.dev.java.net/issues/show_bug.cgi?id=10592

From the bug:

Ok, found the cause (thanks much for providing the test case!):

  1. EjbSniffer was retrieved after scanning the archive: one (or more) of the library jars packaged in the archive contains EJBs with component annotations. So the ejb container was asked to load the module later.

  2. The ejb container was not able to find the corresponding metadata because the web.xml is 2.4 version so the meta-data processing skipped the annotation processing (we only process annotations for Java EE 5+ schema versions).

After I changed the web.xml to reference 2.5 schema (you can do 3.0 schema as well): http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

The app deployed successfully.

Please give it a try and let me know if it works for you.


I have 3_0 schema and I still get the error. What's more interesting is I have two wars, one is the example project from weld archetype, and the other is a customization of that. The custom war doesn't work.

I've checked side by side, it's the same except for more model classes and more properties in persistence.xml


Someone using the @Stateless annotations in ManagedBeans is reporting a similar problem on the java.net Forums.

I don't know if this applies to you but the given workaround was:

Go to the admin console, go to the update center, and install EJB.

I didn't test it myself so I can't confirm this will help.


Just my $0.02...

I had the same error after I added the JaxMe library (version 0.5.2) to my application. This caused a deployment failure on one of my war modules - which confused the hell out of me, because I didn't make any changes to that module. Removing JaxMe fixed the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜