Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
289 views
in Technique[技术] by (71.8m points)

java - 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:srcsvnrunkguiargetWEBAPP
    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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...