Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jboss Web服务:错误:java.io.IOException:无法传输消息_Java_Web Services_Netbeans_Jboss - Fatal编程技术网

Jboss Web服务:错误:java.io.IOException:无法传输消息

Jboss Web服务:错误:java.io.IOException:无法传输消息,java,web-services,netbeans,jboss,Java,Web Services,Netbeans,Jboss,您好,我正在尝试在Jboss 4.2.3GA中部署一个web服务客户端应用程序。我已经这样做了,它在glassfish v2.x中工作。我复制了jboss-saaj.jar、jboss-jaxws-ext.jar、jboss-jaxws.jar、jboss-jaxrpc.jar和jaxb-api.jar。有人能提供一些信息吗 我还在netbeans 6.7中部署了它 # Caused by: java.io.IOException: Could not transmit message #

您好,我正在尝试在Jboss 4.2.3GA中部署一个web服务客户端应用程序。我已经这样做了,它在glassfish v2.x中工作。我复制了jboss-saaj.jar、jboss-jaxws-ext.jar、jboss-jaxws.jar、jboss-jaxrpc.jar和jaxb-api.jar。有人能提供一些信息吗

我还在netbeans 6.7中部署了它

# Caused by: java.io.IOException: Could not transmit message  
# at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:204)  
# at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)  
# at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:337)  
# at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:517)  
# ... 4 more  
# Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.  
# at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:333)  
# at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:135)  
# at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)  
# at org.jboss.remoting.Client.invoke(Client.java:1634)  
# at org.jboss.remoting.Client.invoke(Client.java:548)  
# at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:183)  
# ... 7 more  
# Caused by: org.jboss.ws.WSException: Invalid HTTP server response [404] - Not Found  
# at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:77)  
# at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:473)  
# at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:305)  
# ... 12 more  
我尝试使用4.2.2版GA,将jboss-saaj.jar和jboss-jaxrpc.jar复制到/lib/approval中,结果成功了。但我也尝试了5.1.0GA版,但在那里不起作用


为了让事情变得简单,以下是我想要帮助的。如果有人在jboss中部署了web服务,并且不得不将JAR复制到某些文件夹中,请告诉我您做了什么?我更喜欢使用4.3.3GA或5.1.0GA。感谢阅读。

我在JBoss 5.0.1上也遇到了这个问题。我已经将jbossws-*.jars复制到lib中,并且在运行junits时引用了它,它工作得很好。然而,当我在运行的JBoss中使用我的客户端时,我得到了以下信息:由:org.JBoss.ws.WSException:无效的HTTP服务器响应[404]-未找到,但我已经三次检查了我配置的服务端点是否正确,我可以在浏览器中找到它,soapUI可以点击它,我使用同一个客户端的单元测试可以调用它

经过大量研究,我发现JBoss(和JBossWS)在JBossWS 3.0.x版本中可能有一些bug(可能还有其他)。这可能是由于使用的JAX-WS版本和调用的服务器的组合造成的。在我的例子中,服务器不支持分块的HTTP请求,JBoss WS在处理这些请求时有一些错误。以下是我需要在实际请求之前添加的代码:

    // HACK: This is a hack for disabling chunked encoding. .NET server run by service host does nto seem to support chunked encoding. 
    //Jboss WS version 3.0.5 has multiple bugs disallowing the setting of either a new client type or disabling chunking. 
    //So, we are resporting to this hack here.
    // This essentially sets the chunck size to 0 forcing the Webservice client to not chunk requests and not expect responses to be chunked (effectively HTTP 1.0 mode)

    //      ((StubExt) port).setConfigName("HTTP 1.0 Client"); // does not work in Jboss WS 3.0.5

    EndpointMetaData endpointMetaData = ((StubExt) serviceEndPoint).getEndpointMetaData();
    CommonConfig commonConfig = endpointMetaData.getConfig();
    boolean hacked = false;
    try {
        if (commonConfig.getProperties() != null){
            Iterator<EndpointProperty> iter = commonConfig.getProperties().iterator();
            while (iter.hasNext()){
                EndpointProperty p = iter.next();
                if (p.name.equals(new URI(EndpointProperty.CHUNKED_ENCODING_SIZE))){
                    p.value = "0";
                    hacked = true;
                    log.info("Chunking set to 0 since service host does not support chunked requests");
                }

            }
        }
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }

    if (!hacked)commonConfig.addProperty(EndpointProperty.CHUNKED_ENCODING_SIZE, "0");
    // END HACK
