Skip to main content

javax.management.MalformedObjectNameException: Invalid character ':' in val

1 reply [Last post]
andy101
Offline
Joined: 2008-09-05
Points: 0

I am currently trying to migrate a application from Tomcat 5.5 to WAS 6.1, the application consists of Spring , Hibernate and JMX. From what I have read so far a namingStrategy property needs to be configured in the exporter bean, which I have done by creating a POJO extending org.springframework.jmx.export.naming.ObjectNamingStrategy and providing the following implementation in the getObjectName method.

public ObjectName getObjectName(Object object, String name) throws MalformedObjectNameException
{
StringBuffer objectName = new StringBuffer();
objectName.append(domainName);
objectName.append(":cell=");
objectName.append(cellName);
objectName.append(",name=");
objectName.append(name);
objectName.append(",node=");
objectName.append(nodeName);
objectName.append(",process=");
objectName.append(processName);
objectName.append(",type=");
objectName.append(ClassUtils.getShortName(object.getClass()));

return ObjectNameManager.getInstance(objectName.toString());
}

Any then supplying further infor in the jmx config to use this bean. When I deploy and start this application I get the following error

Caused by:
javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
at javax.management.ObjectName.construct(ObjectName.java:544)
at javax.management.ObjectName.(ObjectName.java:1312)
at javax.management.ObjectName.getInstance(ObjectName.java:1195)
at org.springframework.jmx.support.ObjectNameManager.getInstance(ObjectNameManager .java:74)
at com.spring.jmx.was.WebsphereNamingStrategy.getObjectName(WebsphereNamingStrateg y.java:32)
at org.springframework.jmx.export.MBeanExporter.getObjectName(MBeanExporter.java:7 50)
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter .java:653)
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanEx porter.java:594)

I am assuming it is because of the : character following the domainName in the getObjectName method. I have exhausted every possible solution I can think of.

Can somebody assist with this issue, thanks in advance..

I am really struggling with this issue for the past 2 days, Please, any idea or suggestions let me know.
Below is my JMX config.

<?xml version="1.0" encoding="UTF-8"?>

loadParameters,reset,setNextRun

uk.co.utilisoft.entrecahub.services:type1=SystemParametersPushAggregationSender
uk.co.utilisoft.entrecahub.services:type1=SystemParametersPushExportSender

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gluk
Offline
Joined: 2009-04-20
Points: 0

The solution for most of the Java related errors can be found at this site: http://iderror.com/category/errors/java/