Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassCastException in multiple ears  RSS feed

Sachin Mehta
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a ClassCastException (at runtime) while communicating between multiple ears. The deployment is carried out in weblogic 7 without any exceptions.
Let me explain the complete deployment structure. I have 2 ears -
1. abc.ear - contains multiple jars
a. helperClasses.jar - Containing simple classes and a utility Class which represent all the objects "".
b. slb1.jar - remote stateless session bean used for testing.
c. TestClient.jar - containing a test client.
2. xyz.ear - contains
a. helperClasses.jar - same as 1a above
b. slb2.jar - containing remote stateless session bean for procession the business logic.
TestClient delegates the call to a method in slb1.jar which in turn delegates the call to a method in one of the helperClasses. The TestClient passes the object of the utilClass to the helperClasses. The method in the helperClass makes a remote call to one of the beans in slb2.jar which processes the business logic. The helperClass passes the object of the utilClass WRAPPED IN A LIST to slb2.jar. To process the logic slb2.jar extract the objects in the list and casts them back to utilClass. This is where I get a ClassCastException.
However, if the above is done in 1 ear, everything works perfectly.
Considering the manner in which the ClassLoader works, putting the helperClass in the CLASSPATH or Code Base can be an option but since I am looking at issues related to hot deployment, such option is not preferable.
Any help in this regard will be greatly appreciated.
Thanks in advance,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!