Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 432BB8194 for ; Tue, 30 Aug 2011 17:35:04 +0000 (UTC) Received: (qmail 89793 invoked by uid 500); 30 Aug 2011 17:35:04 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 89762 invoked by uid 500); 30 Aug 2011 17:35:03 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 89754 invoked by uid 99); 30 Aug 2011 17:35:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 17:35:03 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 17:34:59 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0025AD7F01 for ; Tue, 30 Aug 2011 17:34:38 +0000 (UTC) Date: Tue, 30 Aug 2011 17:34:37 +0000 (UTC) From: "Aki Yoshida (JIRA)" To: issues@cxf.apache.org Message-ID: <2071061790.8471.1314725677997.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <562790035.2635.1314608380146.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (CXF-3773) CXF unregisters MBeans for JAX-WS endpoints twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aki Yoshida resolved CXF-3773. ------------------------------ Resolution: Fixed Fix Version/s: 2.5 2.4.3 > CXF unregisters MBeans for JAX-WS endpoints twice > ------------------------------------------------- > > Key: CXF-3773 > URL: https://issues.apache.org/jira/browse/CXF-3773 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 2.4.2 > Environment: Tomcat 6.0.33 / Spring 3.0.[56] / Java 1.[67] > Reporter: Dominik Drzewiecki > Assignee: Aki Yoshida > Fix For: 2.4.3, 2.5 > > > MBeans created for JAX-WS endpoints do get unregistered twice during context shutdown. > I've placed a breakpoint in {{org.apache.cxf.management.jmx.InstrumentationManagerImpl.unregister(ObjectName)}} and caught following stacks when reaching it. The first line shows the ObjectName being unregistered. > You may notice that the first three stacks are observed during the {{CXFBus}} shutdown, and the fourth one during {{JAXWS22SpringEndpointImpl}}. > The last invocation of {{org.apache.cxf.management.jmx.InstrumentationManagerImpl.unregister(ObjectName)}} results in {{javax.management.InstanceNotFoundException}} being thrown (the full message is {{"WARNING: Unregistering ManagedEndpoint failed. javax.management.InstanceNotFoundException: org.apache.cxf:bus.id=cxf52615653,type=Bus.Service.Endpoint,service="{http://ws.xxx.xxxxx.com/}Service",port="ServicePort"}}) which prevents from shutting down the endpoint bean, spring context and web application context cleanly. > {noformat} > org.apache.cxf:bus.id=cxf52615653,type=Bus.Service.Endpoint,service="{http://ws.xxx.xxxxxx.com/}Service",port="ServicePort" > Thread [main] (Suspended (entry into method unregister in InstrumentationManagerImpl)) > InstrumentationManagerImpl.unregister(ObjectName) line: 229 > InstrumentationManagerImpl.unregister(ManagedComponent) line: 225 > ServerImpl.destroy() line: 180 > ServerRegistryImpl.preShutdown() line: 88 > CXFBusLifeCycleManager.preShutdown() line: 84 > CXFBusLifeCycleManager.postShutdown() line: 91 > SpringBus.onApplicationEvent(ApplicationEvent) line: 94 > SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 97 > XmlWebApplicationContext(AbstractApplicationContext).publishEvent(ApplicationEvent) line: 303 > XmlWebApplicationContext(AbstractApplicationContext).doClose() line: 1007 > XmlWebApplicationContext(AbstractApplicationContext).close() line: 970 > ContextLoaderListener(ContextLoader).closeWebApplicationContext(ServletContext) line: 384 > ContextLoaderListener.contextDestroyed(ServletContextEvent) line: 78 > StandardContext.listenerStop() line: 4245 > StandardContext.stop() line: 4886 > StandardHost(ContainerBase).stop() line: 1110 > StandardEngine(ContainerBase).stop() line: 1110 > StandardEngine.stop() line: 468 > StandardService.stop() line: 604 > StandardServer.stop() line: 788 > Catalina.stop() line: 662 > Catalina.start() line: 629 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 > Method.invoke(Object, Object...) line: 601 > Bootstrap.start() line: 289 > Bootstrap.main(String[]) line: 414 > {noformat} > {noformat} > org.apache.cxf:bus.id=cxf52615653,type=Bus.Service.Endpoint,service="{http://ws.xxx.xxxxx.com/}Service",port="Service" > Thread [main] (Suspended (entry into method unregister in InstrumentationManagerImpl)) > InstrumentationManagerImpl.unregister(ObjectName) line: 229 > InstrumentationManagerImpl.unregister(ManagedComponent) line: 225 > ServerImpl.destroy() line: 180 > ServerRegistryImpl.preShutdown() line: 88 > CXFBusLifeCycleManager.preShutdown() line: 84 > CXFBusLifeCycleManager.postShutdown() line: 91 > SpringBus.onApplicationEvent(ApplicationEvent) line: 94 > SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 97 > XmlWebApplicationContext(AbstractApplicationContext).publishEvent(ApplicationEvent) line: 303 > XmlWebApplicationContext(AbstractApplicationContext).doClose() line: 1007 > XmlWebApplicationContext(AbstractApplicationContext).close() line: 970 > ContextLoaderListener(ContextLoader).closeWebApplicationContext(ServletContext) line: 384 > ContextLoaderListener.contextDestroyed(ServletContextEvent) line: 78 > StandardContext.listenerStop() line: 4245 > StandardContext.stop() line: 4886 > StandardHost(ContainerBase).stop() line: 1110 > StandardEngine(ContainerBase).stop() line: 1110 > StandardEngine.stop() line: 468 > StandardService.stop() line: 604 > StandardServer.stop() line: 788 > Catalina.stop() line: 662 > Catalina.start() line: 629 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 > Method.invoke(Object, Object...) line: 601 > Bootstrap.start() line: 289 > Bootstrap.main(String[]) line: 414 > {noformat} > {noformat} > org.apache.cxf:bus.id=cxf52615653,type=Bus > Thread [main] (Suspended (entry into method unregister in InstrumentationManagerImpl)) > InstrumentationManagerImpl.unregister(ObjectName) line: 229 > InstrumentationManagerImpl.shutdown() line: 263 > InstrumentationManagerImpl.postShutdown() line: 279 > CXFBusLifeCycleManager.postShutdown() line: 97 > SpringBus.onApplicationEvent(ApplicationEvent) line: 94 > SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 97 > XmlWebApplicationContext(AbstractApplicationContext).publishEvent(ApplicationEvent) line: 303 > XmlWebApplicationContext(AbstractApplicationContext).doClose() line: 1007 > XmlWebApplicationContext(AbstractApplicationContext).close() line: 970 > ContextLoaderListener(ContextLoader).closeWebApplicationContext(ServletContext) line: 384 > ContextLoaderListener.contextDestroyed(ServletContextEvent) line: 78 > StandardContext.listenerStop() line: 4245 > StandardContext.stop() line: 4886 > StandardHost(ContainerBase).stop() line: 1110 > StandardEngine(ContainerBase).stop() line: 1110 > StandardEngine.stop() line: 468 > StandardService.stop() line: 604 > StandardServer.stop() line: 788 > Catalina.stop() line: 662 > Catalina.start() line: 629 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 > Method.invoke(Object, Object...) line: 601 > Bootstrap.start() line: 289 > Bootstrap.main(String[]) line: 414 > {noformat} > {noformat} > org.apache.cxf:bus.id=cxf52615653,type=Bus.Service.Endpoint,service="{http://ws.xxx.xxxxx.com/}Service",port="ServicePort" > Thread [main] (Suspended (entry into method unregister in InstrumentationManagerImpl)) > InstrumentationManagerImpl.unregister(ObjectName) line: 229 > InstrumentationManagerImpl.unregister(ManagedComponent) line: 225 > ServerImpl.destroy() line: 180 > JAXWS22SpringEndpointImpl(EndpointImpl).stop() line: 263 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 > Method.invoke(Object, Object...) line: 601 > DisposableBeanAdapter.invokeCustomDestroyMethod(Method) line: 273 > DisposableBeanAdapter.destroy() line: 199 > DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroyBean(String, DisposableBean) line: 487 > DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroySingleton(String) line: 463 > DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroySingletons() line: 431 > XmlWebApplicationContext(AbstractApplicationContext).destroyBeans() line: 1048 > XmlWebApplicationContext(AbstractApplicationContext).doClose() line: 1022 > XmlWebApplicationContext(AbstractApplicationContext).close() line: 970 > ContextLoaderListener(ContextLoader).closeWebApplicationContext(ServletContext) line: 384 > ContextLoaderListener.contextDestroyed(ServletContextEvent) line: 78 > StandardContext.listenerStop() line: 4245 > StandardContext.stop() line: 4886 > StandardHost(ContainerBase).stop() line: 1110 > StandardEngine(ContainerBase).stop() line: 1110 > StandardEngine.stop() line: 468 > StandardService.stop() line: 604 > StandardServer.stop() line: 788 > Catalina.stop() line: 662 > Catalina.start() line: 629 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 > Method.invoke(Object, Object...) line: 601 > Bootstrap.start() line: 289 > Bootstrap.main(String[]) line: 414 > {noformat} > For the completness, my spring context is as simple as: > {code:xml} > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd > http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd > http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd > http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd" > xmlns:context="http://www.springframework.org/schema/context" > xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:jaxrs="http://cxf.apache.org/jaxrs" > xmlns:cxf="http://cxf.apache.org/core"> > > > > class="org.apache.cxf.management.jmx.InstrumentationManagerImpl" > > > > > > > > > address="${web.ws.uri}" /> > > {code} > While the class and the interface exposed as a service looks somewhat like this: > {code} > @WebService(endpointInterface="com.xxxxx.xxx.ws.IService", serviceName="Service" ) > @Component("service") > public class Service implements IService { > // implementation here > } > {code} > {code} > @WebService > public interface IService { > @WebResult(name = "status") > @WebMethod(operationName = "send") > public boolean send(@WebParam(name = "message") SomeMessage message) > throws SomeException; > @Oneway > @WebMethod(operationName = "doSend") > public void doSend(@WebParam(name = "message") SomeMessage message) > throws SomeException; > } > {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira