为什么我无法在Web服务的“Hello world”示例中生成客户端代码?

时间:2009-01-12 13:55:53

标签: java web-services

链接是:http://people.apache.org/~ruchithf/hw-axis2/

命令行是:javac -extdirs d:\lib\ D:\stub\src\org\apache\ws\axis2\*.java -d d:\clientcode\

错误是:

C:\Program
Files\Java\jdk1.6.0\bin>javac -extdirs
d:\lib\ D:\stub\src\org\apache
\ws\axis2\*.java -d d:\clientcode\
D:\stub\src\org\apache\ws\axis2\Client.java:3:
cannot find symbol symbol  : class
EchoRequest location: class
org.apache.ws.axis2.SimpleServiceStub
import
org.apache.ws.axis2.SimpleServiceStub.EchoRequest;
                                            ^
D:\stub\src\org\apache\ws\axis2\Client.java:12:
cannot find symbol symbol  : class
EchoRequest location: class
org.apache.ws.axis2.Client EchoRequest
request = new
SimpleServiceStub.EchoRequest(); ^
D:\stub\src\org\apache\ws\axis2\Client.java:12:
cannot find symbol symbol  : class
EchoRequest location: class
org.apache.ws.axis2.SimpleServiceStub
EchoRequest request = new
SimpleServiceStub.EchoRequest();
                                           ^ Note:
D:\stub\src\org\apache\ws\axis2\SimpleServiceStub.java
uses unchecked or u nsafe operations.
Note: Recompile with -Xlint:unchecked
for details. 3 errors C:\Program
Files\Java\jdk1.6.0\bin>javac -extdirs
d:\lib\ D:\stub\src\org\apache
\ws\axis2\*.java -d d:\clientcode\
D:\stub\src\org\apache\ws\axis2\Client.java:3:
cannot find symbol symbol  : class
EchoRequest location: class
org.apache.ws.axis2.SimpleServiceStub
import
org.apache.ws.axis2.SimpleServiceStub.EchoRequest;
                                            ^
D:\stub\src\org\apache\ws\axis2\Client.java:12:
cannot find symbol symbol  : class
EchoRequest location: class
org.apache.ws.axis2.Client EchoRequest
request = new
SimpleServiceStub.EchoRequest(); ^
D:\stub\src\org\apache\ws\axis2\Client.java:12:
cannot find symbol symbol  : class
EchoRequest location: class
org.apache.ws.axis2.SimpleServiceStub
EchoRequest request = new
SimpleServiceStub.EchoRequest();
                                           ^ Note:
D:\stub\src\org\apache\ws\axis2\SimpleServiceStub.java
uses unchecked or u nsafe operations.
Note: Recompile with -Xlint:unchecked
for details. 3 errors

2 个答案:

答案 0 :(得分:0)

检查Axis库是否真的在D:\ stub \ src \ org \ apache \ ws \

...并尝试使用双反斜杠:D:\\ stub \\ src \\ org \\ apache \\ ws和d:\\ lib

由于我使用Linux,我无法重新创建您的问题,我记得Windows用户有时会遇到反斜杠问题。

答案 1 :(得分:0)

IIRC,轴存根生成器是旧的,并生成1.5之前(甚至可能是1.4之前的)java源代码。尝试设置源标志,看看会发生什么。