简体   繁体   English

无法在Glassfish3上重新部署Web应用程序

[英]unable to redeploy web application on glassfish3

I m trying to deploy a web application using netbeans to glassfish 3.01 but im not able to do so 我正在尝试将使用netbeans的Web应用程序部署到glassfish 3.01,但是我无法这样做

Glassfish says 玻璃鱼说

Inconsistent Module State 模块状态不一致

the web app has some jars and a ejb jar for a local ejb 该Web应用程序具有一些jar和一个用于本地ejb的ejb jar

Open the domain.xml file that you will find in this folder: 打开将在此文件夹中找到的domain.xml文件:

"your glassfish installation"/domains/"your domain"/config “您的glassfish安装” /域/“您的域” / config

In this file look for your application deployment configuration to manually remove it: 在此文件中,查找要手动删除的应用程序部署配置:

1) Remove the web-module tag 1)删除Web模块标签

<applications>
...
<web-module availability-enabled="false" context-root="yourapplicatoinContext" ... />
 ...
</applications>

2) Also remove the application-ref to your application: 2)还将application-ref删除到您的应用程序中:

<server config-ref="server-config" lb-weight="100" name="server">
 ...
   <application-ref ... ref="your application name" ... />
 ... 
</server>

The other answers are really extreme. 其他答案确实是极端的。 There is no need to create a new domain or re-install if you cannot redeploy your web application during development. 如果在开发过程中无法重新部署Web应用程序,则无需创建新域或重新安装。

If you app is very complex, then consider scripting any clean up needed in a Production environment. 如果您的应用程序非常复杂,则可以考虑在生产环境中编写脚本进行清理。 The below steps will keep you up and working in the short term. 以下步骤将使您在短期内保持正常工作。

To re-deploy a web app to a single domain on Glassfish 3.1, do the following: 要将Web应用程序重新部署到Glassfish 3.1上的单个域,请执行以下操作:

  • Stop Glassfish from the command line. 从命令行停止Glassfish。

  • Delete all the files in the following directories: 删除以下目录中的所有文件:

glassfish\\domains\\domain1\\generated 的glassfish \\域\\ domain1的\\生成
glassfish\\domains\\domain1\\applications GlassFish的\\域\\ DOMAIN1 \\应用

  • Start Glassfish from the command line. 从命令行启动Glassfish。

  • Deploy your app via the Admin Tool or command line. 通过管理工具或命令行部署您的应用。

In Glassfish 5, I searched for my app name in the domain.xml and deleted all the tags mentioning it. 在Glassfish 5中,我在domain.xml搜索了我的app name ,并删除了所有提及它的标签。 There was one occurence in the beginning ( <system-applications> ) and one at the end at approx. 在开始时发生了一次( <system-applications> ),在结束时发生了一次。 line 460 ( <applications> ). 第460行( <applications> )。 Then redeploy worked! 然后redeploy工作!

Just try this: 尝试一下:

  • undeploy 取消部署
  • stop Glassfish 停止玻璃鱼
  • start Glassfish 开始Glassfish
  • deploy 部署

If you can't undeploy, try the other steps anyway. 如果您无法取消部署,请尝试其他步骤。 If you don't have any luck, you could try it this way: 如果没有运气,可以这样尝试:

  • stop Glassfish 停止玻璃鱼
  • edit domain.xml (probably in domains/domain1/config)- back it up first; 编辑domain.xml(可能在domains / domain1 / config中)-首先备份它; remove all references to your app (probably under application / application-ref); 删除所有对您的应用程序的引用(可能在application / application-ref下); just make sure it's still valid xml 只要确保它仍然是有效的XML
  • start Glassfish 开始Glassfish
  • deploy 部署

It should have solved it. 它应该已经解决了。 If still no luck anyway, remove every file or directory related to your app, probably under domains/domain1/generated and domains/domain1/applications/.... 如果仍然不走运,请删除与您的应用相关的每个文件或目录,可能在domains / domain1 / generated和domains / domain1 / applications / ....下。

You could always recreate a new domain, but above steps will solve your problem. 您始终可以重新创建一个新域,但是上述步骤将解决您的问题。

You could be in such a situation after stopping Glassfish middle in a deploiyment, for example. 例如,在停止部署中将Glassfish停在中间后,您可能会处于这种情况。

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

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