webService生成服务端之后,启动报错

Deep_Learning 2013-09-12 03:47:07
信息: WSSERVLET12: JAX-WS context listener initializing
2013-9-12 15:35:47 com.sun.xml.ws.transport.http.servlet.WSServletContextListener parseAdaptersAndCreateDelegate
严重: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: Unable to create JAXBContext
javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:171)
at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:99)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:250)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:343)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:205)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:513)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:257)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:151)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4172)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4671)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)
at org.apache.catalina.startup.Catalina.start(Catalina.java:585)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
www.tmzskj.com.bs.service.ChannelService is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at www.tmzskj.com.bs.service.ChannelService
at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return
at www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse
www.tmzskj.com.bs.service.ChannelService does not have a no-arg default constructor.
this problem is related to the following location:
at www.tmzskj.com.bs.service.ChannelService
at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return
at www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse

at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
... 33 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
www.tmzskj.com.bs.service.ChannelService is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at www.tmzskj.com.bs.service.ChannelService
at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return
at www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse
www.tmzskj.com.bs.service.ChannelService does not have a no-arg default constructor.
this problem is related to the following location:
at www.tmzskj.com.bs.service.ChannelService
at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return
at www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse

at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:466)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:298)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:141)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1157)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:188)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:111)
at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:113)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:166)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:159)
... 35 more
2013-9-12 15:35:47 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:141)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4172)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4671)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)
at org.apache.catalina.startup.Catalina.start(Catalina.java:585)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:171)
at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:99)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:250)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:343)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:205)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:513)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:257)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:151)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
... 25 more
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
www.tmzskj.com.bs.service.ChannelService is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at www.tmzskj.com.bs.service.ChannelService
at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return

at com.sun.xml.ws.develotstart
...全文
362 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zlxfogger 2016-06-07
  • 打赏
  • 举报
回复
我也遇到了这个问题,请问你解决了吗
Deep_Learning 2013-09-12
  • 打赏
  • 举报
回复
引用 5 楼 forgetsam 的回复:
www.tmzskj.com.bs.service.ChannelService is an interface, and JAXB can't handle interfaces this problem is related to the following location: at www.tmzskj.com.bs.service.ChannelService at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return at www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse 不要把你的get/set方法也当作WebMethod发布 @Webservice(exclude = true))
我在网上也看到这个方法,但是还是没有用
forgetsam 2013-09-12
  • 打赏
  • 举报
回复
www.tmzskj.com.bs.service.ChannelService is an interface, and JAXB can't handle interfaces this problem is related to the following location: at www.tmzskj.com.bs.service.ChannelService at private www.tmzskj.com.bs.service.ChannelService www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse._return at www.tmzskj.com.bs.action.jaxws.GetChannelServiceResponse 不要把你的get/set方法也当作WebMethod发布 @Webservice(exclude = true))
木_木_三 2013-09-12
  • 打赏
  • 举报
回复
接口上 加 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)或者 @SOAPBinding(style = SOAPBinding.Style.RPC) 试试
木_木_三 2013-09-12
  • 打赏
  • 举报
回复
引用 2 楼 u010719640 的回复:
引用 1 楼 yb331851841 的回复:
jdk版本低了 换个高版本的
不是这个原因,我的jdk是7.0的
代码贴出来看看
Deep_Learning 2013-09-12
  • 打赏
  • 举报
回复
引用 1 楼 yb331851841 的回复:
jdk版本低了 换个高版本的
不是这个原因,我的jdk是7.0的
木_木_三 2013-09-12
  • 打赏
  • 举报
回复
jdk版本低了 换个高版本的

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