• 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 在类内部捕获异常并处理异常

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

  • 相关阅读:
    H3C-路由器密码恢复
    H3C-交换机密码恢复
    H3C-端口镜像
    [洛谷P4234]最小差值生成树
    [BZOJ4003]城池攻占
    [BZOJ1058]报表统计
    [BZOJ1584]Cleaning Up 打扫卫生
    [BZOJ3733]Iloczyn
    [HDU5709]Claris Loves Painting
    [BZOJ5109]大吉大利,晚上吃鸡!
  • 原文地址:https://www.cnblogs.com/pangblog/p/3285845.html
Copyright © 2020-2023  润新知