| Author |
Message |
|
|
Post subject: JBoss deployment to Context-root '/' and virtual hosts
Posted: Oct 31, 2005 - 09:37 PM
|
|
Veteran Member


Joined: Sep 16, 2005
Posts: 6
|
|
I have 3 applications and they all have the "/" as the context root. I use maven to deploy them in production by creating three ear files containing each one war file with the webapplication (no EJBs). This works fine in JBoss 4.0.3. I have a jboss-web.xml on each application like so:
<jboss-web>
<security-domain>java:/jaas/fpi</security-domain>
<context-root>/</context-root>
<virtual-host>admin.acme.net</virtual-host>
...
This works fine in JBoss. But when I try to create a deployment for the second ear file (or web for that matter) it gives me the error:
Context-root '/' already in use by project acme-web deployed on server JBoss 4.
C:\Devel\jboss-4.0.3\server\default\deploy\acme-ear-admin.ear
I can run fine with one ear but as soon as I try to add the second it gives me that error. I select the project for the drop down list then I click add and I select JBoss 4 option and Exploded. That is when I get the error. If I try the "Custom Location" and exploed option it let me deploy but the deployment gives errors. The errors are due to the fact that when using a "Custom Location" myeclipse does not build the directory names correctly for the ear and war applications. These directories need to have a subfix of .ear and .war for JBoss. Even if I specify the directory name for the ear application with the correct name the war inside the ear is deploy incorrectly (without .war extension.)
Thanks. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 01, 2005 - 02:07 AM
|
|
Moderator


Joined: May 06, 2003
Posts: 6598
|
|
| Quote: |
I have 3 applications and they all have the "/" as the context root.
|
I don't understand. Three applications can't have the same context root at the same time. If you want to test them this way, you'll need to undeploy one before deploying the next with the same root.
| Quote: |
If I try the "Custom Location" and exploed option it let me deploy but the deployment gives errors. The errors are due to the fact that when using a "Custom Location" myeclipse does not build the directory names correctly for the ear and war applications.
|
You can use "Custom Location - Suffixed" so that the deployment will have the proper suffixes. |
_________________ --Scott
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 01, 2005 - 03:21 PM
|
|
Veteran Member


Joined: Sep 16, 2005
Posts: 6
|
|
JBoss let you have multiple applications with the same context root "/" as long as they belong to different virtual hosts. To prove this create two copies of an application and deploy them as ear files and make sure that the jboss-web.xml has an entry for a virtual host like so:
<virtual-host>admin.acme.net</virtual-host>
run JBoss and access the application by using the virtual host name:
i.e: http://admin.acme.net:8080/ but before you need to update your host file with an
entry like so: 127.0.0.1 admin.acme.net to be able to access the application.
Of course you need to use some tool like ant to create you ear file since myecliseide won't do. The effect of virtual host is like running the applications in different services. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jan 30, 2006 - 07:09 PM
|
|
Veteran Member


Joined: Sep 16, 2005
Posts: 6
|
|
| ortizfabio wrote: | JBoss let you have multiple applications with the same context root "/" as long as they belong to different virtual hosts. To prove this create two copies of an application and deploy them as ear files and make sure that the jboss-web.xml has an entry for a virtual host like so:
<virtual-host>admin.acme.net</virtual-host>
run JBoss and access the application by using the virtual host name:
i.e: http://admin.acme.net:8080/ but before you need to update your host file with an
entry like so: 127.0.0.1 admin.acme.net to be able to access the application.
Of course you need to use some tool like ant to create you ear file since myecliseide won't do. The effect of virtual host is like running the applications in different services. | I want to know if myeclispe is ever going to fix this problem. This is a bug in their implementation. MyEclipse needs to remove the constraint that prevents multiple applications deploying to the "/" root context when they are being deployed to different virtual host. I can not debug all my different applications at the same time because of this BUG!!!
Please fix it.
Fabio Ortiz |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jan 31, 2006 - 12:19 AM
|
|
Moderator


Joined: May 06, 2003
Posts: 6598
|
|
Fabio,
You make a great point. We've added a bug report and it is targeted to be addressed in MyEclipse 4.1.1 in February. Thank you for your patience and for pointing out the use case as to why this is valuable for our users. |
_________________ --Scott
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 01, 2006 - 11:17 PM
|
|
Moderator


Joined: May 06, 2003
Posts: 6598
|
|
| Quote: |
That is when I get the error. If I try the "Custom Location" and exploed option it let me deploy but the deployment gives errors. The errors are due to the fact that when using a "Custom Location" myeclipse does not build the directory names correctly for the ear and war applications. These directories need to have a subfix of .ear and .war for JBoss. Even if I specify the directory name for the ear application with the correct name the war inside the ear is deploy incorrectly (without .war extension.)
|
As an interim workaround, instead of using <Custom Location> use the <Custom Location - Suffixed> deployment target. |
_________________ --Scott
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 08, 2006 - 05:30 PM
|
|
Veteran Member


Joined: Sep 16, 2005
Posts: 6
|
|
Scott,
The Custom Location -Suffixed worked. I wish somebody had told me this before.
Thanks
Fabio |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: May 29, 2006 - 09:13 PM
|
|
Veteran Member


Joined: Aug 27, 2005
Posts: 26
|
|
Hello.
4.1.1 doesn't seem to allow this.
What is the correct way to do this? Seperate ear files? In which case where does one configure the virtual host definition?
Otherwise, where do I find the Custom Location -Suffixed work around?
I would massively appreciate your input.
Renen. |
|
|
| |
|
|
|
 |
|
|