Jboss Web 服务:错误:java.io.IOException:无法传输消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2014319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jboss Web Service:Error :java.io.IOException: Could not transmit message
提问by Tesnep
Hi I am trying to deploy a web service client application in Jboss 4.2.3GA. I already did this and it works in glassfish v2.x. I copied jboss-saaj.jar, jboss-jaxws-ext.jar, jboss-jaxws.jar, jboss-jaxrpc.jar and jaxb-api.jar. Can someone please shed some info?
您好,我正在尝试在 Jboss 4.2.3GA 中部署 Web 服务客户端应用程序。我已经这样做了,它适用于 glassfish v2.x。我复制了 jboss-saaj.jar、jboss-jaxws-ext.jar、jboss-jaxws.jar、jboss-jaxrpc.jar 和 jaxb-api.jar。有人可以透露一些信息吗?
Also I deployed this in netbeans 6.7.
我也在 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
I tried with version 4.2.2 GA by copying jboss-saaj.jar and jboss-jaxrpc.jar to /lib/endorsement and it works. But I also tried with version 5.1.0GA and it didn't work there.
我通过将 jboss-saaj.jar 和 jboss-jaxrpc.jar 复制到 /lib/endorsement 来尝试使用 4.2.2 GA 版,并且它工作正常。但我也尝试过 5.1.0GA 版本,但在那里不起作用。
To make things easy, here is what I would like help in. If anyone has deployed web services in jboss and had to copy jars to certain folders can you please let me know what you did? I would prefer if you used 4.3.3GA or 5.1.0GA. Thanks for reading.
为了让事情变得简单,这里是我想要帮助的地方。如果有人在 jboss 中部署了 Web 服务并且不得不将 jars 复制到某些文件夹,请告诉我你做了什么?如果您使用 4.3.3GA 或 5.1.0GA,我会更喜欢。谢谢阅读。
回答by chinto
You can also configure the chunksizefor your instance at
您还可以配置CHUNKSIZE为您的实例在
SERVER_HOME/SERVER_PROFILE/deployers/jbossws.deployer/META-INF/standard-jaxws-client-config.xml
SERVER_HOME/SERVER_PROFILE/deployers/jbossws.deployer/META-INF/standard-jaxws-client-config.xml
Change
改变
<property-value>2048</property-value>
to
到
<property-value>0</property-value>
for property
财产
<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>
See http://community.jboss.org/wiki/Workaroundwhenchunkedencodingisnotsupportedfor more details.
有关更多详细信息,请参阅http://community.jboss.org/wiki/Workaroundwhenchunkedencodingisnotsupported。
回答by Ben Developer
I'm also having this problem on JBoss 5.0.1. I have copied jbossws-*.jars into lib endorsed also and I reference this when I run junits and it works fine. However when I use my client from within a running JBoss AS I get this : Caused by: org.jboss.ws.WSException: Invalid HTTP server response [404] - Not Found But I've triple checked that the service endpoint I have configured is correct, I can go to it in a browser, soapUI can hit it, and my unit test using same client can call it.
我在 JBoss 5.0.1 上也遇到了这个问题。我已经将 jbossws-*.jars 复制到 lib 背书中,我在运行 junits 时引用了它,它工作正常。但是,当我从正在运行的 JBoss AS 中使用我的客户端时,我得到了这个: 原因: org.jboss.ws.WSException: Invalid HTTP server response [404] - Not Found 但我已经三重检查了我配置的服务端点是正确的,我可以在浏览器中访问它,soapUI 可以点击它,我使用相同客户端的单元测试可以调用它。
AFter much research I found that JBoss (and JBossWS) may have some bugs in the JBossWS 3.0.x versions (maybe others). This may be caused by a combination of your JAX-WS version being used and the server your calling. In my case the server did not support chunked HTTP requests and JBoss WS had some bugs with dealing with that. Here is the code I needed to add before the actual request:
经过大量研究,我发现 JBoss(和 JBossWS)可能在 JBossWS 3.0.x 版本(可能是其他版本)中存在一些错误。这可能是由您正在使用的 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

