无法将企业应用程序部署到 glassfish
我一直在开发在 Netbeans 6.9.1 上创建的 Web 应用程序,一切正常,并且我能够毫无问题地部署它。今天,我创建了一个企业应用程序,并将企业应用程序 Web 模块上的“web”和“src”文件夹的内容替换为原始 Web 应用程序中的文件夹。 一切看起来都很好,它编译没有问题,并在我运行“clean and build”时生成ear文件。但是当我尝试部署企业应用程序时,我不断收到以下错误: org.glassfish.deployment.common.DeploymentException: by java.lang.NoClassDefFoundError: project/dao/MerchantDao
我查看了生成的ear的结构和它有预期的 META-INF 和 war 文件。耳内的war文件也可以,我尝试过单独部署,效果很好。
我不知道我还能尝试什么,我担心这可能是玻璃鱼虫,我只是在浪费时间。
有人可以帮我解决这个问题吗?
亲切的问候,
卡洛斯·豪尔赫·费雷拉
I've been working on a web application created on Netbeans 6.9.1, and everything works fine and I'm able to deploy it without problems. Today I've created an Enterprise Application and replaced the content of 'web' and 'src' folders on the Enterprise Application web module with the folders from the original web application.
Everything seems ok, it compiles without problems and generates the ear file when I run 'clean and build'. But when I try to deploy the Enterprise Application, I keep getting the following error: org.glassfish.deployment.common.DeploymentException: by java.lang.NoClassDefFoundError: project/dao/MerchantDao
I've looked the structure of the generated ear and it has the expected META-INF and the war file. The war file inside the ear is also ok, I've tried to deploy it separately and it worked fine.
I'm not sure what else I can try, I'm afraid this might be a glassfish bug and I'm just wasting my time.
Can someone help me with this?
Kind regards,
Carlos Jorge Ferreira
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您没有提供足够的信息来获得有关您当前问题的答案(例如 EAR 结构)。
无论如何,如果您没有很强的模块化需求,我的建议是使用 WAR 打包(对于 Java EE 6,使用 EAR 不是强制性的,您可以将 EJB 打包在
WEB-INF/classes
或WEB-INF/lib
下如果您将它们捆绑为 EJB-JAR)。哦,顺便说一下,我正在 GlassFish 上部署 Java EE 6 EAR,它可以正常工作。
I don't think you are providing enough informations to get an answer about your current problem (e.g. the EAR structure).
Anyway, if you don't have strong modularity needs, my suggestion would be to use the WAR packaging (with Java EE 6, using an EAR is not mandatory and you can package EJBs under
WEB-INF/classes
or underWEB-INF/lib
if you bundle them as EJB-JAR).Oh, by the way, I'm deploying a Java EE 6 EAR on GlassFish and it just works.