JSP engine troubleshooting tips
If you are having difficulty using the JSP engine, try these steps...
- Determine whether other resources such as .html files or servlets are being requested and displayed correctly. If they are not, the problem probably lies at a deeper level, such as with the HTTP server.
- If other resources are being displayed correctly, determine whether the JSP engine has started normally...
- Browse the JVM logs of the server hosting the JSP files you are trying to access. A message such as application_name/Sevlet.LOG... JSP 1.2 Processor: init" in the root_dir/logs/server/SystemOut.log file indicates that the JSP engine has started normally. If the JSP processor fails to load, you may see a message such as Did not realize init() exception thrown by servlet JSP 1.2 Processor in application_name/Servlet.LOG... JSP 1.2 Processor: init" in the root_dir/logs/server/SystemOut.log file .
- Open the Log analyzer on the service log of the server which is hosting the JSP file you are trying to access and use it to browse error and warning messages.
- If the JSP engine has started normally, the problem may be with the JSP file itself.
- Copy a simple JSP file file (such as the WebSphere Application Server sample "HelloHTML.jsp") to the web application (.war)'s document root and attempt to serve it.
- If that works, examine the target appserver's SystemOut.log for invalid JSP directive syntax . Errors similar to the following in a browser indicate this kind of problem: Message... /jspname.jsp(9,0) Include: Mandatory attribute page missing. This example indicates that line 9, column 0 of the named JSP file is missing a mandatory page attribute. Similar messages are displayed for other syntax errors.
Examine the target appserver's SystemErr.log files for problems with invalid Java syntax. Errors similar to Message: Unable to compile class for JSP in a browser indicate this kind of problem.
The error message output from the Javac compiler will be found in the SystemErr.log . It might look like
C:\WASROOT\temp\ ... test.war\_myJsp.java:14: Duplicate variable declaration: int myInt was int myInt int myInt = 122; String string = "number is 122"; static int myStaticInt=22; int myInt=121; ^ 1 errorCorrect the error in the JSP file and retry the file.
If none of these steps solves the problem, check to see if the problem is identified and documented using the links in Diagnosing and fixing problems: Resources for learning. If you do not see a problem that resembles yours, or if the information provided does not solve your problem, contact IBM support for further assistance.
For current information available from IBM Support on known problems and their resolution, see IBM Support page.
IBM Support has documents that can save you time gathering information needed to resolve this problem. Before opening a PMR, see IBM Support page.
See Also
Troubleshooting installation problems