Jun 082012
 Posted by on June 8, 2012 at 6:27 pm Application Servers, Java App Servers, Oracle/BEA WebLogic Tagged with:  Add comments

While starting managed server or node manager if you are getting “java.lang.ClassNotFoundException: java” error then do the below steps to fix the issue

<Jan 9, 2011 8:38:59 AM> <INFO> <NodeManager> <Server output log file is '/servers/logs/UIY1.out'>
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: java
Caused by: java.lang.ClassNotFoundException: java
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
Could not find the main class: java. Program will exit.
<Jan 9, 2011 8:39:00 AM> <FINEST> <NodeManager> <Waiting for the process to die: 85897>
<Jan 9, 2011 8:39:00 AM> <INFO> <NodeManager> <Server failed during startup so will not be restarted>
<Jan 9, 2011 8:39:00 AM> <FINEST> <NodeManager> <runMonitor returned, setting finished=true and notifying waiters>

java.lang.ClassNotFoundException: java
This error message typically happens when specifying 2 times the ‘java’ keyword on the command line e.g.

>java java
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: java

Check the config.xml file for any where it’s repeated two times or more and check startup log to see what exact commandline it’s taking and whether the java is repeated more than one time after start command.

<Jan 9, 2011 5:55:09 AM> <INFO> <NodeManager> <Starting WebLogic server with command line: /opt/jdk/jrockit-jdk1.6.0_24/bin/java -Dweblogic.Name=TP1 -Dbea.home=/opt/weblogic -Djava.security.policy=/opt/weblogic/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.management.server= java -jrockit -XnoOpt -XXnoJITInline -Xms512m -Xmx512m -Dtoplink.xml.platform=oracle.toplink.platform.xml.jaxp.JAXPPlatform -Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0 -Dweblogic.Chunksize=65536 -Djava.util.logging.config.file=/opt/properties/logging.properties -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Dweblogic.Name=TP1 -Dweblogic.system.BootIdentityFile=/opt/servers/WebLogicAdmin/security/boot.properties -Djavax.net.ssl.trustStore=/opt/weblogic/wlserver_10.3/server/lib/trust01.jks (…) weblogic.Server >

Like above example command line java is repeted two times
1. In starting /opt/jdk/jrockit-jdk1.6.0_24/bin/java
2. In the middle “java -jrockit -XnoOpt”

The above command line will give you the “Exception in thread “Main Thread” java.lang.NoClassDefFoundError: java” remove the 2nd java and it will work.

© Incase of any copyright infringements please check copyrights page for faster resolutions.

Leave a Reply

Show Buttons
Hide Buttons