users@glassfish.java.net

Re: Configuring default 404 page for Glassfish v3

From: Amy Roh <amy.roh_at_oracle.com>
Date: Fri, 09 Sep 2011 10:48:53 -0700

On 9/9/11 4:18 AM, forums_at_java.net wrote:
> Hi,
>
> I am trying to configure error page on Glassfish server. I added this to
> web.xml:
>
> <error-page>
> <error-code>404</error-code>
> <location>/opt/sun-glassfish/glassfish/domains/domain1/applications/lrms/user/404_code.jsp</location>
>
> </error-page>
> but it is not working and glassfish is throwing this error message:

The location path should be an absolute path that starts in the
application root. Try <location>/user/404_code.jsp</location>

Amy

>
> [#|2011-09-06T16:17:33.112+0300|SEVERE|glassfishv3.0|org.apache.jasper.servlet.JspServlet|_ThreadID=15;_ThreadName=Thread-1;|PWC6117:
>
> File
> "/opt/sun-glassfish/glassfish/domains/domain1/applications/lrms/opt/sun-glassfish/glassfish/domains/domain1/applications/lrms/user/404_code.jsp"
>
> not found|#]
> When I go to the directory
> /opt/sun-glassfish/glassfish/domains/domain1/applications/lrms/opt/sun-glassfish/glassfish/domains/domain1/applications/lrms/user/
>
> I can see that 404_code.jsp is located there. Also locate 404_code.jsp
> returns no result.
>
> However when I place my 404 page under root and manually add this code to
> domain.xml:
>
> <virtual-server hosts="${com.sun.aas.hostName}"
> http-listeners="http-listener-1,http-listener-2" id="server"
> log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
> <property name="send-error_1" value="path=/root/404_code.jsp
> reason=Resource_not_found code=404"></property>
> </virtual-server>
> it works fine.
>
> I think I am missing one big thing but I don't know it. Does anyone
> have any
> opinion about this issue?
>
> Thanks in advance.
>
>
> --
>
> [Message sent by forum member 'lamostreta']
>
> View Post: http://forums.java.net/node/841369
>
>