On Friday, June 24, 2011 10:17:26 AM Sonam Nepali wrote: > If I went from > <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl" /> > > to something like > <cxf:bus/> > > How would I get reference to the cxf bus? I want to inject the "cxf" bus > reference to one of my mbeans.
The exact same way as before. The default name for <cxf:bus> is "cxf", although with 2.4.x, you can actually have multiple bus' in the same app with different names (<cxf:bus name="foo">) and inject them in separately. Dan > Thanks > > -Sonam > > > -----Original Message----- > From: Freeman Fang [mailto:[email protected]] > Sent: Thursday, June 23, 2011 7:25 PM > To: [email protected] > Subject: Re: Spring context not loading when upgrading from 2.2.9 to 2.4.1 > version. > Hi, > > Cxf bus refactor a lot since cxf 2.4.0. > In your spring configuration > <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> > is unnecessary > and you need change > <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl" /> > to something like > <cxf:bus/> > > Freeman > > > > On 2011-6-24, at 上午12:44, Sonam Nepali wrote: > > > > Hello, > > > > > > > > I upgraded Apache CXF maven dependency from 2.2.9 to 2.4.1 version. > > I am exposing a HelloWorld webservice and was able to get the spring > > context loaded with 2.2.9 version but after upgrading to 2.4.1 > > version I can't get the spring context to load. My configuration > > for exposing the webservice is as following: > > > > > > > > <import resource="classpath:META-INF/cxf/cxf.xml" /> > > <import resource="classpath:META-INF/cxf/cxf-extension- > > > > soap.xml" /> > > > > <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> > > > > > > > > <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl" /> > > > > > > > > <bean id="helloWorld" class="x.y.HelloWorld"/> > > <jaxws:endpoint id="helloWorldEp" implementor="x.y.HelloWorld" > > > > > > address="/hello"/> > > > > > > > > > > But I am getting the following error with Apache CXF 2.4.1 version: > > > > > > > > > > 2011-06-23 10:35:42,399 [[STANDBY] ExecuteThread: '4' for queue: > > 'weblogic.kernel.Default (self-tuning)'] ERROR > > org.springframework.web.context.ContextLoader > > > > - Context initialization failed > > > > org.springframework.beans.factory.BeanCreationException: Error > > creating bean with name 'helloWorldEp': Invocation of init method > > failed; nested exception is javax.xml.ws.WebServiceException: > > java.lang.NullPointerException > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .AbstractAutowireCapableBeanFactory > > .initializeBean(AbstractAutowireCapableBeanFactory.java:1420) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .AbstractAutowireCapableBeanFactory > > .doCreateBean(AbstractAutowireCapableBeanFactory.java:519) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .AbstractAutowireCapableBeanFactory > > .createBean(AbstractAutowireCapableBeanFactory.java:456) > > > > at > > > > org.springframework.beans.factory.support.AbstractBeanFactory > > $1.getObject(AbstractBeanFactory.java:291) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .DefaultSingletonBeanRegistry > > .getSingleton(DefaultSingletonBeanRegistry.java:222) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .DefaultListableBeanFactory > > .preInstantiateSingletons(DefaultListableBeanFactory.java:580) > > > > at > > > > org > > .springframework > > .context > > .support > > .AbstractApplicationContext > > .finishBeanFactoryInitialization(AbstractApplicationContext.java:895) > > > > at > > > > org > > .springframework > > .context > > .support > > .AbstractApplicationContext.refresh(AbstractApplicationContext.java: > > 425) > > > > at > > org.springframework.web.context.ContextLo > > ader.createWebApplicationContext > > > > (ContextLoader.java:276) > > > > at > > org.springframework.web.context.ContextLo > > ader.initWebApplicationContext > > > > (ContextLoader.java:197) > > > > at > > org.springframework.web.context.ContextLo > > aderListener.contextInitialized > > > > (ContextLoaderListener.java:47) > > > > at weblogic.servlet.internal.EventsManager > > > > > > $FireContextListenerAction.run(EventsManager.java:465) > > > > at > > > > weblogic > > .security > > .acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) > > > > at > > > > weblogic.security.service.SecurityManager.runAs(Unknown Source) > > > > at > > > > weblogic > > .servlet > > .internal.EventsManager.notifyContextCreatedEvent(EventsManager.java: > > 175) > > > > at > > > > weblogic > > .servlet > > .internal > > .WebAppServletContext.preloadResources(WebAppServletContext.java:1784) > > > > at > > > > weblogic > > .servlet > > .internal.WebAppServletContext.start(WebAppServletContext.java:2999) > > > > at > > > > weblogic > > .servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371) > > > > at > > > > weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468) > > > > at > > > > weblogic.application.internal.flow.ModuleStateDriver > > $3.next(ModuleStateDriver.java:204) > > > > at > > > > weblogic > > .application > > .utils.StateMachineDriver.nextState(StateMachineDriver.java:37) > > > > at > > > > weblogic > > .application > > .internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60) > > > > at > > > > weblogic > > .application > > .internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) > > > > at > > > > weblogic > > .application > > .internal > > .flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117) > > > > at > > > > weblogic.application.internal.flow.ModuleStateDriver > > $3.next(ModuleStateDriver.java:204) > > > > at > > > > weblogic > > .application > > .utils.StateMachineDriver.nextState(StateMachineDriver.java:37) > > > > at > > > > weblogic > > .application > > .internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60) > > > > at > > > > weblogic > > .application > > .internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) > > > > at > > weblogic.application.internal.BaseDeploym > > ent > > > > $2.next(BaseDeployment.java:635) > > > > at > > > > weblogic > > .application > > .utils.StateMachineDriver.nextState(StateMachineDriver.java:37) > > > > at > > > > weblogic > > .application.internal.BaseDeployment.activate(BaseDeployment.java:212) > > > > at > > > > weblogic > > .application > > .internal > > .SingleModuleDeployment.activate(SingleModuleDeployment.java:16) > > > > at > > > > weblogic > > .application > > .internal > > .DeploymentStateChecker.activate(DeploymentStateChecker.java:162) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver.AppContainerInvoker.activate(AppContainerInvoker.java: > > 79) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .operations.AbstractOperation.activate(AbstractOperation.java:569) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .operations > > .ActivateOperation.activateDeployment(ActivateOperation.java:140) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .operations.ActivateOperation.doCommit(ActivateOperation.java:106) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .operations.AbstractOperation.commit(AbstractOperation.java:323) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .DeploymentManager.activateDeploymentList(DeploymentManager.java:1227) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver.DeploymentManager.handleCommit(DeploymentManager.java: > > 436) > > > > at > > > > weblogic > > .deploy > > .internal > > .targetserver > > .DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java: > > 163) > > > > at > > > > weblogic > > .deploy > > .service > > .internal > > .targetserver > > .DeploymentReceiverCallbackDeliverer > > .doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181) > > > > at > > > > weblogic > > .deploy > > .service > > .internal.targetserver.DeploymentReceiverCallbackDeliverer.access > > $100(DeploymentReceiverCallbackDeliverer.java:12) > > > > at > > > > weblogic > > .deploy > > .service.internal.targetserver.DeploymentReceiverCallbackDeliverer > > $2.run(DeploymentReceiverCallbackDeliverer.java:67) > > > > at weblogic.work.SelfTuningWorkManagerImpl > > > > > > $WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516) > > > > at > > > > weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) > > > > at > > weblogic.work.ExecuteThread.run(ExecuteTh > > read.java: > > > > 173) > > Caused by: javax.xml.ws.WebServiceException: > > java.lang.NullPointerException > > > > at > > > > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350) > > > > at > > > > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239) > > > > at > > > > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509) > > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > > sun > > .reflect > > .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > > > at > > > > sun > > .reflect > > .DelegatingMethodAccessorImpl > > .invoke(DelegatingMethodAccessorImpl.java:25) > > > > at > > java.lang.reflect.Method.invoke(Method.ja > > va:597) > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .AbstractAutowireCapableBeanFactory > > .invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .AbstractAutowireCapableBeanFactory > > .invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485) > > > > at > > > > org > > .springframework > > .beans > > .factory > > .support > > .AbstractAutowireCapableBeanFactory > > .initializeBean(AbstractAutowireCapableBeanFactory.java:1417) > > > > ... 49 more > > > > Caused by: java.lang.NullPointerException > > > > at > > > > org > > .apache > > .cxf > > .frontend > > .AbstractWSDLBasedEndpointFactory > > .createBindingInfo(AbstractWSDLBasedEndpointFactory.java:338) > > > > at > > > > org > > .apache > > .cxf > > .jaxws > > .JaxWsServerFactoryBean > > .createBindingInfo(JaxWsServerFactoryBean.java:176) > > > > at > > > > org > > .apache > > .cxf > > .frontend > > .AbstractWSDLBasedEndpointFactory > > .createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:252) > > > > at > > > > org > > .apache > > .cxf > > .frontend > > .AbstractWSDLBasedEndpointFactory > > .createEndpoint(AbstractWSDLBasedEndpointFactory.java:147) > > > > at > > > > org > > .apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java: > > 157) > > > > at > > > > org > > .apache > > .cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java: > > 202) > > > > at > > > > org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433) > > > > at > > > > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322) > > > > ... 58 more > > > > > > > > > > > > Thanks > > > > > > > > > > -Sonam > > > --------------------------------------------- > Freeman Fang > > FuseSource > Email:[email protected] > Web: fusesource.com > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > > > > > > > > > -- Daniel Kulp [email protected] http://dankulp.com/blog Talend - http://www.talend.com
