JBOSS Class Cast Exceptoin – Resolution
I came across this ClassCastException when launching an application packaged as an enterprise archive (.ear) on JBOSS 4.2.2.
Without going much into the details of the root cause, here is a way to quickly reconfigure JBOSS to get away.
- Locate the following files in your JBOSS folder and open them in a text editor.
<JBOSS_HOME>serverdefaultconfjboss-service.xml
<JBOSS_HOME>serverdefaultdeployear-deployer.xml
- Set the attribute CallByValue to true.
It should look something like this:
<attribute name=”CallByValue”>true</attribute>
- Save the files and Restart the server.
And…voila! No more ClassCastException. Oh yeah, unless there is one such dynamic class casting error in your application that is!!
Enjoy free JBOSSing 😛
Please use the comments section for any discussions.
You can try this as well: to ensure that it works in the cluster mode as well
1. Under deploy directory confirm that the isolated attribute in ear-deployer.xml file is set to “false”.
false
2. There is a class loader issue in JBoss 4.2.2.GA which causes problems in running WebTier on JBoss. Please go to serverdefaultdeploy jboss-web.deployerMETA-INF, edit jboss-service.xml file and set UseJBossWebLoader to true.
true
Thanks Vilas. This is like one level higher to what we’re trying to do! You’re BOSS!