Issue Details (XML | Word | Printable)

Key: GLASSFISH-11403
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Hong Zhang
Reporter: fs5
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

Invalid JMX object name for deployment unit under Windows-OS

Created: 07/Jan/10 08:04 AM   Updated: 06/Mar/12 09:59 PM
Component/s: amx
Affects Version/s: V3
Fix Version/s: not determined

Time Tracking:
Not Specified

Environment:

Operating System: Windows Vista
Platform: PC


Issuezilla Id: 11,403
Tags:
Participants: fs5, Hong Zhang, llc and Tom Mueller


 Description  « Hide

Stack-Trace:

[#|2010-01-07T13:54:25.435+0100|INFO|glassfishv3.0|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=30;_ThreadName=Thread-1;|Exception
registering application: atm
java.lang.RuntimeException: Cannot register
J2EEApplication=C:-Development-projects-atm-trunk-projectroot-build-atm-domain-applications-atm
as child of amx:pp=/J2EEDomain,type=J2EEServer,name=server,j2eeType=J2EEServer
at
org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.registerJ2EEChild(RegistrationSupport.java:554)
at
org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.createAppMBeans(RegistrationSupport.java:246)
at
org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.processApplicationRef(RegistrationSupport.java:522)
at
org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.registerApplications(RegistrationSupport.java:474)
at
org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.<init>(RegistrationSupport.java:158)
at
org.glassfish.admin.amx.impl.j2ee.J2EEServerImpl.registerChildren(J2EEServerImpl.java:116)
at
org.glassfish.admin.amx.impl.j2ee.DASJ2EEServerImpl.registerChildren(DASJ2EEServerImpl.java:68)
at
org.glassfish.admin.amx.impl.mbean.AMXImplBase.postRegisterHook(AMXImplBase.java:1168)
at
org.glassfish.admin.amx.impl.mbean.MBeanImplBase.postRegister(MBeanImplBase.java:448)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(DefaultMBeanServerInterceptor.java:1035)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:974)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
at
org.glassfish.admin.amx.impl.mbean.AMXImplBase.registerChild(AMXImplBase.java:1243)
at
org.glassfish.admin.amx.impl.j2ee.J2EEDomainImpl.registerChildren(J2EEDomainImpl.java:93)
at
org.glassfish.admin.amx.impl.mbean.AMXImplBase.postRegisterHook(AMXImplBase.java:1168)
at
org.glassfish.admin.amx.impl.mbean.MBeanImplBase.postRegister(MBeanImplBase.java:448)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(DefaultMBeanServerInterceptor.java:1035)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:974)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
at
org.glassfish.admin.amx.impl.j2ee.loader.AMXJ2EEStartupService.loadAMXMBeans(AMXJ2EEStartupService.java:133)
at
org.glassfish.admin.amx.impl.AMXStartupService$AMXLoaderThread.run(AMXStartupService.java:321)
Caused by: java.lang.RuntimeException: Invalid character ':' in value part of
property
at org.glassfish.admin.amx.util.jmx.JMXUtil.newObjectName(JMXUtil.java:158)
at org.glassfish.admin.amx.util.jmx.JMXUtil.newObjectName(JMXUtil.java:176)
at
org.glassfish.admin.amx.impl.util.ObjectNameBuilder.buildChildObjectName(ObjectNameBuilder.java:188)
at
org.glassfish.admin.amx.impl.util.ObjectNameBuilder.buildChildObjectName(ObjectNameBuilder.java:145)
at
org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.registerJ2EEChild(RegistrationSupport.java:549)
... 24 more
Caused by: javax.management.MalformedObjectNameException: Invalid character ':'
in value part of property
at javax.management.ObjectName.construct(ObjectName.java:602)
at javax.management.ObjectName.<init>(ObjectName.java:1403)
at org.glassfish.admin.amx.util.jmx.JMXUtil.newObjectName(JMXUtil.java:154)
... 28 more

#]

Proposed patch:

Index: deployment/dol/src/main/java/com/sun/enterprise/deployment/Application.java
===================================================================
— deployment/dol/src/main/java/com/sun/enterprise/deployment/Application.java
(revision 35236)
+++ deployment/dol/src/main/java/com/sun/enterprise/deployment/Application.java
(working copy)
@@ -860,6 +860,7 @@
*/
public void setName(String name) {
name = name.replace('/', '-');
+ name = name.replace(':', '-'); // for building valid JMX object names
name = name.replace('
', '-'); // for deploying from NT to solaris &
vice versa. This will
// need to be cleaned when we clean up the backend for registering apps
super.setName(name);



Tom Mueller added a comment - 06/Mar/12 09:59 PM

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.


llc added a comment - 26/Jan/10 12:26 PM

One concern I have here: make sure that we do not get a divergence from config/monitoring/runtime
names otherwise there is no easy programmatic way to know what config or monitoring MBean matches
with the runtime MBean.


llc added a comment - 26/Jan/10 12:24 PM

For JMX ObjectNames, a '/' in the name is perfectly acceptable; it is already used intentionally for the "pp"
attribute. A '\' is not a problem either.

It is the ':" that is the issue.

Go ahead and make the change for the ':', and unless there is a reason, I'd suggest not whacking the /
and \ characters.


llc added a comment - 07/Jan/10 08:54 AM

The ":" is the only real issue here for JMX.

This could be fixed in AMX, or we can choose to not generate such application names (probably a good
idea).


Hong Zhang added a comment - 07/Jan/10 08:10 AM

assign to lloyd for initial evaluation