unable to redeploy web application on glassfish3

妖精的绣舞 提交于 2019-12-02 18:24:35

问题


I m trying to deploy a web application using netbeans to glassfish 3.01 but i m not able to do so

Glassfish says

Inconsistent Module State

the web app has some jars and a ejb jar for a local ejb


回答1:


Open the domain.xml file that you will find in this folder:

"your glassfish installation"/domains/"your domain"/config

In this file look for your application deployment configuration to manually remove it:

1) Remove the web-module tag

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

2) Also remove the application-ref to your application:

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



回答2:


Just try this:

  • undeploy
  • stop Glassfish
  • start 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; remove all references to your app (probably under application / application-ref); just make sure it's still valid xml
  • start 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/....

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.




回答3:


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.

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:

  • Stop Glassfish from the command line.

  • Delete all the files in the following directories:

glassfish\domains\domain1\generated
glassfish\domains\domain1\applications

  • Start Glassfish from the command line.

  • Deploy your app via the Admin Tool or command line.




回答4:


In Glassfish 5, I searched for my app name in the domain.xml and deleted all the tags mentioning it. There was one occurence in the beginning (<system-applications>) and one at the end at approx. line 460 (<applications>). Then redeploy worked!



来源:https://stackoverflow.com/questions/5361193/unable-to-redeploy-web-application-on-glassfish3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!