After multiple trials and some hints from other posts I figured out the solution to the
project.
Basically the ThirdSession.class (a business interface for EJB) was getting loaded 2
times. One was from EJB project and another from WAR project. Even though my Servlet is
making a remote EJB call I modified my eclipse setup so that the business interface class
is not loaded as a part of WAR file and only loaded as a part of EJB jar file. Wallah, it
worked as expected.
If I deploy the dynamic project along with the business interface in another JBOSS
instance then also the code works indicating that one JVM can not have more than one class
loaded thru different deployed components.
Seems to be problem in the jboss implementation. This means the the person who is building
need to know beforehand how the deployment is going to be. Even though the EJB invocation
is thru remote invocation, if EJB and its client are in same JBOSS JVM then care has to be
taken so that class is not loaded multiple times. As FYI I never faced similar problem
while working with Websphere.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168032#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...