tags:

views:

1798

answers:

3

when you hit a serious compilation error while writing JSP pages and running under Oracle OC4J or Application Server, you can end up with the following displayed on screen:

500 Internal Server Error OracleJSP: An error occurred. Consult your application/system administrator for support. Programmers should consider setting the init-param debug_mode to "true" to see the complete exception message.

I've seen varying advice on how/where to set the debug_mode init-param. What are the options?

Also, is this specific to Oracle, or is this a JSP standard feature? How would the technique be different for other application servers?

+1  A: 

Please go to $ORACLE_HOME/oc4j/j2ee/OC4J_SEARCH/config/global-web-application.xml

Extend the servlet node this way:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
<param-name>debug_mode</param-name>
<param-value>true</param-value>
</init-param>

Restart OC4J and thats should be it. Also have a look at $ORACLE_HOME/oc4j/j2ee/OC4J_SEARCH/application-deployments/ses_query/application.log

Mork0075
+1  A: 

Assuming you're using Eclipse, MyEclipse plugin comes with very good JSP debugging capabilities out of the box if you don't want to go through the pain of configuring debugging for jsps.

Sathish
bad assumption;-) but thanks for the tip, I should check out eclipse again.
tardate
A: 

Solution so far...

Option 1: add the debug_mode parameter to the OC4J global-web-application.xml

  • the setting will apply to all applications in the OC4J container
  • See the response from @Mork0075 for details (except note that the OC4J container name and application names are specific to an example of enabling debug for Oracle's Secure Enterprise Search)

Option 2: add to your application's web.xml

  • Obviously, allows for a more local change
  • There are additional settings (developer_mode,encode_to_java,emit_debuginfo) which may be of use also

For example:

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
    <param-name>debug_mode</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>developer_mode</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>encode_to_java</param-name>
    <param-value>true</param-value>
</init-param>
<init-param>
    <param-name>emit_debuginfo</param-name>
    <param-value>true</param-value>
</init-param>
</servlet>

Since these options are being set for the class oracle.jsp.runtimev2.JspServlet, it is obviously specific for Oracle OC4J/Application Server installations.

tardate
I've answered my own question. Still a little uncomfortable about the etiquette of doing so, however I don't have a 'perfect' answer to select so far. This summarizes the solutions to date, but as soon as a better answer comes along, I'll vote for that.
tardate