java.lang.NumberFormatException:对于输入字符串:“ 7001”。在WLST中,此错误的含义是什么,我该如何解决?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.NumberFormatException:对于输入字符串:“ 7001”。在WLST中,此错误的含义是什么,我该如何解决?相关的知识,希望对你有一定的参考价值。
我正在用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 + "
"
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
有什么想法吗?谢谢。
答案
可能由adminurl = url.rstrip() + port + "
"
引起。不带 n
以上是关于java.lang.NumberFormatException:对于输入字符串:“ 7001”。在WLST中,此错误的含义是什么,我该如何解决?的主要内容,如果未能解决你的问题,请参考以下文章