我目前在使用 Websphere 7.0.0.27 和使用 org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean
的特定 Web 服务调用时遇到了非常令人困惑的问题。类(来自 spring-web 3.2.3.RELEASE 或 3.1.1.RELEASE)。当我从头开始启动服务器时,服务调用运行得非常好。我可以调用该服务,取回数据,并且我的应用程序运行良好。但是,当我重新发布我的应用程序时,后续调用将导致以下结果:
javax.xml.ws.WebServiceException: ServiceDescription.updateEndpointDescription: Cant do a getPort() specifiying a different SEI than the previous getPort(). PortQN: {0}; current SEI: {1}; previous SEI: {2} at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:118) at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEndpointDescription(ServiceDescriptionImpl.java:557) at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEndpoint(DescriptionFactoryImpl.java:372) at org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(DescriptionFactory.java:178) at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:584) at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:507) at javax.xml.ws.Service.getPort(Service.java:103) at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.getPortStub(JaxWsPortClientInterceptor.java:419) at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.prepare(JaxWsPortClientInterceptor.java:337) at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.invoke(JaxWsPortClientInterceptor.java:484) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy109.search(Unknown Source) at ...
只有在应用发布后的服务调用才会发生这种情况。我可以一遍又一遍地调用该服务,没有问题,然后发布,然后我开始遇到这个问题。重新启动Websphere后,问题就消失了,直到我再次发布。同样重要的是,这似乎只在我运行服务器设置“使用工作区中的资源运行服务器”时才会发生。选项“使用服务器上的资源运行服务器”不会发生这种情况,但我不想使用该设置,因为我需要执行整个发布(而不是简单地保存文件)才能将我的 JSP 更改更改为出现,那就是更大的时间浪费。另外,我使用的是 Eclipse (4.2),这也发生在 RAD (7.5) 中。
之前有其他人遇到过这个问题吗?您能解决这个问题吗?当我遇到这个问题时,我会尝试提供更多详细信息。
最佳答案
该修复程序也很晦涩,但 portName
属性是在 bean 上定义的,删除该属性解决了问题。 Spring 显然会使用该属性来构建 javax.xml.namespace.QName
(通过 javax.xml.namespace.QName.QName(String namespaceURI, String localPart)
),并且没有 portName
它选择使用 serviceInterface
属性集属性(property)代替。
portName
和serviceInterface
属性实际上是不同的值。 portName
被设置为 <port name=""/>
这是在 WSDL 中定义的,这可能是错误的做法。使用QName localPart
的接口(interface)类名参数最终是我的修复,但可能有更好的 portName
参数也可以解决这个问题。
关于java - 每次应用程序发布后,来自 JaxWsPortProxyFactoryBean 的 WebServiceException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19256369/