0

We have 2 war files inside an ear file deployed in JBoss 4. We need to switch between web app contexts for which we are using UrlRewriteFilter.

The problem we are facing is we are not able to perform a requestDispatcher.forward() between these webapps. I believe this can be achieved by setting cross-context attribute to true in the web container (Tomcat 5.5). We have done the following setting -

In /default/deploy/jbossweb-tomcat55.sar/server.xml

<Host name="localhost"
        autoDeploy="false" deployOnStartup="false" deployXML="false">
<Context path="/esa" docBase="/deploy/app.ear/webapp1.war" 
    debug="0" crossContext="true"/>
<Context path="/mstrapp" docBase="/deploy/app.ear/webapp2.war" 
    debug="0" crossContext="true"/>
</Host>

But during JBoss startup, it tries to deploy these 2 webapps and throws errors related to libraries not found (they are inside the ear).

How do we achieve cross context in this case ?

Thanks Sundeep

skaffman
  • 398,947
  • 96
  • 818
  • 769
Sundeep
  • 11
  • 1
  • 4
  • Does deployment work if you set `crossContext` to false? – home Jan 16 '12 at 11:48
  • Its an existing webapp which we are trying to decouple into 2 webapps for internal reasons. So earlier there was no question of cross context. – Sundeep Jan 16 '12 at 11:52
  • Understand, nevertheless, does deployment work if you remove crossContext - maybe you have another issue... – home Jan 16 '12 at 11:55
  • Yes, when I removed the above entries from server.xml, deployment went through fine. – Sundeep Jan 16 '12 at 12:00

1 Answers1

0

Try including custom context.xml inside webapps.

See these links for more info:

JBoss - possible to mount a war on two different context paths?

Tomcat context.xml files, is there a hiearchy?

Community
  • 1
  • 1
Vadzim
  • 24,954
  • 11
  • 143
  • 151