users@glassfish.java.net

Re: Problem with context URI

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Thu, 16 Jul 2009 17:02:59 -0700

On 07/16/09 01:07 PM, glassfish_at_javadesktop.org wrote:
> Hi,
>
> I am pretty new to Glassfish. I am using Glassfish Enterprise Server v2.1.
>
> My app contains 2 components, 1 EJB jar and 1 WAR. I packaged it into an EAR and deployed it successfully to the server through the admin gui.
>
> The first time I deployed it, I did not include a /META-INF/application.xml file, so my EAR was:
> ejbApp.jar
> szTest.war
>
> Question #1:
> Shouldn't I be able to access my web application by going to http://localhost:8080/szTest?
>
> Well, for some reason I can't and it gives me a 404.
>
> I then proceeded to define an application.xml which contained this:
> <application>
> <module>
> <web>
> <web-uri>szTest.war</web-uri>
> <context-root>szTest</context-root>
> </web>
> </module>
> <module>
> <ejb>ejbApp.jar</ejb>
> </module>
> </application>
>
> Now, the structure of my EAR was:
> --------------------------
> ejbApp.jar
> szTest.war
> META-INF
> - application.xml
> --------------------------
>
> However, even after I deployed the EAR with the new structure (with application.xml), I still can't access http://localhost:8080/szTest application and it gives me a 404.
>
> Note that if I deploy just the szTest.war as a standalone web application, it works and I am able to access it.
>
> Could someone help me out and explain what I am doing wrong here?
>

Can you try changing

  <context-root>szTest</context-root>

to

  <context-root>/szTest</context-root>

in your application.xml, that is, prepend a "/" to the context root?


Jan

> Thanks,
> YC.
> [Message sent by forum member 'ypfamily' (ypfamily)]
>
> http://forums.java.net/jive/thread.jspa?messageID=356092
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>