`
sjsky
  • 浏览: 913383 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

WebService Exception: Unable to create JAXBContext

阅读更多
    blog迁移至:http://www.micmiu.com

今天发布webservice时遇到了非常奇怪的问题,之前是可以正常启动发布的,只是增加了一个set方法(注入一个service),以前项目里这样做也可以的,更奇怪的是同样的程序在同事的电脑上一切又是正常的,倒腾了很久,查了很多资料,经过验证是因为JDK版本不同造成的,好像JDK6U15之前的是可以的,之后的版本就不行了,一直会报下面的错误。

解决方案:
JDK6U15之后的版本,必须在setter/getter等method上加上注释@WebMethod(exclude=true)这样才发布就成功了

2010-08-09 17:46:21 [com.huaxia.webservice.StartWebservice]-[ERROR] http://localhost:9005/IbpWorkOrderService,webservice publish error!
javax.xml.ws.WebServiceException: Unable to create JAXBContext
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:83)
	at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:244)
	at com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:312)
	at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:178)
	at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:456)
	at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:475)
	at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:213)
	at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:143)
	at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:102)
	at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
	at com.huaxia.webservice.StartWebservice.start(StartWebservice.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1185)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1147)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
com.huaxia.process.service.ProcessService is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at com.huaxia.process.service.ProcessService
com.huaxia.process.service.ProcessService does not have a no-arg default constructor.
	this problem is related to the following location:
		at com.huaxia.process.service.ProcessService

	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:140)
	... 43 more
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
com.huaxia.process.service.ProcessService is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at com.huaxia.process.service.ProcessService
com.huaxia.process.service.ProcessService does not have a no-arg default constructor.
	this problem is related to the following location:
		at com.huaxia.process.service.ProcessService

	at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:436)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1100)
	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:143)
	at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:95)
	at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:97)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:148)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:140)
	... 45 more


3
0
分享到:
评论
3 楼 冬之语2008 2012-03-07  
不支持ResultSet这样的数据类型,将他们转换成 String就可以了
2 楼 sjsky 2011-01-30  
kekenow 写道
这样修改可以部署成功, 但是调用webservice的时候还是会报同样的错!你可以试一下吗?

我是测试过的,项目正在运行
1 楼 kekenow 2011-01-26  
这样修改可以部署成功, 但是调用webservice的时候还是会报同样的错!你可以试一下吗?

相关推荐

    WebService-Simple:WebService-Simple 的只读发布历史

    WebService::Simple - Web 服务 API 的简单接口 概要 use WebService::Simple; # Simple use case my $flickr = WebService::Simple-&gt;new( base_url =&gt; "http://api.flickr.com/services/rest/", param =&gt; { api_...

    WebService-Reactio:API客户端的React

    use WebService::Reactio; my $client = WebService::Reactio-&gt;new( api_key =&gt; '__API_KEY__', organization =&gt; '__ORGANIZATION__', ); my $incidents = $client-&gt;incidents; 描述 WebService :: Reactio是...

    webservice-pushover:WebService-Pushover-Perl对Pushover API的支持

    名称 WebService :: Pushover-Pushover ...) or die( "Unable to instantiate WebService::Pushover.\n" ); my %params = ( message =&gt; 'test test test', priority =&gt; 0, ); my $status = $push-&gt;message( %params

    JaxbContext生成xml文件或java类对象转化注解

    在 JAX-WS(Java 的 WebService 规范之一)中,JDK1.6 自带的版本 JAX-WS2.1,其底层支持就是 JAXB。 JAXB 可以实现 Java 对象与 XML 的相互转换。在 JAXB 中,将一个 Java 对象转换为 XML 的过程称之为 Marshal,...

    WebService-UrbanDictionary:WebService-UrbanDictionary 的只读发布历史

    版本版本 2.014概要 use WebService::UrbanDictionary; my $ud = WebService::UrbanDictionary-&gt;new; my $results = request('perl'); for my $each (@{ $results-&gt;definitions }) { printf "Definition: %s\n(by %s...

    WebService-Algolia:用于访问 Algolia API 的模块

    名称WebService::Algolia - Algolia API 绑定版本版本 0.1002概要 use WebService::Algolia;my $alg = WebService::Algolia-&gt;new( application_id =&gt; '12345', api_key =&gt; 'abcde',);$alg-&gt;get_indexes;描述该模块为...

    WebService::UMLSKS::Similarity::Java:使用Java测量医学术语之间的语义相关性-开源

    这是查找语义相关性的 HSO 度量的 Java 实现。 该度量应用于 UMLS 源词汇表,并用于查找医学术语之间的相关性。 此实现使用与 WebService::UMLSKS::Similarity 相同的算法,后者是一个 CPAN perl 开源包。

    CXF webservice

    一个CXF webservice 实例,兼容tomcat和weblogic; 已解决了报错:javax.xml.ws.soap.SOAPFaultException: Cannot create a secure XMLInputFactory

    WebService-Instapaper:WebService-Instapaper 的只读发布历史

    WebService::Instapaper - Instapaper Full API 的客户端 概要 use WebService::Instapaper; my $client = WebService::Instapaper-&gt;new(consumer_key =&gt; '...', consumer_secret =&gt; '...'); $client-&gt;auth('...

    WebService-Simple-AWS:WebService-Simple-AWS 的只读发布历史

    WebService::Simple::AWS - 使用 WebService::Simple 的 Amazon Web Service 的简单接口 概要 use WebService::Simple::AWS; my $service = WebService::Simple::AWS-&gt;new( base_url =&gt; '...

    WebService-Simple-AWS:使用 WebService 的 Amazon Web Service 的简单接口

    名称WebService::Simple::AWS - 使用 WebService::Simple 的 Amazon Web Service 的简单接口概要 use WebService::Simple::AWS;my $service = WebService::Simple::AWS-&gt;new( base_url =&gt; '...

    p5-WebService-Decibel:网络服务

    WebService::Decibel - 一个简单快速的 Decibel API 接口 概要 use WebService::Decibel; my $decibel = new WebService::Decibel( app_id =&gt; 'YOUR_APPLICATION_ID', app_key =&gt; 'YOUR_APPLICATION_KEY', ); my ...

    WebService-FC2-博客

    名称WebService :: FC2 :...my $post_id = $fc2blog-&gt;new_post( title =&gt; "From WebService::FC2::Blog-&gt;create_post(): " . localtime, description =&gt; "日本語&lt;/h1&gt;", category_id =&gt; 0, # カテゴリの作成は FC2 Blog

    解决CXF webService 调用报错 Cannot create a secure XMLInputFactory

    带详细解决方案说明文档,提供三种解决方式,另外包含stax2-api.jar,stax2-api-source.jar,woodstox-core-asl-4.4.1.jar,stax-ex.jar,wstx-asl-3.2.9.jar等jar文件,亲测有效。

    Domino的WebService服务

    3. 创建Domino WebService: 创建Domino WebService主要涉及以下步骤: - 设计 Domino 应用程序:构建所需的数据库和表单,定义计算公式和代理脚本。 - 创建Web服务文档(WSDL):定义服务接口、消息结构和操作。 ...

    WebService-Aria2-RPC:WebService的存储库

    use WebService::Aria2::RPC::JSON; my $aria2 = WebService::Aria2::RPC::JSON-&gt;new(); my $gid = $aria2-&gt;add_uri( 'http://example.com/file.tgz' ); $aria2-&gt;pause( $gid ); 描述 通过RPC接口控制aria2实例。 ...

    学习AXIS2遇到的一个问题与解决

    在学习和使用Apache Axis2的过程中,用户在尝试通过MyEclipse中的插件自动生成代码时遇到了`java.lang.reflect.InvocationTargetException`异常。这个问题导致代码生成过程无法顺利完成。经过两天的努力,最终找到了...

    Java WebService大讲堂(1-10集,完整版)

    Java WebService大讲堂是一个全面深入讲解Web服务技术的系列教程,涵盖了从基础概念到实际应用的各个环节。这个完整版包括了1-10集的内容,旨在帮助开发者全面理解和掌握Java WebService的开发与实现。 首先,让...

    webserviceInvoker:JAVA动态调用WebService的框架

    这个JAVA的框架主要用于动态的调用WebService.通常情况下得WS调用都是使用wsdl4j等生成静态的stub存根类,然后再调用webservice.但是这样的局限性很大,比如在流程引擎中,调用的WS可能都是在界面上配置的.这就要求需要...

    oracle调用webservice接口地址demo

    1. **创建服务对象**:通过`to_qname`函数指定服务名称,并使用`create_service`创建服务对象。 2. **创建调用对象**:指定服务端口和服务操作,创建调用对象。 3. **设置目标地址**:指定WebService的URL。 4. **...

Global site tag (gtag.js) - Google Analytics