Tuesday, March 18, 2014

Could not find the main class: weblogic.Server. Program will exit.

I was trying to deploy an ADF page to my local jdev server and i was hit by this issue

java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b50)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode)
Starting WLS with line:
C:\Oracle\JDK160~1\bin\java -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m -Dweblogic.Name=DefaultServer -Djava.security.policy=C:\Oracle\Jdeveloper7\wlserver_10.3\server\lib\weblogic.policy -Djavax.net.ssl.trustStore=C:\Oracle\Jdeveloper7\wlserver_10.3\server\lib\DemoTrust.jks -Doracle.jdeveloper.adrs=true -Dweblogic.nodemanager.ServiceEnabled=true -da -Dplatform.home=C:\Oracle\Jdeveloper7\wlserver_10.3 -Dwls.home=C:\Oracle\Jdeveloper7\wlserver_10.3\server -Dweblogic.home=C:\Oracle\Jdeveloper7\wlserver_10.3\server -Djps.app.credential.overwrite.allowed=true -Dcommon.components.home=C:\Oracle\Jdeveloper7\oracle_common -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1 -Djrockit.optfile=C:\Oracle\Jdeveloper7\oracle_common\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1\servers\DefaultServer -Doracle.domain.config.dir=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1 -Digf.arisidbeans.carmlloc=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1\carml -Digf.arisidstack.home=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\servers\DefaultServer\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=C:\Oracle\Jdeveloper7\oracle_common\modules\oracle.ossoiap_11.1.1,C:\Oracle\Jdeveloper7\oracle_common\modules\oracle.oamprovider_11.1.1,C:\Oracle\Jdeveloper7\oracle_common\modules\oracle.jps_11.1.1 -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Dweblogic.jdbc.remoteEnabled=false -Dwsm.repository.path=C:\Users\Token\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\oracle\store\gmds -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= weblogic.Server
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:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
Could not find the main class: weblogic.Server. Program will exit.
Exception in thread "main" Process exited.

This happens when you have an incorrect reference and path variables are not set correctly.

either you reset you path variable or you can just reset the configuration for Jdeveloper.

In a windows machine following location contains the design time configuration details of Jdeveloper

C:\Users\Token\AppData\Roaming\JDeveloper

Depending on the version of your Jdeveloper a file of following format will be created

system11.x.x.x.xx.xx.xx

Check out your version of Jdeveloper and do following action.


1>Stop your Jdeveloper
2>Rename the system11.x.x.x.xx.xx.xx to system11.x.x.x.xx.xx.xx.bak
3>Restart your Jdeveloper

Once you will restart your Jdeveloper you will find that a new folder system11.x.x.x.xx.xx.xx is created, This will automatically pull the data for running and Java file and for running default weblogic server that is embedded with Jdeveloper.

Go ahead and try to deploy your ADF page and it will again ask for server details as shown below




Now if will reconfigure your server details with the correct jDK and your issue should be resolved.

1 comment:

Unknown said...

Muchas gracias me sirvio, eliminando el dominio se reseteo jddeveloper.