- This topic has 7 replies, 3 voices, and was last updated 18 years, 11 months ago by
Renen.
-
AuthorPosts
-
ortizfabioMemberI 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.earI 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.
Scott AndersonParticipantI 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.
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.
ortizfabioMemberJBoss 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.
ortizfabioMember@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
Scott AndersonParticipantFabio,
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 AndersonParticipantThat 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.
ortizfabioMemberScott,
The Custom Location -Suffixed worked. I wish somebody had told me this before.
Thanks
Fabio
RenenMemberHello.
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.
-
AuthorPosts