//HACK:这是一种用于禁用分块编码的HACK。服务主机运行的NET服务器似乎不支持分块编码。
//Jboss WS版本3.0.5存在多个错误,不允许设置新的客户端类型或禁用分块。
//所以,我们在这里回应这个黑客。
//这实际上是将chunck大小设置为0,强制Webservice客户端不分块请求,也不期望响应分块(实际上是HTTP 1.0模式)
//((StubExt)端口).setConfigName(“HTTP 1.0客户端”);//在Jboss WS 3.0.5中不起作用
EndpointMetaData EndpointMetaData=((StubExt)serviceEndPoint).getEndpointMetaData();
CommonConfig CommonConfig=endpointMetaData.getConfig();
布尔hacked=false;
试一试{
if(commonConfig.getProperties()!=null){
迭代器iter=commonConfig.getProperties().Iterator();
while(iter.hasNext()){
EndpointProperty p=iter.next();
if(p.name.equals(新URI(EndpointProperty.CHUNKED_ENCODING_SIZE))){
p、 value=“0”;
hacked=true;
log.info(“分块设置为0,因为服务主机不支持分块请求”);
}
}
}
}捕获(URISyntaxException e){
e、 printStackTrace();
}
如果(!hacked)commonConfig.addProperty(EndpointProperty.CHUNKED_ENCODING_SIZE,“0”);
//结束攻击

我在JBoss 5.0.1上也遇到了这个问题。我已经将jbossws-*.jars复制到lib中,并且在运行junits时引用了它,它工作得很好。然而,当我在运行的JBoss中使用我的客户端时,我得到了以下信息:由:org.JBoss.ws.WSException:无效的HTTP服务器响应[404]-未找到,但我已经三次检查了我配置的服务端点是否正确,我可以在浏览器中找到它,soapUI可以点击它,我使用同一个客户端的单元测试可以调用它

经过大量研究,我发现JBoss(和JBossWS)在JBossWS 3.0.x版本中可能有一些bug(可能还有其他)。这可能是由于使用的JAX-WS版本和调用的服务器的组合造成的。在我的例子中,服务器不支持分块的HTTP请求,JBoss WS在处理这些请求时有一些错误。以下是我需要在实际请求之前添加的代码:

    // HACK: This is a hack for disabling chunked encoding. .NET server run by service host does nto seem to support chunked encoding. 
    //Jboss WS version 3.0.5 has multiple bugs disallowing the setting of either a new client type or disabling chunking. 
    //So, we are resporting to this hack here.
    // This essentially sets the chunck size to 0 forcing the Webservice client to not chunk requests and not expect responses to be chunked (effectively HTTP 1.0 mode)

    //      ((StubExt) port).setConfigName("HTTP 1.0 Client"); // does not work in Jboss WS 3.0.5

    EndpointMetaData endpointMetaData = ((StubExt) serviceEndPoint).getEndpointMetaData();
    CommonConfig commonConfig = endpointMetaData.getConfig();
    boolean hacked = false;
    try {
        if (commonConfig.getProperties() != null){
            Iterator<EndpointProperty> iter = commonConfig.getProperties().iterator();
            while (iter.hasNext()){
                EndpointProperty p = iter.next();
                if (p.name.equals(new URI(EndpointProperty.CHUNKED_ENCODING_SIZE))){
                    p.value = "0";
                    hacked = true;
                    log.info("Chunking set to 0 since service host does not support chunked requests");
                }

            }
        }
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }

    if (!hacked)commonConfig.addProperty(EndpointProperty.CHUNKED_ENCODING_SIZE, "0");
    // END HACK
//HACK:这是一种用于禁用分块编码的HACK。服务主机运行的NET服务器似乎不支持分块编码。
//Jboss WS版本3.0.5存在多个错误,不允许设置新的客户端类型或禁用分块。
//所以,我们在这里回应这个黑客。
//这实际上是将chunck大小设置为0,强制Webservice客户端不分块请求,也不期望响应分块(实际上是HTTP 1.0模式)
//((StubExt)端口).setConfigName(“HTTP 1.0客户端”);//在Jboss WS 3.0.5中不起作用
EndpointMetaData EndpointMetaData=((StubExt)serviceEndPoint).getEndpointMetaData();
CommonConfig CommonConfig=endpointMetaData.getConfig();
布尔hacked=false;
试一试{
if(commonConfig.getProperties()!=null){
迭代器iter=commonConfig.getProperties().Iterator();
while(iter.hasNext()){
EndpointProperty p=iter.next();
if(p.name.equals(新URI(EndpointProperty.CHUNKED_ENCODING_SIZE))){
p、 value=“0”;
hacked=true;
log.info(“分块设置为0,因为服务主机不支持分块请求”);
}
}
}
}捕获(URISyntaxException e){
e、 printStackTrace();
}
如果(!hacked)commonConfig.addProperty(EndpointProperty.CHUNKED_ENCODING_SIZE,“0”);
//结束攻击

您还可以在以下位置为您的实例配置chunksize

SERVER_HOME/SERVER_PROFILE/deployers/jbossws.deployer/META-INF/standard-jaxws-client-config.xml

改变

<property-value>2048</property-value>
2048

0
为了财产

    <client-config>
        <config-name>Standard Client</config-name>
        <feature>http://org.jboss.ws/dispatch/validate</feature>
        <property>
           <property-name>http://org.jboss.ws/http#chunksize</property-name>
        </property>
    </client-config>

标准客户端
http://org.jboss.ws/dispatch/validate
http://org.jboss.ws/http#chunksize
有关更多详细信息,请参阅。

您也可以