How to deploy to JBoss AS7 default ROOT context

If you want to deploy your app to the default ROOT context of JBoss AS7, you have to modify first your standalone.xml. Otherwise, you will raise this exception :

Caused by: java.lang.IllegalArgumentException: Child container with name already exists

By default, AS7 has an application already deployed to / context.

To fix this, set your enable-welcome-root="true" to enable-welcome-root="false". Which finaly gives you :

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
   <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
   <virtual-server name="default-host" enable-welcome-root="false">
      <alias name="localhost"/>
      <alias name="example.com"/>
   </virtual-server>
</subsystem>


That’s all 😉

Advertisements

2 thoughts on “How to deploy to JBoss AS7 default ROOT context

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s