当前位置: 代码迷 >> Java Web开发 >> axis2 错误有关问题
  详细解决方案

axis2 错误有关问题

热度:6762   发布时间:2016-04-10 23:04:12.0
axis2 异常问题
一个项目中,通过webservice方式调用远程服务器接口,异常代码段:

boolean flagXml = true;
String xmlDate = "";
while (flagXml) {
QName qname = new QName(qn, "GetReport");
Object[] result = client.invokeBlocking(qname,
new Object[] { validation, bid },
new Class[] { String.class });
if (result[0].toString().contains("Message")) {

xmlDate = result[0].toString();
break;
}
}


在一台服务器上部署客户端应用后正常,没有异常,在另一台服务器上部署后测试异常端口号占用:

Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_
Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
        at java.net.Socket.bind(Socket.java:565)
        at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.create
Socket(ReflectionSocketFactory.java:139)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.c
reateSocket(DefaultProtocolSocketFactory.java:125)
        at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java
:707)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$Http
ConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt
pMethodDirector.java:387)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
thodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:346)
        at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abst
ractHTTPSender.java:542)
        at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.jav
a:189)
        ... 12 more
org.apache.axis2.AxisFault: Unrecognized Windows Sockets error: 0: JVM_Bind
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.jav
a:193)
        at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessa
geWithCommons(CommonsHTTPTransportSender.java:371)
        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Com
monsHTTPTransportSender.java:209)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisO
peration.java:401)
        at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(Out
InAxisOperation.java:228)
        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:
163)
        at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:
548)
        at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:
528)
        at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServic
eClient.java:102)
        at com.occup.message.MessageStaThread.run(MessageStaThread.
java:91)
        at java.lang.Thread.run(Thread.java:619)


求指教!
  相关解决方案