Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wrong classpath and parameters while running WebLogic in IntelliJ IDEA

I've installed and configured WebLogic and everything works when I run it from the console (it's WebLogic 10.3.5, with JDK 6, on Windows 7).

However, when I configure WebLogic in IntelliJ IDEA (correct BEA Home, correct domain path, etc.) and try to run it, it even uses the correct startWebLogic.cmd, but all I get as output is:

C:\Users\konradstrack\dev\weblogic\base_domain\startWebLogic.cmd
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m
.
WLS Start Mode=Development
.
CLASSPATH=C:\PROGRA~2\Java\JDK16~1.0_2\lib\tools.jar;C:\wlserver\server\lib\weblogic_sp.jar;C:\wlserver\server\lib\weblogic.jar;C:\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\wlserver\server\lib\webservices.jar;C:\modules\org.apache.ant_1.7.1/lib/ant-all.jar;C:\modules\net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar;C:\wlserver\common\derby\lib\derbyclient.jar;C:\wlserver\server\lib\xqrl.jar
.
PATH=;C:\wlserver\server\native\win\32;C:\wlserver\server\bin;C:\modules\org.apache.ant_1.7.1\bin;C:\PROGRA~2\Java\JDK16~1.0_2\jre\bin;C:\PROGRA~2\Java\JDK16~1.0_2\bin;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.3\bin\..\.\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\program files (x86)\jetbrains\intellij idea 11.1.3\jre\jre\bin;C:\wlserver\server\native\win\32\oci920_8
.
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http:\\hostname:port\console        *
***************************************************
starting weblogic with Java version:
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)
Starting WLS with line:
C:\PROGRA~2\Java\JDK16~1.0_2\bin\java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m  -XX:MaxPermSize=128m -Dweblogic.Name=AdminServer -Djava.security.policy=C:\wlserver\server\lib\weblogic.policy  -Xverify:none  -da -Dplatform.home=C:\wlserver -Dwls.home=C:\wlserver\server -Dweblogic.home=C:\wlserver\server   -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: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.  Program will exit.
Exception in thread "main" Disconnected from server

All the paths in classpath and parameters such as -Dplatform.home are pointing to C:\wlserver, which is a completely wrong place (WebLogic is located in C:\Users\konradstrack\dev\weblogic\weblogic-10.3.5).

And my question is: why is it happening, and what can I do to overcome it and cause the IntelliJ IDEA - WebLogic combination to behave correctly?

like image 238
konradstrack Avatar asked Aug 10 '12 13:08

konradstrack


1 Answers

Have you tried setting MW_HOME value in the Windows Environment variables dialog? Because that might be the location where IntelliJ Idea reads WebLogic parameters and values.

This post might be useful for you: https://blogs.oracle.com/imc/entry/weblogic_12c_dev_install_mw

like image 168
Korhan Ozturk Avatar answered Oct 07 '22 16:10

Korhan Ozturk