java.lang.NoClassDefFoundError: javax/xml/ws/soap/MTOM
这究竟是什么问题?麻烦帮看下,是不是少了什么?publicfinalclassClient{privateClient(){}publicstaticvoidmain(S...
这究竟是什么问题?麻烦帮看下,是不是少了什么?
public final class Client{
private Client(){
}
public static void main(String args[]) throws Exception{
// START SNIPPET: client
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(HelloWorld.class);
String endpointAddress = "http://localhost:8080/cxf/HelloWord";
factory.setAddress( endpointAddress );
HelloWorld client = (HelloWorld) factory.create();// 出错在这里。
//String reply = client.sayHi("HI");
//System.out.println("Server said: " + reply);
System.out.println("Server said: "+"你好吗?" );
System.exit(0);
}
}
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ws/soap/MTOM
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.loadWSFeatureAnnotation(JaxWsServiceFactoryBean.java:135)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initConfiguration(JaxWsServiceFactoryBean.java:445)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setJaxWsImplementorInfo(JaxWsServiceFactoryBean.java:420)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setServiceClass(JaxWsServiceFactoryBean.java:191)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeServiceFactory(AbstractWSDLBasedEndpointFactory.java:227)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
at com.demo.Client.main(Client.java:32) 展开
public final class Client{
private Client(){
}
public static void main(String args[]) throws Exception{
// START SNIPPET: client
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(HelloWorld.class);
String endpointAddress = "http://localhost:8080/cxf/HelloWord";
factory.setAddress( endpointAddress );
HelloWorld client = (HelloWorld) factory.create();// 出错在这里。
//String reply = client.sayHi("HI");
//System.out.println("Server said: " + reply);
System.out.println("Server said: "+"你好吗?" );
System.exit(0);
}
}
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ws/soap/MTOM
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.loadWSFeatureAnnotation(JaxWsServiceFactoryBean.java:135)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initConfiguration(JaxWsServiceFactoryBean.java:445)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setJaxWsImplementorInfo(JaxWsServiceFactoryBean.java:420)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setServiceClass(JaxWsServiceFactoryBean.java:191)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.initializeServiceFactory(AbstractWSDLBasedEndpointFactory.java:227)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
at com.demo.Client.main(Client.java:32) 展开
4个回答
展开全部
缺少相关Jar包,javax.xml.soap在JDK中缺省是不存在的
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
xml配置的问题,或者是你的类的位置没有放进指定的包
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
没有找到类JaxWsServiceFactoryBean可能出错了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
HelloWorld 在哪里?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询