Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
487 views
in Technique[技术] by (71.8m points)

java - Glassfish unable to deploy at root because default-web-module is declared

While trying to deploy to Glassfish Server Open Source Edition 3.1.2.2 (build 5) from both Netbeans and Admin Console the following message is thrown. Eventhough the Applications section of the Admin Console has no deployed applications. I have tried restarting the domain without success.

Exception while loading the app : java.lang.Exception: WEB0145: Unable to deploy web module [*module name*] at root context of virtual server [server], because this virtual server declares a default-web-module

Is there any cache or something that can be emptied in order to clean up the root so I can once again deploy my application at root context? Thanks for any help!

Step 1

I started with a simple grep-command on my Glassfish-directory for "default-web-module". Seems this was defined in domains/domain1/config/domain.xml (how could I have missed to think of that?).

Step 2

Inside domain.xml is the following:

<applications>
    <application context-root="/" ...>
         ...
    </application>
    ...
</applications>

Also, this application caries multiple references to the applicationname that was previously deployed in root-context="/". As soon as I'm home I will try removing this <application context-root="/" ...>...</application> (ofcourse with a backup of domain.xml). Hope this will solve the problem and that I will be able to deploy to root again!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Since I ran into the problem it's probable that others will too. For this reason I will answer my own question instead of deleting it.

Following the steps I've mentioned in the question, I noticed the config in domain.xml still had reference to an application with context-root="/". Upon removing this application from the file and saving it, I could once again deploy an application to /!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...