java.lang.Exception: XML文档格式不正确:prolog 中不允许有内容

在进行xml开发的过程中,调用对方webservice,接口是参数接收xml字符串,出现错误如下

java.lang.Exception: XML文档格式不正确:prolog 中不允许有内容

 

发现是要求的xml格式串,但是给传的是一个非xml内容导致的。

 

错误的意思是在xml的前置声明中出现不应该出现的内容。 其实我这个场景是根本没有xml前置的头信息。

SLF4J(W): No SLF4J providers were found. SLF4J(W): Defaulting to no-operation (NOP) logger implementation SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details. [Fatal Error] :1:3: 文档中根元素前面的标记必须格式正确。 [Fatal Error] :1:3: 文档中根元素前面的标记必须格式正确。 屏幕截图已保存: F:\auto_project\AutoTest\.\screenshots\20250708\test_20250708-135604642.png Test ignored. io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 3; 文档中根元素前面的标记必须格式正确。 at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1421) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1190) at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1437) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1415) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1190) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427) at org.example.utils.WebDriverSetup.initializeDriver(WebDriverSetup.java:34) at org.example.utils.WebDriverSetup.getDriver(WebDriverSetup.java:26) at tests.TestDemo.setUp(TestDemo.java:21) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)什么意思
07-09
第十步,[root@master conf]# schematool -initSchema -dbType mysql -verbose SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/server/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/server/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Exception in thread "main" java.lang.RuntimeException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'n' (code 110) in prolog; expected '<' at [row,col,system-id]: [2,1,"file:/export/server/hive/conf/hive-site.xml"] at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3024) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2973) at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2848) at org.apache.hadoop.conf.Configuration.get(Configuration.java:1460) at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:4996) at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:5069) at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5156) at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5104) at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:96) at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1473) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:318) at org.apache.hadoop.util.RunJar.main(RunJar.java:232) Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'n' (code 110) in prolog; expected '<' at [row,col,system-id]: [2,1,"file:/export/server/hive/conf/hive-site.xml"] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:653) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2133) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1181) at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3320) at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3114) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3007) ... 15 more [root@master conf]# nohup /export/server/hive/bin/hive --service metastore > /export/server/hive/logs/metastore.log 2>&1 & [1] 33597 [root@master conf]# bash: /export/server/hive/logs/metastore.log: 没有那个文件或目录 tore > /export/server/hive/logs/metastore.log 2>&1 & [2] 33867 bash: /export/server/hive/logs/metastore.log: 没有那个文件或目录 [1] 退出 1 nohup /export/server/hive/bin/hive --service metastore > /export/server/hive/logs/metastore.log 2>&1 [root@master conf]#
最新发布
10-24
[root@master mysql]# cd /home/ma/ [root@master ma]# cp mysql-connector-java-5.1.32.jar /export/server/hive/lib/ cp: 无法获取"mysql-connector-java-5.1.32.jar" 的文件状态(stat): 没有那个文件或目录 [root@master ma]# cd /export/server/hive [root@master hive]# bin/schematool -initSchema -dbType mysql -verbose SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/server/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/server/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Exception in thread "main" java.lang.RuntimeException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'n' (code 110) in prolog; expected '<' at [row,col,system-id]: [2,1,"file:/export/server/hive/conf/hive-site.xml"] at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3024) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2973) at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2848) at org.apache.hadoop.conf.Configuration.get(Configuration.java:1460) at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:4996) at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:5069) at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5156) at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5104) at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:96) at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1473) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:318) at org.apache.hadoop.util.RunJar.main(RunJar.java:232) Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'n' (code 110) in prolog; expected '<' at [row,col,system-id]: [2,1,"file:/export/server/hive/conf/hive-site.xml"] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:653) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2133) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1181) at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3320) at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3114) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3007) ... 15 more [root@master hive]# # 启动 metastore(后台) [root@master hive]# nohup /export/server/hive/bin/hive --service metastore > /tmp/metastore.log 2>&1 & [1] 78700 [root@master hive]# [root@master hive]# # 等待几秒后启动 hiveserver2 [root@master hive]# nohup /export/server/hive/bin/hive --service hiveserver2 > /tmp/hiveserver2.log 2>&1 & [2] 78701 [root@master hive]# netstat -tulnp | grep java bash: netstat: 未找到命令 [1]- 退出 1 nohup /export/server/hive/bin/hive --service metastore > /tmp/metastore.log 2>&1 [2]+ 退出 1 nohup /export/server/hive/bin/hive --service hiveserver2 > /tmp/hiveserver2.log 2>&1 [root@master hive]# # 应看到 9083 (metastore) 和 10000 (hiveserver2) [root@master hive]# [root@master hive]# netstat -tulnp | grep java bash: netstat: 未找到命令 [root@master hive]# # 应看到 9083 (metastore) 和 10000 (hiveserver2) [root@master hive]# /export/server/hive/bin/hive SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/server/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/server/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/export/server/jdk/bin:/export/server/hadoop/bin:/export/server/hadoop/sbin:/export/server/jdk/bin:/export/server/hadoop/bin:/export/server/hadoop/sbin:/home/ma/.local/bin:/home/ma/bin:/export/server/jdk/bin:/export/server/hadoop/bin:/export/server/hadoop/sbin:/export/server/jdk/bin:/export/server/hadoop/bin:/export/server/hadoop/sbin:/export/server/hive/bin:/export/server/jdk/bin:/export/server/hadoop/bin:/export/server/hadoop/sbin:/export/server/hive/bin) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/server/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/server/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Exception in thread "main" java.lang.RuntimeException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'n' (code 110) in prolog; expected '<' at [row,col,system-id]: [2,1,"file:/export/server/hive/conf/hive-site.xml"] at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3024) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2973) at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2848) at org.apache.hadoop.conf.Configuration.get(Configuration.java:1460) at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:4996) at org.apache.hadoop.hive.conf.HiveConf.getVar(HiveConf.java:5069) at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5156) at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5099) at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:97) at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:81) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:699) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:318) at org.apache.hadoop.util.RunJar.main(RunJar.java:232) Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'n' (code 110) in prolog; expected '<' at [row,col,system-id]: [2,1,"file:/export/server/hive/conf/hive-site.xml"] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:653) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2133) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1181) at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3320) at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3114) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3007) ... 17 more [root@master hive]# SHOW DATABASES; bash: SHOW: 未找到命令 [root@master hive]# CREATE DATABASE test_hive; bash: CREATE: 未找到命令 [root@master hive]# USE test_hive; bash: USE: 未找到命令 [root@master hive]# CREATE TABLE people (id INT, name STRING); bash: 未预期的符号 `(' 附近有语法错误 [root@master hive]# SHOW TABLES; bash: SHOW: 未找到命令 [root@master hive]#
10-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值