You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Ivan <xh...@gmail.com> on 2009/12/17 09:24:04 UTC

MalformedObjectNameException is thrown in Tomcat 7

Hi,
    I got a ClassCastException in Tomcat 7. Please refer to the stack below
:
javax.management.MalformedObjectNameException: Cannot create object name for
org.apache.catalina.connector.Connector@591a591ajava.lang.ClassCastException:
java.net.Inet4Address incompatible with java.lang.String
        at
org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:477)
        at
org.apache.catalina.mbeans.MBeanUtils.destroyMBean(MBeanUtils.java:1100)
        at
org.apache.catalina.mbeans.ServerLifecycleListener.destroyMBeans(ServerLifecycleListener.java:614)
        at
org.apache.catalina.mbeans.ServerLifecycleListener.destroyMBeans(ServerLifecycleListener.java:892)
        at
org.apache.catalina.mbeans.ServerLifecycleListener.destroyMBeans(ServerLifecycleListener.java:858)
        at
org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(ServerLifecycleListener.java:167)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

It seems that in the MBeanUtils.createObjectName always assume the return
type of address is String, while in Http11Protocol, it has a method
getAddress with return type InetAddress, so ......
The easiest way to workround it is use toString(), so that always a String
object could be got.
Thanks !
-- 
Ivan