You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by veerala_in <ve...@yahoo.com> on 2015/06/25 12:29:02 UTC
Registering MailConfiguration as an MBean in Spring
Hi,
I am new to Camel Mail. Using Camel Mail 14.1
I am trying to export org.apache.camel.component.mail.MailConfiguration as
an MBean in Spring.
Below is the configuration in Spring:
<bean id="exporter1" class="org.springframework.jmx.export.MBeanExporter"
lazy-init="false">
<property name="beans">
<map>
<entry key="mycompany.import:name=mailConfiguration"
value-ref="mailConfiguration"/>
</map>
</property>
<property name="server">
<osgi:reference id="mbeanServer"
interface="javax.management.MBeanServer"/>
</property>
</bean>
I have mail configuration as following:
<bean id="mailConfiguration"
class="org.apache.camel.component.mail.MailConfiguration">
<osgix:managed-properties persistent-id="mycompany"/>
<property name="protocol" value="smtp"/>
<property name="host" value="abc"/>
<property name="username" value="abc"/>
<property name="password" value="abc"/>
<property name="from" value=""/>
<property name="ignoreUriScheme" value="true"/>
</bean>
I am getting an exception as follows:
{code}
... 14 more
Caused by: org.springframework.jmx.export.MBeanExportException: Could not
create ModelMBean for managed resource
[org.apache.camel.component.mail.MailConfiguration@423ef7ab] with key
'com.g2llc.webid.import:name=mailConfiguration'; nested exception is
javax.management.IntrospectionException: type mismatch between getter and
setter
at
org.springframework.jmx.export.MBeanExporter.createAndConfigureMBean(MBeanExporter.java:798)
at
org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:655)
at
org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:593)
... 18 more
Caused by: javax.management.IntrospectionException: type mismatch between
getter and setter
at
javax.management.MBeanAttributeInfo.attributeType(MBeanAttributeInfo.java:341)
at
javax.management.MBeanAttributeInfo.<init>(MBeanAttributeInfo.java:184)
at
javax.management.modelmbean.ModelMBeanAttributeInfo.<init>(ModelMBeanAttributeInfo.java:202)
at
org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler.getAttributeInfo(AbstractReflectiveMBeanInfoAssembler.java:315)
at
org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler.getMBeanInfo(AbstractMBeanInfoAssembler.java:64)
at
org.springframework.jmx.export.MBeanExporter.getMBeanInfo(MBeanExporter.java:820)
at
org.springframework.jmx.export.MBeanExporter.createAndConfigureMBean(MBeanExporter.java:793)
... 20 more
{code}
Can anyone help me on this.
--
View this message in context: http://camel.465427.n5.nabble.com/Registering-MailConfiguration-as-an-MBean-in-Spring-tp5768575.html
Sent from the Camel - Users mailing list archive at Nabble.com.