IBM WEBSPHERE APPLICATION SERVER, v. 6.0.2 1. install application: one ear file includes one ejb module and web module 2. install application: one web module I can access ejb module by web module, but can NOT by web module, (see below exception when narrowing TestEJBHome). Is it due to they locating in different applications??? If true, I can not share the ejb module in two web modules, can I? That means I should bind web module with it as one application once I want to access ejb module. Then can I access ejb module from a different machine (by modifying the ip of url when creating InitialContext)?
The below is the detailed infomation, jsp file and web.xml are same in web module and web module, and the two class files TestEJB & TestEJBHome are archived as a jar file located in web module's lib folder.
---web module--- jsp file:
---ejb module--- ejb-jar.xml:
Anyone who knows it helps me please, thanks a lot! (Waiting in sweat...)
Thanks for reply, but ... 1. Pls note: code in jsp file can run well in web module which locates in the same application with ejb module, but exception occurs when called from web mdoule; 2. After using "TestEJBLocalHome testEJBLocalHome= (TestEJBLocalHome) ref;" in web module, it threw "Unable to load class: com.citigroup.apac.cpbol.middleware.test._TestEJBHome_Stub".
The configuration of calling remote object (web.xml, ejb-jar.xml) seems available and calling from web module within the same application works, but if that web module is not in the same application with ejb module, it seems NOT ...
I am not familiar with websphere at all. Previously in weblogic 8.1, I can just do below: 1. ear (including ejb module) under "Deployments\Applications" 2. web module, web module under "Deployments\Web Application Modules" And since global JNDI name can be access, ejb-jar.xml & weblogic-ejb-jar.xml are enough. Then, calling ejb from web module and web module are both ok.
[7/25/06 10:28:23:982 CST] 00000039 SystemErr R java.lang.ClassCastException
Looks like the classloader issue. Do you have the remote/local interface classes in 2 different jars? I guess, yes(one in jar files of webmodule and one in jar files on ejb module). If that's the case, do you have classloader isolation of the 2 applications. I *guess*, since the remote/local interface classes are being loaded by two different classloaders, you are seeing the ClassCastException. Just as a *temporary* test, remove the remote/local interfaces from one of the jars(ideally, webmodule) and try out.
I am not aware about how Classloading isolation is achieved in Websphere, so am not able to pinpoint as to what exactly might be the issue.
scenario: 1. app1: ejb module, web module 2. app1: ejb module, web module app2: web module 3. app1: ejb module app2: web module I've reviewed the configuration of weblogic. All web module and ejb module are in the same application instance... Then, in scenario 2 &3, accessing ejb module from web module is not available because they are in different application instances, thus, the relevant stub class files generated in app1, can not be seen (in class loader of app2) in web module in app2. Thanks pai! So, if web module want to access ejb module in app1, adding it into ear of app1 should be a simple solution.