问题描述
相同的 .war 文件可以很好地部署到 Glassfish v2.1.我不知道我最后一次尝试 v3 是什么时候,但我想查看热部署功能,因为据传它可以在 netbeans 6.8 和 glassfish v3 中使用.所以,我像往常一样部署,但出现以下错误:
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:srcsvn runkgui argetWEBAPP
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)
我不明白为什么它会抱怨任何与 EJB 相关的东西,因为这是一个 .war 文件.有什么想法吗?
I don't understand why it's complaining about anything EJB related since this is a .war file. Any ideas?
更新:我向 glassfish 提交了一个错误:https://glassfish.dev.java.net/issues/show_bug.cgi?id=10592.这要么是 glassfish 中的一个错误,要么至少该错误消息无助于追踪问题.
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
来自错误:
好的,找到原因了(非常感谢提供测试用例!):
Ok, found the cause (thanks much for providing the test case!):
EjbSniffer 在扫描存档后被检索:一个(或多个)打包在存档中的库 jar 包含带有组件注释的 EJB.所以ejb容器被要求稍后加载模块.
EjbSniffer was retrieved after scanning the archive: one (or more) of thelibrary jars packaged in the archive contains EJBs with component annotations.So the ejb container was asked to load the module later.
ejb 容器无法找到相应的元数据,因为web.xml 是 2.4 版本所以元数据处理跳过了注释处理(我们只处理 Java EE 5+ 模式版本的注释).
The ejb container was not able to find the corresponding metadata because theweb.xml is 2.4 version so the meta-data processing skipped the annotationprocessing (we only process annotations for Java EE 5+ schema versions).
在我将 web.xml 更改为引用 2.5 架构后(您也可以执行 3.0 架构):http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
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">
应用部署成功.
请尝试一下,让我知道它是否适合您.
Please give it a try and let me know if it works for you.
这篇关于通过 netbeans 将 war 部署到 glassfish v3 beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!