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.
Hi Guys,
problem solved, actually when i deployed the ear file, i used same jar file put in the different lib, this is not correct, all the module should be sharing same jar file under the same lib. then it is working.