简体   繁体   English

Netbeans-部署WAR错误:模块尚未部署

[英]Netbeans - deploy WAR error: the module has not been deployed

I've created a Java enterprise application using NetBeans 7. I'm using GlassFish v3. 我已经使用NetBeans 7创建了Java企业应用程序。我正在使用GlassFish v3。 When I deploy my WAR file into GlassFish, it displays the error "the module has not been deployed" , but if I deploy the whole enterprise application, it works. 当我将WAR文件部署到GlassFish时,它显示错误“模块尚未部署” ,但是如果我部署整个企业应用程序,它将起作用。

For example, 例如,

enterprise
enterprise-ejb
enterprise-war

When I deploy "enterprise" it works, but deploying "enterprise-war" doesn't work. 当我部署“企业”时,它可以工作,但是部署“企业战争”时,则不起作用。 How can I fix this problem? 我该如何解决这个问题?

There are a couple things that may be happening: 可能会发生几件事:

  1. You have deployed 'enterprise' before you attempt to deploy 'enterprise-war'. 在尝试部署“企业战争”之前,您已经部署了“企业”。 In this case, the error probably means that the context-root is already taken, so the deploy fails. 在这种情况下,该错误可能意味着上下文根已被占用,因此部署失败。

  2. You have not deployed 'enterprise' before you attempt to deploy 'enterprise-war'. 在尝试部署“企业战争”之前,您尚未部署“企业”。 In this case the failure indicates that you have code/resources/something in enterprise-war that depends on code 'enterprise-ejb'. 在这种情况下,故障表明您在企业战中拥有依赖于代码“ enterprise-ejb”的代码/资源/内容。 When the dependency cannot be satisfied at deployment time, the deployment fails. 如果在部署时无法满足依赖性,则部署将失败。

The 'best' way to proceed is to deploy 'enterprise' and then let NetBeans update the app as you make changes. 最好的方式是部署“企业”,然后让NetBeans在进行更改时更新应用程序。 This is usually called 'deploy-on-save'. 这通常称为“保存时部署”。 You will hit a point where this is expensive (as you develop larger apps) but for initial exploration and learning the API phase, deploy-on-save is helpful. 您将遇到一个昂贵的点(当您开发更大的应用程序时),但是对于最初的探索和学习API阶段,“保存时部署”会有所帮助。 It lets you concentrate on your app and the APIs instead of the mechanics of deployment. 它使您可以专注于应用程序和API,而不是部署机制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM