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)
[解决办法]
检查那台端口被占用的服务器啊
[解决办法]
有些工具或者命令 查看端口的情况,网上搜搜看看。
[解决办法]
端口被占用了 用netstat -ano查看下
[解决办法]
查看下weblogic默认的端口号7001,7011或进weblogic配置文件中查看具体端口号,看新的服务器上端口号有没有被占用。