zoukankan      html  css  js  c++  java
  • webwervice发布时出错 java.security.PrivilegedActionException

    错误信息:
    信息: Dynamically creating response wrapper bean Class com.potevio.ws.jaxws.DealReqResponse
    Exception in thread "main" 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.potevio.ws.SessionGatewayWs.main(SessionGatewayWs.java:79)
    Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 10 counts of IllegalAnnotationExceptions

    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)
    ... 13 more

    错误原因:

    服务类中的方法有用throws Exception抛出异常

    解决办法:

    使用try{} catch 在类内部捕获异常并处理异常

    另外一点:服务修改后一定要记得重新发布,否则客户端访问的仍是上次发布的,容易引起错误。

  • 相关阅读:
    Axiom3D:资源引用与加载基本流程.
    实践:C++平台迁移以及如何用C#做C++包装层
    Axiom3D:Buffer漫谈
    CSS: hover选择器的使用
    TTS 语音修复 ,缺少文件的,没注册类的
    sqlserver 查找某个字段在哪张表里
    Excel 表格查找重复数据,去重复统计
    C# HttpWebResponse WebClient 基础连接已经关闭: 发送时发生错误.
    C# 控件置于最顶层、最底层
    C# 线程 正确使用Thread.Join()停止方式
  • 原文地址:https://www.cnblogs.com/pangblog/p/3285845.html
Copyright © 2011-2022 走看看