users@glassfish.java.net

Configuring default 404 page for Glassfish v3

From: <forums_at_java.net>
Date: Fri, 9 Sep 2011 06:18:06 -0500 (CDT)

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:

[#|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