Announcement Announcement Module
Collapse
No announcement yet.
Key properties cannot be empty Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Key properties cannot be empty

    Hi,

    I'm having the following exception:

    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in class path resource [tcaserver.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBe anException: Unable to register MBean [javax.management.remote.rmi.RMIConnectorServer@74b 10b] with key 'rmiConnector'; nested exception is javax.management.MalformedObjectNameException: Key properties cannot be empty
    Caused by: org.springframework.jmx.export.UnableToRegisterMBe anException: Unable to register MBean [javax.management.remote.rmi.RMIConnectorServer@74b 10b] with key 'rmiConnector'; nested exception is javax.management.MalformedObjectNameException: Key properties cannot be empty
    Caused by: javax.management.MalformedObjectNameException: Key properties cannot be empty
    at javax.management.ObjectName.construct(ObjectName.j ava:393)
    at javax.management.ObjectName.<init>(ObjectName.java :1304)
    at javax.management.ObjectName.getInstance(ObjectName .java:1187)
    at org.springframework.jmx.support.ObjectNameManager. getInstance(ObjectNameManager.java:74)
    at org.springframework.jmx.export.naming.KeyNamingStr ategy.getObjectName(KeyNamingStrategy.java:140)
    at org.springframework.jmx.export.MBeanExporter.getOb jectName(MBeanExporter.java:675)
    at org.springframework.jmx.export.MBeanExporter.regis terBeanInstance(MBeanExporter.java:588)
    at org.springframework.jmx.export.MBeanExporter.regis terBeanNameOrInstance(MBeanExporter.java:570)
    at org.springframework.jmx.export.MBeanExporter.regis terBeans(MBeanExporter.java:499)
    at org.springframework.jmx.export.MBeanExporter.after PropertiesSet(MBeanExporter.java:388)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1143)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1110)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:431)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 54)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:144)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:251)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:284)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:352)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:91)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:75)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:65)
    at com.tca.tcaagente.ServerAgent.main(ServerAgent.jav a:110)

    I've set the application context (tcaserver.xml) accordingly to documentation:
    <bean id="rmiConnector"
    class="org.springframework.jmx.support.ConnectorSe rverFactoryBean" depends-on="registry" >
    <property name="objectName" value="TCAAgent:name=rmiconnector,port=1099"/>
    <property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/tcaagent"/>
    <property name="environment">
    <props>
    <prop key="jmx.remote.jndi.rebind">true</prop>
    </props>
    </property>
    </bean>

    I'm not using any container except for Spring. The funny thing here is that if I set the values through code, it works fine.

    Does anybody know what I am doing incorrectly?

    Please advise

  • #2
    Can you show the config for the MBeanExporter? It is there that the error is coming from I think. Please use [code][/code] to post the code - it makes it easier to read.

    Comment


    • #3
      Below is how I configured it. As a comment I found that if autodetect property is set - commented out in code below- then the exception is thrown. It would be great to know the reason of these.

      Code:
          <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
             <!-- property name="autodetect" value="true"/ -->
             <property name="beans">
             		<map>
             		 	<entry key="TCAAgent:name=server,port=4000" 
             		 		value-ref="serverRol"/>
             		 	<entry key="TCAAgent:name=httpadaptor,port=8080"
             		 		value-ref="httpAddapter"/>
             		</map>
             </property>
             <property name="notificationListenerMappings">
             		<map>
             			<entry key="JMImplementation:type=MBeanServerDelegate" value-ref="serverRol"/>
             		</map>
             </property>
             <property name="server" ref="jmxServer"/>
          </bean>
      Kind Regards

      WAR

      Comment

      Working...
      X