• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot load daemon java_load failed Service exit with a return value of 3

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to run Tomcat via daemon but I am getting this error. Any ideas what might cause this?

OS
CentOS 64Bit

Error Log

Switching umask back to 022 from 077
user changed to 'tomcat'
Using default JVM in /home/pwp-admin/jdk1.7.0_55/jre/lib/amd64/server/libjvm.so
Attemtping to load library /home/pwp-admin/jdk1.7.0_55/jre/lib/amd64/server/libjvm.so
JVM library /home/pwp-admin/jdk1.7.0_55/jre/lib/amd64/server/libjvm.so loaded
JVM library entry point found (0x36F687C0)
+-- DUMPING JAVA VM CREATION ARGUMENTS -----------------
| Version: 0x010004
| Ignore Unrecognized Arguments: False
| Extra options: 5
| "-Djava.class.path=/home/pwp-admin/apache-tomcat/bin/bootstrap.jar:/home/pwp-admin/apache-tomcat/bin/tomcat-juli.jar" (0x00000000)
| "-Dcatalina.home=/home/pwp-admin/apache-tomcat" (0x00000000)
| "-Dcatalina.base=/home/pwp-admin/apache-tomcat" (0x00000000)
| "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" (0x00000000)
| "-Djava.util.logging.config.file=/home/pwp-admin/apache-tomcat/conf/logging.properties" (0x00000000)
+-------------------------------------------------------
| Internal options: 4
| "-Dcommons.daemon.process.id=3292" (0x00000000)
| "-Dcommons.daemon.process.parent=3291" (0x00000000)
| "-Dcommons.daemon.version=1.0.10" (0x00000000)
| "abort" (0x00405c50)
+-------------------------------------------------------
Java VM created successfully
Class org/apache/commons/daemon/support/DaemonLoader found
Native methods registered
java_init done
Daemon loading...
Apr 22, 2014 2:27:09 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/home/pwp-admin/apache-tomcat/lib], exists: [true], isDirectory: [true], canRead: [false]
Apr 22, 2014 2:27:09 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/home/pwp-admin/apache-tomcat/lib], exists: [true], isDirectory: [true], canRead: [false]
Apr 22, 2014 2:27:09 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/home/pwp-admin/apache-tomcat/lib], exists: [true], isDirectory: [true], canRead: [false]
Apr 22, 2014 2:27:09 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/home/pwp-admin/apache-tomcat/lib], exists: [true], isDirectory: [true], canRead: [false]
java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:236)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:308)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:212)
Cannot load daemon
java_load failed
Service exit with a return value of 3
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


WARNING: Problem with directory [/home/pwp-admin/apache-tomcat/lib], exists: [true], isDirectory: [true], canRead: [false]



You can't find java classes when you can't even read the library that they live in.

Check your file access rights for the user that Tomcat is being run under.
 
Haris Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed this too. In order to make sure its the rights issue I have set right = 777 (temporarily) for whole tomcat folder. But still I get this error which doesn't make any sense
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do the following at a boot command prompt:


See if that helps. If it does, you are being denied by selinux and you should ideally label your tomcat files to be properly authorized under selinux. The audit2why program can help determine what the offence is.

Another possibility is if the volume that contains Tomcat is somehow marked read-only.
 
Haris Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am afraid it didn't change anything. And the volume is not read only
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. Try this.

1. "su xxxx", where xxxx is the username that Tomcat runs under. You may have to use something like "su -p" if that user isn't set up to login.

2. jar -tvf TOMCAT_HOME/lib/catalina.jar", where TOMCAT_HOME is your Tomcat root directory.

If you really don't have access rights, the preceding command will fail and you need to adjust them. Otherwise it should list the classes in the catalina.jar file.
 
Haris Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While trying to do what you suggested I found that following commands are not accessible to tomcat user while they are to root

java, javac, jar

I simply get command not found when I run jar from tomcat user
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


This assumes that you installed the RPM version of the JDK from Oracle.

I'm still not convinced that the open-source Java that comes with CentOS is functional enough to run J2EE, so I continue to recommend installing the Sun/Oracle JDK.
 
Haris Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I manually downloaded and setup the JDK from Oracle site. I am not sure if tomcat user even needs access to java,jre and javac. But even if I specify root user(for testing purpose) while launching jsvc I get the same error. I have tried almost everything not sure whats wrong.

I really appreciate your help.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JDK has a copy of the JRE embedded within it.

And yes, Tomcat needs "javac". JSPs are translated (via a utility named JaSPer) into java servlets, which the java compiler compiles into servlet classes. That's why Tomcat must have the JDK and not just the JRE.

I do recommend installing the Oracle RPM over the simple archive, but either way works as long as you put the JDK/bin directory in your path when attempting to execute javac or jar.

You MUST set JAVA_HOME to point to the root directory of the JDK before running the Tomcat startup.sh or catalina.sh start. I'm not as familiar with jsvc, but I would expect the same requirements there.
 
Haris Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, here is what works...

I have a user X. In home directory of X I have JDK(with jre inside), tomcat and some other things. I have a tomcat user. If I give tomcat user '5/rx' permission on home directory of X everything seem to work fine.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "x" attribute is deceitful. Although it indicates an eXecutable file, when applied to a directory, it indicates directory access permission. In other words, you cannot access a file within a directory unless the directory itself has "x" rights for your user or group ID.

755 is usually a good set of rights for something like this. Applied all the way down (recursively).

That's one of the reasons why an RPM or tarball is the preferred way to install the JDK. Both of those objects have their access flags pre-set, and their user/group ID should be root (0).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic