java.lang.NumberFormatException:对于输入字符串:“ 7001”。在WLST中,此错误的含义是什么,我该如何解决?

问题描述 投票:0回答:1

我正在用Python / WLST编写代码以自动化连接,启动和停止Weblogic中的托管服务器。启动python时出现以下错误。我问您异常的含义以及如何解决。任何帮助都感激不尽!

这里是错误:

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

172.31.138.15:7001

Connecting to t3://172.31.138.15:7001
 with userid weblogic ...

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.
This Exception occurred at Mon Jan 13 08:52:50 CET 2020.
java.lang.NumberFormatException: For input string: "7001
"

The domain is unreacheable

代码是:

-bash

#! /bin/sh

echo $(find /u01/ -name config.xml |grep -v bak| xargs grep -A4 AdminServer | grep listen-address | cut -d'>' -f 2 | cut -d'<' -f 1)

-Python / WLST

import sys
import os
from java.lang import System
import getopt
import time

values = os.popen(str('sh /home/oracle/scripts/wls/adminurl.sh'))
url = str("".join(map(str, values)))
port = ":7001"

adminurl = url.rstrip() + port + "\n"

def connectToDomain():
    try:
        if ServerName != "" or username == "" and password == "" and adminUrl == "":
            print (adminurl)
            connect(userConfigFile='/home/oracle/scripts/wls/userconfig.secure', userKeyFile='/home/oracle/scripts/wls/userkey.secure', url=adminurl, timeout=60000)

[...]

此外,在Adminserver控制台中启用了RuntimeMBeanServer

Adminserver console, MBean

有什么想法吗?谢谢。

java python bash weblogic wlst
1个回答
0
投票

可能由adminurl = url.rstrip() + port + "\n"引起。不带\ n

尝试
© www.soinside.com 2019 - 2024. All rights reserved.