wlst嵌入模式不起作用

时间:2012-09-11 12:41:14

标签: java weblogic wlst bea

我正在尝试为像这样的任务构建一个小工具 1)连接到weblogic管理服务器。 2)添加托管服务器。 3)使用nodemanager等注册域。

我在eclipse中开始开发,将weblogic \ wlserver103 \ server \ lib的所有jar添加到我的项目构建路径中。(我不知道wlst embeded模式需要哪些jar)开发环境设置没有任何错误。当我尝试运行像连接管理服务器这样的简单任务时。抛出异常,如下所示

Connecting to t3://ksai.domain.simpledevelopers.com:7001 with userid javadev13 ...
The CompatabilityMBeanServer is not initialized properly. 
This might happen if the CompatabilityMBeanServer is 
disabled via the JMXMBean.

To view the root cause exception use dumpStack()

WLST detected that the RuntimeMBeanServer is not enabled. This 
might happen if the RuntimeMBeanServer is disabled via the JMXMBean. 
Please ensure that this MBeanServer is enabled. Online WLST cannot 
function without this MBeanServer.
Exception in thread "main" Traceback (innermost last):
File "<string>", line 1, in ?
File "<iostream>", line 22, in connect
File "<iostream>", line 618, in raiseWLSTException
WLSTException: Error occured while performing connect : "Cannot connect to WLST." 
Use dumpStack() to view the full stacktrace

我可以使用相同的用户名和密码从wlst离线模式进行相同的连接,这很有效。作为一种解决方法,我还尝试将userconfig和userKey安全文件作为连接命令的参数。

注意:管理服务器已启动并正在运行。

3 个答案:

答案 0 :(得分:1)

要尝试的事情:

1 - 将CompatibilityMBeanServerEnabled设置为true,从命令行wlst执行以下步骤(用您的设置替换用户名,密码,主机名,adminport,DomainName)

connect('username','password','t3://hostname:adminport')
cd('JMX/DomainName')
ls()

现在检查“CompatibilityMBeanServerEnabled”参数的值,如果为false,则执行以下操作

edit()
startEdit()
set('CompatibilityMBeanServerEnabled', 'true')
save()
activate()
shutdown()

立即启动AdminServer,并尝试调用您的WLST嵌入式代码

2 - 如果上述修复不起作用,则在WLST Embedded代码中添加“dumpStack()”以获取堆栈跟踪,这将有助于确定根本原因。

3-要回答有关WLST嵌入模式需要哪个jar的问题,请访问其weblogic.jar

答案 1 :(得分:0)

假设您的WLS域位于/ oracle / app / oracle / gc_inst / user_projects / domains / GCDomain,以下WLST命令对我有用 WLS10.3.6 ,并允许我们启用RuntimeMBeanServer :

1)如果禁用,则启用Platform MBean Server:      1.1。从WLS管理控制台,转到GCDomain&gt;配置&gt;一般&gt;高级      1.2。选择启用Platform MBean Server ,保存更改并激活更改。      1.3。重启管理服务器。

2)为GCDomain启用env变量

cd /oracle/app/oracle/gc_inst/user_projects/domains/GCDomain/bin
source setDomainEnv.sh

3)从WLST启用RuntimeMBeanServerEnabled     java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> readDomain('/oracle/app/oracle/gc_inst/user_projects/domains/GCDomain')
wls:/offline/GCDomain>cd('JMX/NO_NAME_0')
wls:/offline/GCDomain/JMX/NO_NAME_0>set('PlatformMBeanServerUsed','true')
wls:/offline/GCDomain/JMX/NO_NAME_0>set('PlatformMBeanServerEnabled','true')
wls:/offline/GCDomain/JMX/NO_NAME_0>set('RuntimeMBeanServerEnabled', 'true')
wls:/offline/GCDomain/JMX/NO_NAME_0>updateDomain()
wls:/offline/GCDomain/JMX/NO_NAME_0>closeDomain()
wls:/offline>exit() 

希望它也适合你。

答案 2 :(得分:0)

停止节点管理器

杀死服务器的java进程

比发出一个

<块引用>

start.sh -c

清除缓存的密码并启动所有服务器。