I have set everything in the entire $CATALINA_HOME directory tree to be owned by user tomcat, group tomcat. I even tried setting them to user.root and put tomcat in the root group. Still, Tomcat cannot write to the work dir.
When I try to run jsvc as user root, I get a java.lang.reflect.InvocationTargetException. But when I run as root using startup.sh, everything's fine. And once I've compiled the jsps in the work directory and the class files exist, then I can run them under the daemon. So there's definitely something fishy with the jsvc daemon that is preventing me from compiling. I carefully set up the init.d tomcat script so that it mimics startup.sh as much as possible. Still no dice. I've turned on debugging and I see that when the daemon kicks off, it lists its parsed command line arguments (I've posted the output below). There are options such as run as service, install service, etc. Should I be trying to run as service? ..Bob. catalina_home is /usr/local/tomcat5 setting classpath classpath is @/usr/lib/java/lib/tools.jar:/usr/local/tomcat5/bin/commons-daemon.jar:/usr/local/tomcat5/bin/commons-logging-api.jar:/usr/local/tomcat5/bin/bootstrap.jar@ jsvc debug: +-- DUMPING PARSED COMMAND LINE ARGUMENTS -------------- jsvc debug: | Detach: True jsvc debug: | Show Version: No jsvc debug: | Show Help: No jsvc debug: | Check Only: Disabled jsvc debug: | Run as service: No jsvc debug: | Install service: No jsvc debug: | Remove service: No jsvc debug: | JVM Name: "server" jsvc debug: | Java Home: "/usr/lib/java" jsvc debug: | PID File: "/usr/local/tomcat5/logs/catalina.pid" jsvc debug: | User Name: "tomcat" jsvc debug: | Extra Options: 8 jsvc debug: | "-verbose" jsvc debug: | "-Dcatalina.home=/usr/local/tomcat5" jsvc debug: | "-Djava.io.tmpdir=/usr/local/tomcat5/temp" jsvc debug: | "-Djava.endorsed.dirs=/usr/local/tomcat5/common/endorsed" jsvc debug: | "-Dcatalina.base=/usr/local/tomcat5" jsvc debug: | "-Djava.class.path=/usr/lib/java/lib/tools.jar:/usr/local/tomcat5/bin/commons-daemon.jar:/usr/local/tomcat5/bin/commons-logging-api.jar:/usr/local/tomcat5/bin/bootstrap.jar" jsvc debug: | "-Xms256m" jsvc debug: | "-Xmx384m" jsvc debug: | Class Invoked: "org.apache.catalina.startup.Bootstrap" jsvc debug: | Class Arguments: 0 jsvc debug: +------------------------------------------------------- jsvc debug: user changed to 'tomcat' jsvc debug: User 'tomcat' validated jsvc debug: Attempting to locate Java Home in /usr/lib/java jsvc debug: Attempting to locate VM configuration file /usr/lib/java/jre/lib/jvm.cfg jsvc debug: Found VM configuration file at /usr/lib/java/jre/lib/jvm.cfg jsvc debug: Found VM client definition in configuration jsvc debug: Checking library /usr/lib/java/jre/lib/i386/client/libjvm.so jsvc debug: Found VM server definition in configuration jsvc debug: Checking library /usr/lib/java/jre/lib/i386/server/libjvm.so jsvc debug: Found VM hotspot definition in configuration jsvc debug: Checking library /usr/lib/java/jre/lib/i386/hotspot/libjvm.so jsvc debug: Checking library /usr/lib/java/lib/i386/hotspot/libjvm.so jsvc debug: Cannot locate library for VM hotspot (skipping) jsvc debug: Found VM classic definition in configuration jsvc debug: Checking library /usr/lib/java/jre/lib/i386/classic/libjvm.so jsvc debug: Checking library /usr/lib/java/lib/i386/classic/libjvm.so jsvc debug: Cannot locate library for VM classic (skipping) jsvc debug: Found VM native definition in configuration jsvc debug: Checking library /usr/lib/java/jre/lib/i386/native/libjvm.so jsvc debug: Checking library /usr/lib/java/lib/i386/native/libjvm.so jsvc debug: Cannot locate library for VM native (skipping) jsvc debug: Found VM green definition in configuration jsvc debug: Checking library /usr/lib/java/jre/lib/i386/green/libjvm.so jsvc debug: Checking library /usr/lib/java/lib/i386/green/libjvm.so jsvc debug: Cannot locate library for VM green (skipping) jsvc debug: Java Home located in /usr/lib/java jsvc debug: +-- DUMPING JAVA HOME STRUCTURE ------------------------ jsvc debug: | Java Home: "/usr/lib/java" jsvc debug: | Java VM Config.: "/usr/lib/java/jre/lib/jvm.cfg" jsvc debug: | Found JVMs: 2 jsvc debug: | JVM Name: "client" jsvc debug: | "/usr/lib/java/jre/lib/i386/client/libjvm.so" jsvc debug: | JVM Name: "server" jsvc debug: | "/usr/lib/java/jre/lib/i386/server/libjvm.so" jsvc debug: +------------------------------------------------------- jsvc debug: Using specific JVM in /usr/lib/java/jre/lib/i386/server/libjvm.so jsvc debug: Invoking w/ LD_LIBRARY_PATH=/usr/lib/java/jre/lib/i386/server:/usr/lib/java/jre/lib/i386 jsvc.exec debug: +-- DUMPING PARSED COMMAND LINE ARGUMENTS -------------- jsvc.exec debug: | Detach: True jsvc.exec debug: | Show Version: No jsvc.exec debug: | Show Help: No jsvc.exec debug: | Check Only: Disabled jsvc.exec debug: | Run as service: No jsvc.exec debug: | Install service: No jsvc.exec debug: | Remove service: No jsvc.exec debug: | JVM Name: "server" jsvc.exec debug: | Java Home: "/usr/lib/java" jsvc.exec debug: | PID File: "/usr/local/tomcat5/logs/catalina.pid" jsvc.exec debug: | User Name: "tomcat" jsvc.exec debug: | Extra Options: 8 jsvc.exec debug: | "-verbose" jsvc.exec debug: | "-Dcatalina.home=/usr/local/tomcat5" jsvc.exec debug: | "-Djava.io.tmpdir=/usr/local/tomcat5/temp" jsvc.exec debug: | "-Djava.endorsed.dirs=/usr/local/tomcat5/common/endorsed" jsvc.exec debug: | "-Dcatalina.base=/usr/local/tomcat5" jsvc.exec debug: | "-Djava.class.path=/usr/lib/java/lib/tools.jar:/usr/local/tomcat5/bin/commons-daemon.jar:/usr/local/tomcat5/bin/commons-logging-api.jar:/usr/local/tomcat5/bin/bootstrap.jar" jsvc.exec debug: | "-Xms256m" jsvc.exec debug: | "-Xmx384m" jsvc.exec debug: | Class Invoked: "org.apache.catalina.startup.Bootstrap" jsvc.exec debug: | Class Arguments: 0 jsvc.exec debug: +------------------------------------------------------- jsvc.exec debug: user changed to 'tomcat' jsvc.exec debug: User 'tomcat' validated jsvc.exec debug: Attempting to locate Java Home in /usr/lib/java jsvc.exec debug: Attempting to locate VM configuration file /usr/lib/java/jre/lib/jvm.cfg jsvc.exec debug: Found VM configuration file at /usr/lib/java/jre/lib/jvm.cfg jsvc.exec debug: Found VM client definition in configuration jsvc.exec debug: Checking library /usr/lib/java/jre/lib/i386/client/libjvm.so jsvc.exec debug: Found VM server definition in configuration jsvc.exec debug: Checking library /usr/lib/java/jre/lib/i386/server/libjvm.so jsvc.exec debug: Found VM hotspot definition in configuration jsvc.exec debug: Checking library /usr/lib/java/jre/lib/i386/hotspot/libjvm.so jsvc.exec debug: Checking library /usr/lib/java/lib/i386/hotspot/libjvm.so jsvc.exec debug: Cannot locate library for VM hotspot (skipping) jsvc.exec debug: Found VM classic definition in configuration jsvc.exec debug: Checking library /usr/lib/java/jre/lib/i386/classic/libjvm.so jsvc.exec debug: Checking library /usr/lib/java/lib/i386/classic/libjvm.so jsvc.exec debug: Cannot locate library for VM classic (skipping) jsvc.exec debug: Found VM native definition in configuration jsvc.exec debug: Checking library /usr/lib/java/jre/lib/i386/native/libjvm.so jsvc.exec debug: Checking library /usr/lib/java/lib/i386/native/libjvm.so jsvc.exec debug: Cannot locate library for VM native (skipping) jsvc.exec debug: Found VM green definition in configuration jsvc.exec debug: Checking library /usr/lib/java/jre/lib/i386/green/libjvm.so jsvc.exec debug: Checking library /usr/lib/java/lib/i386/green/libjvm.so jsvc.exec debug: Cannot locate library for VM green (skipping) jsvc.exec debug: Java Home located in /usr/lib/java jsvc.exec debug: +-- DUMPING JAVA HOME STRUCTURE ------------------------ jsvc.exec debug: | Java Home: "/usr/lib/java" jsvc.exec debug: | Java VM Config.: "/usr/lib/java/jre/lib/jvm.cfg" jsvc.exec debug: | Found JVMs: 2 jsvc.exec debug: | JVM Name: "client" jsvc.exec debug: | "/usr/lib/java/jre/lib/i386/client/libjvm.so" jsvc.exec debug: | JVM Name: "server" jsvc.exec debug: | "/usr/lib/java/jre/lib/i386/server/libjvm.so" jsvc.exec debug: +------------------------------------------------------- jsvc.exec debug: Running w/ LD_LIBRARY_PATH=/usr/lib/java/jre/lib/i386/server:/usr/lib/java/jre/lib/i386 jsvc.exec debug: redirecting stdout to /usr/local/tomcat5/logs/catalina.out and stderr to /usr/local/tomcat5/logs/catalina.err --- Parsons Technical Services <[EMAIL PROTECTED]> wrote: > Bob, > > It sounds like a permissions problem. Check the settings in the context for > "workdir=......." > If you have set this, then you must ensure that your tomcat user has rights > to that directory also. > > Read through the following to see if you missed anything in your setup: > http://marc.theaimsgroup.com/?l=tomcat-user&m=108373546715111&w=2 > > If all else fails, run TC as root, search for the temp directory and check > the permissions on the parent directory. Set it and the temp directory to > tomcat owner. > > Doug > www.parsonstechnical.com > > > ----- Original Message ----- > From: "Bob White" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, May 20, 2004 2:08 AM > Subject: running Tomcat from jsvc daemon under Linux as user tomcat > > > > I am running Tomcat (under Linux) from jsvc daemon as user "tomcat". When > I do > > this, Tomcat fails to run JSPs because Tomcat cannot create java files in > the > > work directories and subsequently cannot compile them (cuz they're not > there). > > > > When I run Tomcat using startup.sh as user "root" I have no problems. > > > > When I run Tomcat using startup.sh as user "tomcat", I can compile at > least > > some of the java files, but there's another problem with one particular > app > > which uses css stylesheets and the stylesheets don't get made properly. > I'll > > worry about that later. > > > > Of course, the quick solution is to simply invoke startup.sh as root from > my > > /etc/init.d/tomcat script. But according to instructions > > on the Apache site, I'm supposed to be able to run Tomcat as daemon using > jsvc. > > > > But something's amiss. I installed Tomcat as user "tomcat" and user > "tomcat" > > owns the entire directory tree (ie. /usr/local/tomcat5/...). I put user > > "tomcat" into group "tomcat" and group "root" and tried putting the entire > > directory tree into both the "tomcat" group and the "root" group. No > > difference. > > > > Any ideas? > > > > BTW, the exact error message I am getting is: > > > > java.io.FileNotFoundException: > > > /usr/local/tomcat5/work/Catalina/localhost/AHEMSS/org/apache/jsp/ahess/ess0_ > jsp.java > > at java.io.FileOutputStream.open(Native Method) > > at java.io.FileOutputStream.(FileOutputStream.java:179) > > at java.io.FileOutputStream.(FileOutputStream.java:70) > > at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:223) > > ... etc.... > > > > ..Bob. > > > > ===== > > --Bob White-- home:727-490-7363, cell:727-463-6061 > > New (popup free!) photos of Polina: http://polina.70kg.com/ > > > > Everything that irritates us about others can lead us to an understanding > of ourselves. - Carl Jung > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ===== --Bob White-- home:727-490-7363, cell:727-463-6061 New (popup free!) photos of Polina: http://polina.70kg.com/ Everything that irritates us about others can lead us to an understanding of ourselves. - Carl Jung --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
