Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes Enterprise Application with 2 web applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Enterprise Application with 2 web applications" Watch "Enterprise Application with 2 web applications" New topic
Author

Enterprise Application with 2 web applications

Pramoda Bhat
Ranch Hand

Joined: Oct 17, 2003
Posts: 32
Hi,
I have an Enterprise application, .ear file, under which I have 2 web applications, i.e., 2 .war & 2 .jar files.. And I have an application.xml file, which tells the application, which webapp's web.xml to pic, depending on the context-root, but it is not identifying the second webapp can some one help?
Note: Please find my application.xml & part of web.xml in both the applications

application.xml in vig.ear/meta-inf
<application>

<display-name>Expence Claim</display-name>
<description>An Application for claiming the expences</description>
<module>
<ejb>vigjar.jar</ejb>
</module>
<module>
<ejb>exjar.jar</ejb>
</module>
<module>
<web>
<web-uri>exwar.war</web-uri>
<context-root>ExClaim</context-root>
</web>
</module>
<module>
<web>
<web-uri>vigwar.war</web-uri>
<context-root>vigInt</context-root>
</web>
</module>

</application>

web.xml - vigwar
<security-constraint>
<web-resource-collection>
<web-resource-name>vigInt</web-resource-name>
<description>Declarative security - A try for ExpenceClaim</description>
<url-pattern>/login.do</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>SE</role-name>
<role-name>SSE</role-name>
<role-name>PL</role-name>
</auth-constraint>

<user-data-constraint>
<description>no description</description>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>


web.xml - exwar

<security-constraint>
<web-resource-collection>
<web-resource-name>ExClaim</web-resource-name>
<description>Declarative security - A try for ExpenceClaim</description>
<url-pattern>/ExClaim/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>SE</role-name>
<role-name>SSE</role-name>
<role-name>PL</role-name>
</auth-constraint>
<user-data-constraint>
<description>no description</description>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>

In the browser - if I type http://localhost:8080/vigInt/login.do it shows the login.jsp- of vigwar, after that If the url changes to http://localhost:8080/ExClaim, it gives me a resourse not found exception!!! i.e., its not recognising my web.xml of exwar...

Please helpppp
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Pramoda,

We have something similar and looking at our configuration files I can tell you that they look almost identical, with only one exception, which might be significant:

Here the is the second hint that I could give you (personally I strongly believe that your problem is here):

Sometimes I found that protecting all your resources in a web app using the * pattern could give a lot of trouble. This will imply that all your resources are protected, including img(s) or gif(s), etc. Hence if your login page displays an image, because that�s protected as well your page won�t display and the container might raise a resource not found exception. I hope this helps.
Regards.


I think, therefore I exist -- Rene Descartes
Pramoda Bhat
Ranch Hand

Joined: Oct 17, 2003
Posts: 32
Hi Valentin,
Thanks for taking time & replying..
I found out the error.., i.e., in web.xml of exwar.. I had to mention,



<web-resource-collection>
<web-resource-name>ExClaim</web-resource-name>
<description>Declarative security - A try for ExpenceClaim</description>
<url-pattern>/*</url-pattern>

earlier I had mentioned
<url-pattern>/ExClaim/*</url-pattern>

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enterprise Application with 2 web applications