2

I'm using IBM RAD v7 which is based on Eclipse and I've got a NullPointerException in a compiled JSP that I want to troubleshoot. So I wonder where websphere / Eclipse (IBM RAD) stores the source for the compiled JSP that the error message is referring to?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424

3 Answers3

7

Locate your runtime directory. If this is an embedded runtime, it'll be something like:

/opt/IBM/SDP/runtimes/basev7

The servlets are usually compiled lazily to the profile's temp directory. This path will be of the form:

/profiles/profileName/temp/nodeName/serverName

The profile, node and server name are configuration dependent. Subdirectories will follow your EAR/WAR hierarchies.

McDowell
  • 107,573
  • 31
  • 204
  • 267
  • Thanks I found it but the .java files are only there if they are without compilation errors. If I make a file with an error the .java file is automatically deleted. How can I change this to always keeping the .java files? – Niklas Rosencrantz Mar 09 '12 at 11:37
  • 4
    Use the `keepgenerated` [JSP engine configuration parameter](http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rweb_jspengine.html) to keep the JSP translation output. See [here](http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/tweb_jspengine.html) for WAS 7 instructions. See the [Infocenter library](http://www-01.ibm.com/software/webservers/appserv/was/library/) for other versions. – McDowell Mar 09 '12 at 13:31
  • 1
    I found the files after some searching. For me with IBM RAD 8 and WAS 8 the files are saved in `C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv1\temp\PRVSTHV1510Node01\server1\` – Niklas Rosencrantz May 15 '12 at 08:08
2

It depends on your servlet container settings. IN case of tomcat, it is most likely located under:

/work/Catalina///org/apache/jsp/

Konstantin Pribluda
  • 12,329
  • 1
  • 30
  • 35
  • I'm using websphere builtin IBM RAD. – Niklas Rosencrantz Mar 09 '12 at 08:21
  • The your best option would be to search file system fpr directories with matching names. websphere is a mess. – Konstantin Pribluda Mar 09 '12 at 09:22
  • Thanks for the help. For me with IBM RAD 8 and WAS 8 the files are located in the directory `C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv1\temp\PRVSTHV1510Node01\server1\` I can open a translated JSP file in its .java format from there. I now wonder why the link from the compile error to this java class is not working, it would be much easier if this directory was known to RAD and it should be. – Niklas Rosencrantz May 15 '12 at 08:10
0

Locating Java Servlet Files Generated from JSP Files Viewing generated Java servlet code is an important part of the JSP development process.

To view the generated servlet files:

Start the server and deploy your application. In a web browser, visit the target JSP file.

When the server is started using Workshop, the location of the generated JSP servlet code is: <path_to_workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/<server_domain_name>/work/<project_name>/jsp_servlet/