Troubleshooting
### JSP uses the wrong JDK version On Win32, Resin tries to find Java in the following order: The command-line argument, -java_home The environment variable JAVA_HOME The registry, using JavaSoft's CurrentVersion of the JDK. Following the PATH of the java executable. To find out which Java version Caucho JSP is using, use the '-version' argument on the command line:
resin1.1> bin/httpd -version
### Apache won't start on Win32 The error message might be something like:
"Syntax error on line 785 of C:\PROGRA~1\APACHE~1\APACHE/conf/httpd.conf: Cannot load c:\resin1.1\srun\win32-1.3.6\mod_caucho.dll into server:"
This will happen if the dll is incompatible with the Apache version. Send us a message and we'll make sure you get the right compiled version. ### srun/install.sh won't compile with Apache 1.3.9 This appears to be a problem with Apache for some versions of Unix. Apache's apxs script is missing loader commands. You'll have to modify the apxs script (in /usr/local/apache/bin/apxs) to look something like:
my $CFG_CFLAGS_SHLIB = '-fpic -DSHARED_MODULE'; my $CFG_LD_SHLIB = 'ld'; my $CFG_LDFLAGS_SHLIB = '-Bshareable';
### Apache/IIS cannot contact to servlet runner The particular error message is something like:
Cannot connect to servlet runner at localhost:6802
The servlet runner process needs to be started. In resin1.1/bin the srun executable will start the servlet runner. The srun executable will start Java and wait for connections from the web server. ### File not found The web server (IIS or Apache) and the servlet runner (srun), need to find the web pages. The resin.conf file configures srun. You need to add a 'app-dir' property, to tell srun where to look for the root directory.
<caucho.com> <http-server app-dir='d:\InetPub\wwwroot'> <servlet-mapping url-pattern='*.jsp' servlet-name='com.caucho.jsp.JspServlet'> </http-server> </caucho.com>
### browser returns test.jsp source If you're running Resin with IIS or Apache, the web server might not know how to handle *.jsp files. On Apache, the httpd.conf needs to add Resin. On IIS, the IIS configuration needs to dispatch *.jsp files to srun_iis.dll. Both may need restarting to see the changes. To test if this is the problem, stop the srun executable. If you browse http://localhost/test.jsp, you should get the 'Cannot connect to servlet runner' message. ### How to get debugging information Resin can write debugging information to standard output or to any file. To add debugging information add a log directive to the resin.conf file.
<caucho.com> <log id='/' href='stderr:'/> </caucho.com>
href can be any path. stderr: is perhaps the most useful. id can select which portions of Resin to get logging information. Here are some useful patterns:
/ | Debug everything
/caucho.com/jsp | Debug jsp
/caucho.com/jsp/java | See the JSP generated Java
/caucho.com/jsp/js | See the JSP generated Java
/caucho.com/xsl | XSL debugging
/caucho.com/tcp-server | See thread creation and deletion
/caucho.com/http | HTTP related information
### Resin doesn't update changed servlets and JSP pages Resin has a delay for testing updated servlets and JSP pages. The configuration variable for both is 'class-update-interval' in resin.conf. It's an application-level variable. The default is 15 seconds. So Resin will only check every 15 seconds for an updated page. You can set this value to 0 for development work.
<http-config class-update-interval='0'> ... </http-config>
If you want Resin to check servlets for updates every hour, your resin.conf might look like:
<http-config class-update-interval='3600'> ... </http-config>
### Java JSP doesn't compile java.lang.NoClassDefFoundError: sun/tools/javac/Main The JRE does not contain a Java compiler. You either need to get the JDK or use another compiler. To configure another compiler use:
<caucho.com> <java compiler='/usr/local/bin/jikes'/> ... </caucho.com>
### How do I get exception line numbers? For debugging, it is crucial to get proper line numbers. Unfortunately, Java JITs (just-in-time compilers) remove the line numbers. For development we recomment you turn jit compiling off. On unix, start the server as:
unix> httpd.sh -nojit
### How do I enable session url rewriting? This is only supported in Resin 1.1.b1 and later. You can disable cookies in the resin.conf with a configuration like
<http-server> <session-config enable-cookies='false' enable-url-rewriting='true'/> </http-server>
### How do I keep the generated .java files? By default, Resin removes the generated .java files from a .jsp. To keep the files, you need to add a special logging statement. (Don't worry, it won't generate any output.)
<caucho.com> <log id='/caucho.com/jsp/source' href='stderr:'/> <http-server> ... </http-server> </caucho.com>
### How do I use multiple resin.conf files? This is especially important if you want to use a different workspace for development than deployment. Just call the `httpd` or `srun` executable with the -conf flag.
unix> httpd.sh start -conf devel.conf -verbose
d:\> httpd.exe -conf devel.conf -verbose
Copyright © 1998-2000 Caucho Technology. All rights reserved. Last modified: Fri, 24 Mar 2000 14:25:27 -0800 (PST)