After using WebLogic Admin Console to add WebAppSupport.jar to Server classpath it fails to start and stdout log shows "Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server"

Document ID : KB000008105
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

New WebLogic agent install under WebLogic 10.3.6 cluster instance.

After using WebLogic Admin Console to add WebAppSupport.jar to the classpath in "Servers/SERVER_NAME/Environment/Server Start/Class Path" the instance fails to start and the stdout log shows:

Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server 

Caused by: java.lang.ClassNotFoundException: weblogic.Server 

at java.net.URLClassLoader$1.run(URLClassLoader.java:202) 

at java.security.AccessController.doPrivileged(Native Method) 

at java.net.URLClassLoader.findClass(URLClassLoader.java:190) 

at java.lang.ClassLoader.loadClass(ClassLoader.java:306) 

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 

at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 

Could not find the main class: weblogic.Server. 

Environment:
APM Agent 9,x, 10.xWebLogic 10.3.6
Cause:

The customisation of the classpath has caused the main WebLogic class not to be picked up.

Normally the advice is to also add weblogic_sp.jar and weblogic.jar to the classpath when customising it. However doing that still does not allow the instance to start (shows "FAILED_NOT_RESTARTABLE") and the stdout log shows this error:

Parsing Failure in config.xml: failed to find method MethodName{methodName='setCacheInAppDirectory', paramTypes=[boolean]} on class weblogic.management.configuration.AppDeploymentMBeanImpl> 

Resolution:

Per the Oracle DOC ID 1509703.1:

"Managed Server State FAILED_NOT_RESTARTABLE When Class Path Provided And Started From Admin Console (Doc ID 1509703.1)

=======

SYMPTOMS 

After applying the WebLogic Server 10.3.6 PSU, a managed server fails to start when the class path is provided and started from the admin console. 

SOLUTION

Specifying WL_HOME/server/lib/weblogic_sp.jar;WL_HOME/server/lib/weblogic.jar in the classpath of Server-start is causing this issue. There is no need to set these in the classpath of Server-start since they will come in from the system classpath. If a custom classpath is needed for the managed server. then it should set as below: 

BEA_HOME/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:BEA_HOME/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:WL_HOME/server/lib/weblogic_sp.jar:WL_HOME/server/lib/weblogic.jar 

The weblogic_patch.jar must precede weblogic_sp.jar and weblogic.jar -- this ensures that the classes in the patch are loaded rather than the unpatched classes. 

=======

One weblogic_patch.jar was found on the installation and this was added to the classpath to resolve the problem using this final classpath:

/opt/weblogic10.3.6/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/weblogic10.3.6/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/weblogic10.3.6/wlserver_10.3/server/lib/weblogic.jar:AGENT_HOME/wily/common/WebAppSupport.jar

Additional Information: