• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

different contex-root for same war in application.xml  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is this not possible? (can't access /adusr)

<module>
<web>
<web-uri>usr.war</web-uri>
<context-root>/usr</context-root>
</web>
</module>

<module>
<web>
<web-uri>usr.war</web-uri>
<context-root>/adusr</context-root>
</web>
</module>

I have to make a copy of usr.war to addusr.war before it's working

<module>
<web>
<web-uri>usr.war</web-uri>
<context-root>/usr</context-root>
</web>
</module>

<module>
<web>
<web-uri>addusr.war</web-uri>
<context-root>/adusr</context-root>
</web>
</module>
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each ear, war, ejb-jar file (or exploded directory) is considered a uniquely-identifiable component by a J2EE server. The context root isn't what identifies the wars the the server, it is web uri.

To put it in simple terms, if you deployed a war directly to the JBoss deploy directory instead of via an ear, you couldn't "deploy" it twice because you can't put the same file into a directory twice and have two different things of that name appear in the directory - there would only be one war in it of that name. Same thing with the uri.

The confusion probably from thinking of this as being like adding a jar to a classpath; understandable, but that isn't what is going on here. As far as the server is concerned, the fact that your two war files are identical except for the name is completely unknown to it. It assumes that the deployment information is potentially different, and they definitely require their own sets of resource factories, connection pools, etc.
 
khuong pham
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx for the answer.

I want this solution because we are using /adusr for Active Directory login and /usr for our own login implementation. We use apache as frontend and we have configured /adusr to point to AD authentification and /usr for own implementation. The same war file is used.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!