我尝试使用 JavaSE 1.6 在 Eclipse 中编译一个 webservice 项目。
在项目中,我使用了很多从 WSDL 创建的类。
The error message is:
cannot find symbol
[javac] symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
[javac] location: class javax.xml.ws.Service
源代码(从 WSDL 编译的类:
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.4-b01
* Generated source version: 2.2
*
*/
.....
public IfaceService(WebServiceFeature... features) {
**super(__getWsdlLocation(), IFACESERVICE_QNAME, features);**
}
I read in another tread there are problems with JAX-WS version 2.1 in some cases. Therefore I tried different versions in the ivy config file.
<info organisation="de.os.osvk.ech" module="my Project"
status="integration" revision="0.1">
</info>
<dependencies>
<dependency org="com.google.inject" name="guice" rev="3.0"/>
<dependency org="com.google.inject.extensions" name="guice-servlet" rev="3.0"/>
<dependency org="org.glassfish.ha" name="ha-api" rev="3.1.8">
<artifact name="ha-api" ext="jar" type="jar"/>
<exclude org="com.sun.enterprise" module="hk2"/>
</dependency>
<dependency org="com.sun.xml.ws" name="jaxws-tools" rev="2.2.7"/>
<dependency org="javax.ws.rs" name="jsr311-api" rev="1.1.1"/>
<dependency org="com.sun.jersey" name="jersey-core" rev="1.7" />
<dependency org="javax.transaction" name="jta" rev="1.1"/>
<dependency org="javax.xml.ws" name="jaxws-api" rev="2.1.1"></dependency>
<dependency org="org.quartz-scheduler" name="quartz" rev="1.7.3" conf="*->*,!sources">
<exclude org="javax.ejb" />
<exclude org="javax.mail" />
<exclude org="javax.servlet" />
<exclude org="org.apache.openejb" />
<exclude org="junit" />
<exclude org="javax.jms" />
</dependency>
<dependency org="xalan" name="xalan" rev="2.7.1"/>
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="7.4.4.v20110707"/>
</dependencies>
</ivy-module>
javax.xml.ws or jaxax.xml.binding
我必须针对哪些版本使用 zu compile JAX-WS RI 2.2.4-b01 (Java code from WSDL)
?