cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning Blohm <henning.bl...@zfabrik.de>
Subject re-deployment issue
Date Wed, 10 Jan 2018 11:26:00 GMT
Hello,

I am just starting with CXF 3.2.1, having used Metro before. Currently I am
trying to set up the most minimal Web Service - to get a better grip on CXF.

It seems that CXF holds on to old implementation classes between
re-deployments. How can I make sure this does not happen?

Details:
---------

The application I want to integrate CXF with is using Spring, Spring AOP
with AspectJ-Based Spring configuration. However, first I would like to get
CXF running with as little as possible.

So I wrote a minimalistic Servlet that publishes one endpoint:


public class WSServlet extends CXFNonSpringServlet {
private final static Logger LOG =
Logger.getLogger(WSServlet.class.getName());
private static final long serialVersionUID = -1469855940886001515L;

private Endpoint ep;

@Override
protected void loadBus(ServletConfig sc) {
super.loadBus(sc);
    Bus bus = getBus();
    BusFactory.setDefaultBus(bus);
    ep = Endpoint.publish("/books", new BooksWebServiceImpl());
}

@Override
public void destroy() {
ep.stop();
super.destroy();
}
}

Looking at
http://cxf.apache.org/docs/servlet-transport.html#ServletTransport-UsingtheservlettransportwithoutSpring
this should be the minimal approach. Now one specialty of the environment I
work with is hot-deployment after which the class loader of the Web App is
not accessible anymore. CXF is used as a shared lib outside (higher in the
class loader hierarchy) of the web app.

I notice that after (hot) redeployment CXF seems to still hold on to old
class versions:

---
Starting WebApp: zzz_meine_CXFWSSchnittstelle/web
 DefaultValidationEventHandler: [FATAL_ERROR]: Unable to create an instance
of javax.xml.ws.wsaddressing.W3CEndpointReference
      Location:  node: [wsa:EndpointReference: null]
 javax.xml.bind.UnmarshalException: Unable to create an instance of
javax.xml.ws.wsaddressing.W3CEndpointReference
  - with linked exception:
 [java.lang.reflect.InvocationTargetException]
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:726)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:247)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstance(UnmarshallingContext.java:688)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:171)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:559)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:538)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:60)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:153)
  at
com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:229)
  at
com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:266)
  at
com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
  at
com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:112)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:354)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:337)
  at org.apache.cxf.common.jaxb.JAXBUtils.unmarshall(JAXBUtils.java:191)
  at
org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl$WSDiscoveryProvider.invoke(WSDiscoveryServiceImpl.java:512)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
  at
org.apache.cxf.jaxws.JAXWSMethodInvoker.performInvocation(JAXWSMethodInvoker.java:66)
  at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
  at
org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)
  at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:85)
  at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:74)
  at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)
  at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
  at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)
  at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
  at
org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:278)
  at
org.apache.cxf.interceptor.OneWayProcessorInterceptor$1.run(OneWayProcessorInterceptor.java:137)
  at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:421)
  at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:346)
  at java.lang.Thread.run(Thread.java:745)
 Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  at
com.sun.xml.internal.bind.v2.ClassFactory.create0(ClassFactory.java:118)
  at
com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.createInstance(ClassBeanInfoImpl.java:270)
  at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstance(UnmarshallingContext.java:684)
  ... 37 more
 Caused by: java.lang.IllegalStateException: Loader is not in operation
anymore: com.zfabrik.impl.components.java.ComponentClassLoader@70c205bf:zzz_meine_CXFWSSchnittstelle/java/private
[OUT OF SERVICE]
  at
com.zfabrik.impl.components.java.ComponentClassLoader._checkValid(ComponentClassLoader.java:671)
  at
com.zfabrik.impl.components.java.ComponentClassLoader.getResource(ComponentClassLoader.java:779)
  at
org.eclipse.jetty.webapp.WebAppClassLoader.getResource(WebAppClassLoader.java:389)
  at javax.xml.bind.ContextFinder.find(ContextFinder.java:432)
  at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641)
  at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
  at
javax.xml.ws.wsaddressing.W3CEndpointReference.getW3CJaxbContext(W3CEndpointReference.java:124)
  at
javax.xml.ws.wsaddressing.W3CEndpointReference.<init>(W3CEndpointReference.java:72)
  ... 44 more
---

The "Loader not in operation anymore" is from the environment we are using.

Thanks for any suggestion!
Henning

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message