在IntelliJ IDEA中运行WebLogic的类路径和参数错误

时间:2022-11-26 00:51:35

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).

我已经安装并配置了WebLogic,当我从控制台运行它时一切都正常(它是WebLogic 10.3.5,在Windows 7上使用JDK 6)。

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:

然而,当我在IntelliJ IDEA中配置WebLogic(正确的BEA Home、正确的域路径等)并尝试运行它时,它甚至使用了正确的startWebLogic。cmd,但我得到的结果是:

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).

类路径和参数(如-Dplatform)中的所有路径。家是指向C:\ wlserver,这是一个完全错误的地方(WebLogic位于C:\Users\ konradstrack \开发\ 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?

我的问题是:为什么会发生这种情况,我该怎么做才能克服它并使IntelliJ的概念WebLogic组合正确运行呢?

3 个解决方案

#1


6  

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.

你试过在Windows环境变量对话框中设置MW_HOME值吗?因为那可能是IntelliJ Idea读取WebLogic参数和值的位置。

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

这篇文章可能对您有用:https://blogs.oracle.com/imc/entry/weblogic_12c_dev_install_mw

#2


2  

That also happened to me on Mac OsX 10.7.5 with WebLogic wls1211_dev. Following the instructions in README.txt the server launched successfully. But when trying to launch it from IntelliJ it was saying the same thing:

我在Mac OsX 10.7.5和WebLogic wls1211_dev上也遇到过这种情况。按照README中的说明。服务器成功启动。但是当尝试从IntelliJ启动它的时候,它说的是同样的话:

java.lang.NoClassDefFoundError: weblogic/Server

So I had to manually set the variable in all scripts in the mydomain directory (startWebLogic.sh, and all other launching/stoping scripts in the mydomain/bin ) :

因此,我必须在mydomain目录(startWebLogic)中的所有脚本中手动设置变量。sh和mydomain/bin中的所有其他启动/停止脚本):

export MW_HOME=/Users/mario/Programs/wls1211_dev

#3


0  

After running the ..\server\bin\setWLSEnv.cmd I was able to restart weblogic server.

在运行. . \ server \ bin \ setWLSEnv之后。cmd我能够重新启动weblogic服务器。

This file sets the classpath and path values for system.

此文件设置系统的类路径和路径值。

#1


6  

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.

你试过在Windows环境变量对话框中设置MW_HOME值吗?因为那可能是IntelliJ Idea读取WebLogic参数和值的位置。

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

这篇文章可能对您有用:https://blogs.oracle.com/imc/entry/weblogic_12c_dev_install_mw

#2


2  

That also happened to me on Mac OsX 10.7.5 with WebLogic wls1211_dev. Following the instructions in README.txt the server launched successfully. But when trying to launch it from IntelliJ it was saying the same thing:

我在Mac OsX 10.7.5和WebLogic wls1211_dev上也遇到过这种情况。按照README中的说明。服务器成功启动。但是当尝试从IntelliJ启动它的时候,它说的是同样的话:

java.lang.NoClassDefFoundError: weblogic/Server

So I had to manually set the variable in all scripts in the mydomain directory (startWebLogic.sh, and all other launching/stoping scripts in the mydomain/bin ) :

因此,我必须在mydomain目录(startWebLogic)中的所有脚本中手动设置变量。sh和mydomain/bin中的所有其他启动/停止脚本):

export MW_HOME=/Users/mario/Programs/wls1211_dev

#3


0  

After running the ..\server\bin\setWLSEnv.cmd I was able to restart weblogic server.

在运行. . \ server \ bin \ setWLSEnv之后。cmd我能够重新启动weblogic服务器。

This file sets the classpath and path values for system.

此文件设置系统的类路径和路径值。