Search code examples
javaeclipsespringwebsphereaxis

WebServiceException From JaxWsPortProxyFactoryBean After Every App Publish


I have very perplexing issue that I'm encountering at the moment with Websphere 7.0.0.27 and a particular web service call using the org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean class (from spring-web either 3.2.3.RELEASE or 3.1.1.RELEASE). The service call is functioning perfectly fine when I start my server from scratch. I can call the service, get data back, and my app functions just fine. However, when I re-publish my application, subsequent calls result in the following:

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 ...

It happens to the service call only after an app publish. I can call the service over and over without issue, then publish, and then I start getting this issue. After I restart Websphere, the problem is gone until I publish again. Also important is that this seems to only occur when I run the sever setting "Run server with resources within the workspace". The option "Run server with resources on Server" doesn't have this happen, but I don't want to use that setting because I need to do an entire publish (as opposed to simply a file save) to get my JSP changes to show up, and that's a bigger waste of time. Also, I'm using Eclipse (4.2) and this also happens in RAD (7.5).

Has anyone else encountered this issue before, and were you able to resolve it? I'll try to provide any further detail as I come across it.


Solution

  • It would be appropriate that the fix is also obscure, but the portName property was being defined on the bean, and removing that property fixed the issue. Spring apparently would use that property to build a javax.xml.namespace.QName (via javax.xml.namespace.QName.QName(String namespaceURI, String localPart)), and without the portName property set it chooses to use the serviceInterface property instead.

    The portName and serviceInterface properties were in fact different values. The portName was being set to the <port name=""/> that's defined in the WSDL, which may have been the incorrect thing to do. Using the interface class name for the QName localPart parameter was ultimately my fix, but it is possible that a better portName parameter would also fix the issue.