Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
khuong pham
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>
 
Reid M. Pinchback
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!