首页 > 其他分享 >Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between p

Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between p

时间:2023-06-06 13:22:04浏览次数:30  
标签:BasicStreamReader code java space system cxf apache org com

1)错误信息

Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:90)
    at javax.xml.ws.Service.<init>(Service.java:67)
    at javax.xml.ws.Service.create(Service.java:691)
    at com.bull.eris.cmn.ds.DSIFPortType_DSIFPort_Client.signPDF(DSIFPortType_DSIFPort_Client.java:60)
    ... 17 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
    at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
    at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
    ... 21 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
 at javax.xml.stream.SerializableLocation@66b866b8
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
    ... 23 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
 at javax.xml.stream.SerializableLocation@66b866b8
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:612)
    at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2444)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2360)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2020)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1106)
    at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1042)
    at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:939)
    at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:866)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)
    ... 25 more

 

2) 原因是 访问?wsdl 地址时返回了500错误信息

此时的response body 是这样的:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN">
<HTML>
<HEAD>
<TITLE>Error 500--Internal Server Error</TITLE>
</HEAD>
<BODY bgcolor="white">
<FONT FACE=Helvetica><BR CLEAR=all>
<TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all>
<FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 500--Internal Server Error</H2>
</FONT></TD></TR>
</TABLE>
<TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3>
</FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.5.1 500 Internal Server Error</H4>
</FONT><P><FONT FACE="Courier New">The server encountered an unexpected condition which prevented it from fulfilling the request.</FONT></P>
</FONT></TD></TR>
</TABLE>

</BODY>
</HTML>

这块说明是在检查 DOCTYPE 的时候,需要时这种格式

PUBLIC SYSTEM

也就是说:PUBLIC 和 SYSTEM 之间只能是空格,不能是别的双引号之类

这块校验就是上面说的必须出席

结论就是:

访问?wsdl 时返回了错误的xml文档,代码中需要校验返回的文档。(浏览器打开时很明显文档返回错误,接下来只需要查查为啥不能提供服务)

 

标签:BasicStreamReader,code,java,space,system,cxf,apache,org,com
From: https://www.cnblogs.com/zno2/p/6555078.html

相关文章

  • org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)
    DescriptionResourcePathLocationTypeorg.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)pom.xml/gs-rest-serviceline1MavenConfigurationProblem在学习springboot实例时,发现了这个Maven配置错误,但是不影响springboot运行。问题......
  • VsCode配置Wdk7600开发环境 以及 "自动编译" 和 sources文件简单介绍..
    目录VsCode配置Wdk7600开发环境以及"自动编译"和sources文件简单介绍..一丶简介1.2软件安装1.3开发环境配置步骤1.4集成终端编译1.4.1集成任务1.4.2设置为全局任务.二丶Sources文件编程2.1INCLUDES字段2.2i386_SOURCES32位驱动使用内联汇编2.3AMD64_SOURCES使用......
  • 关于环境配置的步骤:VS+VS Code 网页项目
    1、下载nvm安装包并且安装//网址:https://github.com/coreybutler/nvm-windows/releases//下载的对象:nvm-setup.zip//下载完后解压,双击nvm-setup.exe,根据向导指引安装。//命令行验证:nvm-v//安装成功将显示Runningversionx.x.x(版本号)2、VSCode配置//打开......
  • Visual Studio Code mac好用的微软免费代码编辑器
    VisualStudioCode是微软官方的编码工具,被称为"代码编辑器",支持众多的编程语言,包括C、C++、Python等。但是它仅支持文本编辑功能,所以一般使用它来完成一些简单的编程。但VisualStudioCode的功能并不只限于文本编辑,它还提供了很多其他功能。VisualStudioCode易于使用,它易......
  • Windows之Visual Studio Code添加右键菜单
    背景通常如果直接从官网下载VisualStudioCode安装包,我们只需要在安装界面勾选那两个复选框就行了,它会安装后帮我们自动添加右键支持,但是,如果我们使用全新的Winget手段安装,因为是静默的,所以没有机会做这个勾选,那么我们只能手动给VisualStudioCode添加右键菜单支持了,让我们通过......
  • [LeetCode] 1347. Minimum Number of Steps to Make Two Strings Anagram 制造字母异
    Youaregiventwostringsofthesamelength s and t.Inonestepyoucanchoose anycharacter of t andreplaceitwith anothercharacter.Return theminimumnumberofsteps tomake t ananagramof s.An Anagram ofastringisastringthatco......
  • SystemVerilog for Design Edition 2 Chapter 7
    SystemVerilogforDesignEdition2Chapter7SystemVerilogaddsseveralnewoperatorsandproceduralstatementstotheVeriloglanguagethatallowmodelingmoreconcisesynthesizableRTLcode.Additionalenhancementsconveythedesigner’sintent,helping......
  • leetcode-图论总结
    此文总结一下常见图论算法,代码可以为后续遇见类似题目提供参考:1.图的表示:邻接矩阵:可通过创建数组得到邻接表:我个人喜欢通过LinkedList<int[]>[]graph=newLinkedList[n];得到。EdgeList:同样可以通过LinkedList<int[]>[]graph=newLinkedList[n];得到。2.图遍历:DF......
  • vscode技巧----屏蔽python类型错误提示
    有一段python代码如下:fromwin32com.shellimportshellfromwin32com.shellimportshellcon结果出现类型错误的提示:在网上搜了一些方法都没有解决,而实际运行代码时,又不会出错,所以干脆就把这个告警提示屏蔽掉即可,如下所示:fromwin32com.shellimportshell......
  • 如何让VSCode格式化代码时运算符两边不要添加空格
    很多格式化软件都是默认运算符两边加空格的,没给奇葩的人留一点选择的余地,经过自己的一番摸索终于找到了VSCode格式化代码时运算符两边不要添加空格的方法。之前在一个帖子上看到的,VSCode中针对C语言的代码格式化配置_vscode格式化c代码_booksyhay的博客-CSDN博客:https://blog.csdn......