昨夜加班,终于可以把星期天遇到的异常来上网找找原因:
搞我们这行,没有网络真是不行啊!下面让我们来看看:
D:/Tomcat 6.0/webapps/axis/WEB-INF>java -cp %AXISCLASSPATH% org.apache.axis.c
nt.AdminClient deploy.wsdd
Processing file deploy.wsdd
Exception: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection refused: connect
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Co
ction refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(Default
ketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(Default
ketFactory.java:120)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.jav
91)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender
va:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:1
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStra
y.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:1792)
at org.apache.axis.client.AdminClient.process(AdminClient.java:439)
at org.apache.axis.client.AdminClient.process(AdminClient.java:404)
at org.apache.axis.client.AdminClient.process(AdminClient.java:410)
at org.apache.axis.client.AdminClient.process(AdminClient.java:320)
at org.apache.axis.client.AdminClient.main(AdminClient.java:463)
{http://xml.apache.org/axis/}hostname:jsjshentingting
其中deploy.wsdd:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="HelloWorld" provider="java:RPC">
<parameter name="className" value="HelloWorld"/>
<parameter name="allowedMethods" value="sayHello"/>
</service>
</deployment>
解决方法:加上-l参数
D:/Tomcat 6.0/webapps/axis/WEB-INF>java -cp %AXISCLASSPATH% org.apache.axis.clie
nt.AdminClient -l http://localhost:80/axis/services/HelloWorld deploy.wsdd
Processing file deploy.wsdd
<Admin>Done processing</Admin>
在WEB-INF目录下生成了server-config.wsdd文件:
在IE地址栏输入:
http://localhost/axis/servlet/AxisServlet
显示结果为:
说明注释:
80: tomcat服务器的端口号,你可以根据你电脑上的具体设置修改该端口号。
http://localhost:80/axis/services:默认的路径
HelloWorld:你部署文件的路径和名字,见你写的句子<service name="HelloWorld" provider="java:RPC">。