- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 JDK 1.6.0_45 创建了一个 JAX-WS 客户端。我在一个war项目中使用制作的jar,也是用ear打包的。在 Tomcat 中,我可以使用 Web 服务客户端调用并毫无问题地获得响应。但是在 Weblogic 10.3.6 服务器 中,我得到了这个异常:
ClientPortClass service = new ClientPortClass();
IClientPortClass port = service.getPortXML(); ---> this line produces below error:
com.sun.xml.ws.model.RuntimeModelerException: A WebService annotation is not present on class: clientpackage.IClientPortClass
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:237)
at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:762)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.buildRuntimeModel(WLSProvider.java:1026)
at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:746)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:737)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:361)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:978)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1083)
at weblogic.wsee.jaxws.spi.ClientInstancePool.takeSimpleClientInstance(ClientInstancePool.java:376)
at weblogic.wsee.jaxws.spi.ClientInstancePool.take(ClientInstancePool.java:232)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:896)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:836)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
at javax.xml.ws.Service.getPort(Service.java:92)
at clientpackage.ClientPortClass.getPortXML(ClientPortClass.java:58)
...
我检查了 jax ws 生成的 ClientPortClass 类,它具有以下结构:
/**
* Web Service
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.8
* Generated source version: 2.1
*/
@WebServiceClient(name = "ClientPortClass", targetNamespace = "transactionData:ClientPortClass", wsdlLocation = "wsdlURL...")
public class ClientPortClass extends Service{
...
@WebEndpoint(name = "portXML")
public IClientPortClass getPortXML(WebServiceFeature... features) {
...}
}
IClientPortClass:
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.8
* Generated source version: 2.1
*/
@WebService(name = "IClientPortClass", targetNamespace = "transactionData:ClientPortClass")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@XmlSeeAlso({
ObjectFactory.class
})
public interface IClientPortClass {
@WebMethod(action = "trigger")
@WebResult(name = "message", targetNamespace = "transactionData:data", partName = "result")
public Message trigger(
@WebParam(name = "requestMessage", targetNamespace = "transactionData:data", partName = "input")
RequestMessage input);
}
我观察到 weblogic 使用 glassfish.jaxws.rt_1.3.0.0_2-1-5.jar。 com.sun.xml.ws.model.RuntimeModelerException 来自那个 jar 。我不知道,但也许它有关。
对于 RuntimeModelerException:WebService 注释不存在于类:clientpackage.IClientPortClass,您有什么建议吗?
最佳答案
需要在实现类上加上@WebService注解,例如@WebService(endpointInterface = "com...", targetNamespace = "http://abc ...")
关于java - RuntimeModelerException : A WebService annotation is not present on class: clientpackage. IClientPortClass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31269651/
我使用 JDK 1.6.0_45 创建了一个 JAX-WS 客户端。我在一个war项目中使用制作的jar,也是用ear打包的。在 Tomcat 中,我可以使用 Web 服务客户端调用并毫无问题地获得响
我是一名优秀的程序员,十分优秀!