Wildfly 13.0.0。最终错误UT005014:无法解析请求:io.undertow.util.BadRequestException:UT000165:请求目标

时间:2018-07-13 14:46:00

标签: unicode character-encoding internationalization wildfly

我们最近从Linux环境中的GlassFish 3迁移并在wildfly 13.0.0.Final中部署了application.EAR(API)软件包。在测试应用程序api时,它不支持scandic字符并给出以下错误(从wildfly从server.log复制的错误)。但是,相同的测试请求也可以与GlassFish服务器中部署的应用程序api正常工作。我尝试研究了许多与Wildfly有关的博客,但没有任何解决方案。请问有人可以帮忙。

我对在standalone.xml文件中设置更改以将字符集设置为UTF-8感到厌烦,但并没有帮助。

<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" url-charset="UTF-8"/>

<servlet-container name="default" default-encoding="UTF-8">

2018-07-13 17:06:45,189调试[io.undertow.request.io](默认I / O-4)UT005014:无法解析请求:io.undertow.util.BadRequestException:UT000165 :请求目标中的字符ä无效         在io.undertow.server.protocol.http.HttpRequestParser.handleQueryParameters(HttpRequestParser.java:523)         在io.undertow.server.protocol.http.HttpRequestParser.beginQueryParameters(HttpRequestParser.java:486)         在io.undertow.server.protocol.http.HttpRequestParser.handlePath(HttpRequestParser.java:410)         在io.undertow.server.protocol.http.HttpRequestParser.handle(HttpRequestParser.java:248)         在io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:187)         在io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)         在io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:147)         在io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:93)         在io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:52)         在org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)         在org.xnio.ChannelListeners $ 10.handleEvent(ChannelListeners.java:291)         在org.xnio.ChannelListeners $ 10.handleEvent(ChannelListeners.java:286)         在org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)         在org.xnio.nio.QueuedNioTcpServer $ 1.run(QueuedNioTcpServer.java:131)         在org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612)         在org.xnio.nio.WorkerThread.run(WorkerThread.java:479)

下面是我们发送给在Wildfly和GlassFish中部署的应用程序的请求XML

<SOAP-ENV:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
        <StartHeader SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0" xmlns="http://www.openuri.org/2002/04/soap/conversation/">
            <callbackLocation>http://TESTUI</callbackLocation>
        </StartHeader>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ListAttributeValues xmlns="http://www.openuri.org/" xmlns:v001="http://xml.comptel.com/NIMS/address/listAttribteValuesRequest/v002" xmlns:v0011="http://xml.comptel.com/NIMS/address/v002">
            <listAttributeValuesRequest xsi:schemaLocation="http://xml.comptel.com/NIMS/address/listAttributeValuesRequest/v002 http://xml.comptel.com/NIMS/address/listAttributeValuesRequest/v002" xmlns="http://xml.comptel.com/NIMS/address/listAttributeValuesRequest/v002" xmlns:spec="http://xml.comptel.com/NIMS/address/v002" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <spec:searchItemList>
                    <spec:attribute>
                        <spec:name>district</spec:name>
                        <spec:value>Jär</spec:value>
                    </spec:attribute>
                </spec:searchItemList>
                <spec:attributeName>district</spec:attributeName>
                <spec:maxItems>100</spec:maxItems>
            </listAttributeValuesRequest>
        </ListAttributeValues>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

1 个答案:

答案 0 :(得分:0)

最后,我在JBossDevelopers社区的帮助下设法解决了问题

我认为不是SOAP消息的内容是问题,而是用于触摸Web服务的URI。可以使用以下任一选项解决问题。对于引入了undertow子系统的最新wildfly版本,建议使用选项2。

  1. 通过在启动脚本中添加以下Java选项:

-Dorg.wildfly.undertow.ALLOW_UNESCAPED_CHARACTERS_IN_URL = true

  1. ,或者我们可以在standalone.xml的undertow子系统中设置 allow-unescaped-characters-in-url =“ true”和url-charset =“ windows-1252” 标志文件。

我认为这些选项是作为undertow:6.0模式的一部分添加的,它们是https-listener和http-listener元素的属性。

查看此处:

wildfly/wildfly-undertow_6_0.xsd,掌握者·wildfly / wildfly·GitHub

示例配置:

wildfly/undertow-6.0.xml,在master·wildfly / wildfly·GitHub