1 Reply Latest reply on Oct 16, 2013 9:48 AM by Li Chen

    the JMX Mbean lookup not working in Jboss AS 7

    Li Chen Newbie

      I successfully migrated our application from JBoss AS 5 to JBoss AS 7. i had service.sar to be delpoyed to the JBoss AS 7, here is the jboss-service.xml file looks like:

       

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

      <server xmlns="urn:jboss:service:7.0"

           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">

          <mbean code="com.etn.xmlloader.XMLDataLoader" 

                       name="services:service=XMLDataLoader">

             <attribute name="JndiName">services/XMLData</attribute>

          </mbean>

          <mbean code="org.quartz.ee.jmx.jboss.QuartzService"

                       name="services:service=QuartzService">

             <attribute name="JndiName">services/Quartz</attribute>

          </mbean>

      </server>

       

      I try to lookup my Mbean from servlet, i got followed error:

       

      16:04:36,113 ERROR [stderr] (http-/0.0.0.0:8080-1) java.lang.ClassCastException:

      javax.naming.Reference cannot be cast to com.etn.xmlloader.XMLDataHolder

       

       

      here is the code in servlet:

       

      UrlToWarIdMapStaticXMLData urlWarIdMap = ((XMLDataHolder)initial.lookup("services/XMLData")).getUrlToWarIdMapXMLData();

       

       

       

      please Help.