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

前端 未结 4 1983
太阳男子
太阳男子 2020-12-21 19:31

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 thro

相关标签:
4条回答
  • 2020-12-21 19:54

    The problem is due to the fact that glassfish assigns any newly deployed web module to all the available virtual servers except the _asadmin one. If any one of the servers already has a default web module assigned to it you will get this error. The solution is to login into your glassfish web admin navigate to configurations > server-config > Virtual Servers click on each of your virtual servers and remove the assigned default web modules. Deploy your application and then reassign each web module to its respective virtual server.

    0 讨论(0)
  • 2020-12-21 20:00

    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 /!

    0 讨论(0)
  • 2020-12-21 20:08

    You can also set other default web module with

    asadmin set server.http-service.virtual-server.server.default-web-module=<name of the module>
    
    0 讨论(0)
  • 2020-12-21 20:16

    There 2 ways:

    1. From Glassfish admin.

      Configurations -> server-config -> Virtual Servers -> server. Then select empty row for Default Web Module attribute and save.

    2. Open file glassfish/domains/{your_domain_name}/config/domain.xml, find line similar to

    <virtual-server id="server" default-web-module="web-module-name.war" network-listeners="http-listener-1,http-listener-2"></virtual-server>
    

    and delete default-web-module attribute.

    0 讨论(0)
提交回复
热议问题