j2ee-连接webservice出下面异常

问题描述

连接webservice出下面异常

连接webservice

public static void main(String[] args) {

    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setServiceClass(OuterService.class);
    factory.setAddress("http://www.aaaaaaaaa.com/ws/OuterService?wsdl");
     factory.setUsername("aaaaaaa");
     factory.setPassword("aaaaaaaa");
    OuterService outerRegisterService = (OuterService) factory.create();
    System.out.println(outerRegisterService.login("test", "123456"));
}

出现下面异常,jar包jaxb-api-2.2.6.jar和jaxb-impl-2.2.6.jar都在web下的lib下面了

log4j:WARN No such property [conversionPattern] in org.apache.log4j.SimpleLayout.
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:303)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:142)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:244)
at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:484)
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:490)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:704)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:550)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
at com.celink.googfit.test.Tester.main(Tester.java:249)

解决方案

这个异常显然是服务端代码有问题,你要找webservice那边代码会不会抛出异常

解决方案二:

我靠,楼上的回答,楼主不管么。

时间: 2024-10-06 16:02:47

j2ee-连接webservice出下面异常的相关文章

Hibernate3连接oracle11g在启动项目时总是抛出如下异常

问题描述 我的hibernate.cfg.xml的配置文件如下:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-confi

java-关于WebSocket的问题 为什么浏览器关闭后会出一下异常

问题描述 关于WebSocket的问题 为什么浏览器关闭后会出一下异常 错误信息```java.net.SocketException: Software caused connection abort: recv failedat java.net.SocketInputStream.socketRead0(Native Method)at java.net.SocketInputStream.read(SocketInputStream.java:129)at java.net.Socket

net framework-asp连接oracle出问题,求大神指点

问题描述 asp连接oracle出问题,求大神指点 "/"应用程序中的服务器错误. ORA-12154: TNS: 无法解析指定的连接标识符 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: System.Data.OracleClient.OracleException: ORA-12154: TNS: 无法解析指定的连接标识符 源错误: 行 70: public void execute

动态构建WebService时出现异常

问题描述 用的是网上很多人说的方法:///<summary>///根据指定的信息,调用远程WebService方法///</summary>///<paramname="url">WebService的http形式的地址</param>///<paramname="namespace">欲调用的WebService的命名空间</param>///<paramname="class

SRVE0068E: 未捕获到 servlet CXFServlet 的其中一个服务方法中抛出的异常。抛出的异常:java.lang.IncompatibleClassChangeError

问题描述 RT.[08-10-2516:37:40:421CST]00000030ServletWrappeESRVE0068E:未捕获到servletCXFServlet的其中一个服务方法中抛出的异常.抛出的异常:java.lang.IncompatibleClassChangeErroratorg.apache.cxf.wsdl11.ServiceWSDLBuilder.addExtensibiltyElements(ServiceWSDLBuilder.java:227)atorg.apa

pdf-PDFBOX 打印PDF文件出现在异常

问题描述 PDFBOX 打印PDF文件出现在异常 我使用PDFBOX(版本1.8.3)打印PDF文件时老提示:""未发送 StartDocPrinter 调用""C# 测试代码如下:PDDocument pdf = PDDocument.load(strFileName);pdf.print();帮各位大侠帮忙看看pdfbox 的print方法到底要怎么使用.

缺省构造函数不能处理隐式超构造函数抛出的异常类型 IOException。必须定义显式构造函数

问题描述 缺省构造函数不能处理隐式超构造函数抛出的异常类型 IOException.必须定义显式构造函数 int lastnum = getNum(source.getProperty(""fileName"")); public static int getNum(String Filename) throws IOException { InputStream myxls; myxls = new FileInputStream(Filename); sr =

[WPF]如何在关闭非模态子窗体时用消息框确认:解决最小化窗体时抛出的异常

又是一个看起来很简单的问题.像下面这样在Closing里弹出个MessageBox确认一下不就行了? public static void OnWindowClosing(object sender, CancelEventArgs e) { if (MessageBox.Show(string.Format("Are you sure to close the {0}?", (sender as Window).Title), "Confirm", Message

ssh2在tomcat启动时抛出的异常,无解

问题描述 ssh2在tomcat启动时抛出的异常,无解 Mar 16, 2015 3:22:39 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener java.lang.ClassNotFoundException: org.