tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject MalformedObjectNameException is thrown in Tomcat 7
Date Thu, 17 Dec 2009 08:24:04 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message