我在运行ServerMain的main方法发布WebService的时候,出现异常信息:
Exception in thread "main" java.lang.NoClassDefFoundError:javax/xml/ws/WebServiceFeature
at org.apache.cxf.jaxws.spi.ProviderImpl.createEndpoint(ProviderImpl.java:121)
at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:143)
at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
at test.ServerMain.main(ServerMain.java:13)
请问是什么问题,找了好久没找出来,而且换来好几个版本的CXF都提示这样我的JDK是1.5的。
package com.jg.cxf.ws;
import javax.jws.WebService;
@WebService
public interface HelloWorld {
String SyHello(String name);
}
package com.jg.cxf.ws.impl;
import java.util.Date;
import javax.jws.WebService;
import com.jg.cxf.ws.HelloWorld;
@WebService(endpointInterface="com.jg.cxf.ws.HelloWorld",serviceName="hwws")
public class HelloWorldWs implements HelloWorld {
public String SyHello(String name) {
return name+"你好,当前时间:"+new Date();
}
}
package test;
import javax.xml.ws.Endpoint;
import com.jg.cxf.ws.HelloWorld;
import com.jg.cxf.ws.impl.HelloWorldWs;
public class ServerMain {
public static void main(String[] args) {
HelloWorld hw = new HelloWorldWs();
//调用Endpoint的publish方法发布Webservice
Endpoint.publish("http://172.16.9.216/hw", hw);
}
}
相关推荐
CXF restful的许多异常java.lang.NoClassDefFoundError: javax/ws/rs/MessageProcessingException.需要javax.ws.rs-api-2.0-m10.jar
webservice CXF 报错:java.lang.NoClassDefFoundError: org/apache/neethi/builders/AssertionBuilder 需要用到此jar文件 通过apache官网可获得。 文件位置\apache-cxf-2.7.13\lib
NULL 博文链接:https://hw1287789687.iteye.com/blog/2034439
http://cxf.apache.org/docs/ws-security.html http://resource.ajava.org/java/jdk-6.0-api-zh/javax/security/auth/callback/CallbackHandler.html 2)CXFWS工程是基于WS-Security规范,实现X.509身份验证的,...
<import resource="classpath:META-INF/cxf/cxf.xml"/> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> ...
CXF和Spring整合时,配置文件中所需要的CXF标签的 schema 文件,将所需的xsd文件配置到本地,可以解决部分IDE在编写配置文件时,无法自动提示的问题。
CXF是一个很好用的web service框架,但是部署在WebSphere上容易出现问题,这是收集到的解决这些问题的方法。
s.addLocation(StaxUtils.java:1038) at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java:893) at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:965) at org.apache.cxf....
Struts2升级到2.5.30,问题解决及过程记录, 文章详见:https://blog.csdn.net/sinat_36743893/article/details/124582101
3.0.16版本所需jar包! 测试代码: public static void main(String[] args) throws Exception { JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); //第三方系统的webservice ...
cxf与spring集成 需要最少的jar如下: cxf-2.3.3.jar geronimo-annotation_1.0_spec-1.1.1.jar geronimo-jaxws_2.2_spec-1.0.jar geronimo-stax-api_1.0_spec-1.0.1.jar geronimo-ws-metadata_2.0_spec-1.1.3.jar ...
一个CXF webservice 实例,兼容tomcat和weblogic; 已解决了报错:javax.xml.ws.soap.SOAPFaultException: Cannot create a secure XMLInputFactory
在使用Idea根据wsdl自动生成java code的时候;抛出无法找到主类:org.apache.axis.wsdl.WSDL2Java(Throws Could not find main class: org.apache.axis.wsdl.WSDL2Java)。 添加本文的jar包压缩包解压出来的所有jar包...
NULL 博文链接:https://913.iteye.com/blog/1465593
<import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <!-- DAO -->...
标签:cxf、core、apache、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,文档中的代码和结构保持不变,注释和说明精准翻译,请...
webservice的cxf框架拦截器demo.rar
cxf框架包.zip
webservice远程调用与cxf框架共26页.pdf.zip