Camel Websphere Application server 6 JMX issue

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel Websphere Application server 6 JMX issue

biouele
Hi,
I deploy camel int to Websphere application server 6 (war file)
 and I want to retrieve Websphere MbeanServer to initialyze camel to use JMX like this:

   <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
     <property name="locateExistingServerIfPossible" value="true"/>
   </bean>

        <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
                <property name="packages" value="com.fbn.poc.mediation.camel.jms"/>   
                <property name="useJmx" value="true"/> 
        <property name="mbeanServer" ref="mbeanServer"/>
        </bean> 

I have this error :

[11/16/07 11:57:21:633 EST] 00000036 SystemOut     O ERROR 2007-11-16 11:57:21,633 [Thread-61] org.springframework.web.context.ContextLoader: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camel' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.ibm.ws.management.PlatformMBeanServer] to required type [java.lang.String] for property 'mbeanServer'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.ibm.ws.management.PlatformMBeanServer] to required type [java.lang.String] for property 'mbeanServer': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.ibm.ws.management.PlatformMBeanServer] to required type [java.lang.String] for property 'mbeanServer'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.ibm.ws.management.PlatformMBeanServer] to required type [java.lang.String] for property 'mbeanServer': no matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [com.ibm.ws.management.PlatformMBeanServer] to required type [java.lang.String] for property 'mbeanServer': no matching editors or conversion strategy found
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)
        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1126)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:247)
        at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:796)
        at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:592)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:637)
        at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:295)
        at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:285)
        at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88)
        at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
        at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:661)
        at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:614)
        at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
        at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1312)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129)
        at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.startModule(ApplicationMgrImpl.java:1779)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl._startModule(ApplicationMgrImpl.java:1727)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:62)
        at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:265)
        at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1089)
        at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:971)
        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
        at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1080)
        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
        at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:973)
        at com.ibm.ws.management.application.sync.StartDeploymentTask.startDeployment(StartDeploymentTask.java:196)
        at com.ibm.ws.management.application.sync.StartDeploymentTask.fineGrainUpdate(StartDeploymentTask.java:149)
        at com.ibm.ws.management.application.sync.StartDeploymentTask.performTask(StartDeploymentTask.java:79)
        at com.ibm.ws.management.application.sync.AppBinaryProcessor$AppBinThread.run(AppBinaryProcessor.java:852)
        at com.ibm.ws.management.application.sync.AppBinaryProcessor.postProcess(AppBinaryProcessor.java:605)
        at com.ibm.ws.management.application.sync.AppBinaryProcessor._onChangeCompletion(AppBinaryProcessor.java:415)
        at com.ibm.ws.management.application.sync.AppBinaryProcessor$2.run(AppBinaryProcessor.java:387)
        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
        at com.ibm.ws.management.application.sync.AppBinaryProcessor.onChangeCompletion(AppBinaryProcessor.java:374)
        at com.ibm.ws.management.repository.FileRepository.postNotify(FileRepository.java:1776)
        at com.ibm.ws.management.repository.FileRepository.update(FileRepository.java:1320)
        at com.ibm.ws.management.repository.client.LocalConfigRepositoryClient.update(LocalConfigRepositoryClient.java:189)
        at com.ibm.ws.sm.workspace.impl.WorkSpaceMasterRepositoryAdapter.update(WorkSpaceMasterRepositoryAdapter.java:637)
        at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.update(RepositoryContextImpl.java:1851)
        at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.synch(RepositoryContextImpl.java:1797)
        at com.ibm.ws.sm.workspace.impl.WorkSpaceImpl.synch(WorkSpaceImpl.java:481)
        at com.ibm.ws.management.application.task.ConfigRepoHelper.removeWorkSpace(ConfigRepoHelper.java:152)
        at com.ibm.ws.management.application.SchedulerImpl.cleanup(SchedulerImpl.java:378)
        at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:284)
        at java.lang.Thread.run(Thread.java:801)

Reply | Threaded
Open this post in threaded view
|

Re: Camel Websphere Application server 6 JMX issue

jstrachan
On 16/11/2007, biouele <[hidden email]> wrote:

>
> Hi,
> I deploy camel int to Websphere application server 6 (war file)
>  and I want to retrieve Websphere MbeanServer to initialyze camel to use JMX
> like this:
>
>    <bean id="mbeanServer"
> class="org.springframework.jmx.support.MBeanServerFactoryBean">
>      <property name="locateExistingServerIfPossible" value="true"/>
>    </bean>
>
>         <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
>                 <property name="packages" value="com.fbn.poc.mediation.camel.jms"/>
>                 <property name="useJmx" value="true"/>
>         <property name="mbeanServer" ref="mbeanServer"/>
>         </bean>

the mbeanServer property actually is a String name which references
the mbeanServer in spring. I guess its badly named; we should maybe
change it to mbeanServerRef to make it more obvious?

e.g. this should work

         <property name="mbeanServer" value="mbeanServer"/>

--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com
Reply | Threaded
Open this post in threaded view
|

Re: Camel Websphere Application server 6 JMX issue

biouele
It works
Thank you.

James.Strachan wrote
On 16/11/2007, biouele <jean-louis.biouele@fbn.ca> wrote:
>
> Hi,
> I deploy camel int to Websphere application server 6 (war file)
>  and I want to retrieve Websphere MbeanServer to initialyze camel to use JMX
> like this:
>
>    <bean id="mbeanServer"
> class="org.springframework.jmx.support.MBeanServerFactoryBean">
>      <property name="locateExistingServerIfPossible" value="true"/>
>    </bean>
>
>         <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
>                 <property name="packages" value="com.fbn.poc.mediation.camel.jms"/>
>                 <property name="useJmx" value="true"/>
>         <property name="mbeanServer" ref="mbeanServer"/>
>         </bean>

the mbeanServer property actually is a String name which references
the mbeanServer in spring. I guess its badly named; we should maybe
change it to mbeanServerRef to make it more obvious?

e.g. this should work

         <property name="mbeanServer" value="mbeanServer"/>

--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com
Reply | Threaded
Open this post in threaded view
|

Re: Camel Websphere Application server 6 JMX issue

jstrachan
On 16/11/2007, biouele <[hidden email]> wrote:
>
> It works
> Thank you.

Great - thanks for letting us know! :)

James

>
>
> James.Strachan wrote:
> >
> > On 16/11/2007, biouele <[hidden email]> wrote:
> >>
> >> Hi,
> >> I deploy camel int to Websphere application server 6 (war file)
> >>  and I want to retrieve Websphere MbeanServer to initialyze camel to use
> >> JMX
> >> like this:
> >>
> >>    <bean id="mbeanServer"
> >> class="org.springframework.jmx.support.MBeanServerFactoryBean">
> >>      <property name="locateExistingServerIfPossible" value="true"/>
> >>    </bean>
> >>
> >>         <bean id="camel"
> >> class="org.apache.camel.spring.CamelContextFactoryBean">
> >>                 <property name="packages"
> >> value="com.fbn.poc.mediation.camel.jms"/>
> >>                 <property name="useJmx" value="true"/>
> >>         <property name="mbeanServer" ref="mbeanServer"/>
> >>         </bean>
> >
> > the mbeanServer property actually is a String name which references
> > the mbeanServer in spring. I guess its badly named; we should maybe
> > change it to mbeanServerRef to make it more obvious?
> >
> > e.g. this should work
> >
> >          <property name="mbeanServer" value="mbeanServer"/>
> >
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> > Open Source SOA
> > http://open.iona.com
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Camel-Websphere-Application-server-6-JMX-issue-tf4822665s22882.html#a13797871
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com