-
1. Re: accessing stateful session beans in ears from the outsid
ppphoenixxx Jan 31, 2006 2:34 PM (in response to ppphoenixxx)of course ExampleBean implements the interface Example.
-
2. Re: accessing stateful session beans in ears from the outsid
ppphoenixxx Jan 31, 2006 4:04 PM (in response to ppphoenixxx)Searching the Forums d o e s help! - I probably found the root of my problems: I use a copy of a the interface class in the same JVM.
(The remote client is actually a second webapp).
I'll check that out tomorrow and give feedback if this wasn't the solution. -
3. Re: accessing stateful session beans in ears from the outsid
bill.burke Jan 31, 2006 4:59 PM (in response to ppphoenixxx)There are a couple of things with this:
If you have copies of interface class then you will get CCEs as you're dealing with scoped classloaders here. this may solve your problems
If you are communicating to a scoped ear, then the only safe way to communicate to it is with a remote interface. For this case, you'll have to enable CallByValue for JNDI in server/xxx/conf/jboss-service.xml. -
4. Re: accessing stateful session beans in ears from the outsid
ejb3workshop Feb 1, 2006 4:23 AM (in response to ppphoenixxx)Have a look at the classpath. I had similar problems when I used the wrong jars. In the installation docs it is mentioned :
because you patched 4.0.3SP1, the client jars in the jboss-4.0.3SP1/client directory will be invalid. Build your client classpath from:
1. jboss-4.0.3SP1/lib
2. jboss-4.0.3SP1/server/all/lib
3. jboss-4.0.3SP1/server/all/deploy/ejb3.deployer
4. jboss-4.0.3SP1/server/all/deploy/jboss-aop-jdk50.deployer
Hope this helps
Alex
ejb3workshop.com -
5. Re: accessing stateful session beans in ears from the outsid
ppphoenixxx Feb 1, 2006 6:22 AM (in response to ppphoenixxx)Thanks for the fast replies - I "fixed" my problems by throwing temporarly the second webapp into the ear too and will make sure that on customer side things are running, as intended, in separated VMs.
If you are communicating to a scoped ear, then the only safe way to communicate to it is with a remote interface. For this case, you'll have to enable CallByValue for JNDI in server/xxx/conf/jboss-service.xml.
I tried that one too, but it doesn't seem to solve my problems (-> no difference if callbyvalue is enabled or not). Besides: this sound like to have a *big* performance impact.
How about a devel/user related faq wiki-page?
I guess this would be a frequent obstacle during development (especially for beginners like me):
Q: I'am getting a ClassCastException when I try to cast a Session Bean to it's interface after I successfully obtained the Session Bean over InitialContext lookup. Whats going on?
A: You are probably dealing with scoped Beans, remote interfaces and trying to run everything in the same VM while package multiple copies of your interface classes into the different parts of your application(s).
Solve this by:
* eliminate multiple copies of interfaces, package everything into the same ear
* run your application in different VMs
* if required to let different EARs interact with one another in the same VM: enable CallByValue for JNDI in server/xxx/conf/jboss-service.xml
Unfortunately the last one either needs a bugfix or I am not using/understanding it correctly.Have a look at the classpath. I had similar problems when I used the wrong jars. In the installation docs it is mentioned :
No, this is unrelated to my problem (I use the greatest and latest from CVS, no "old" stuff in my client or server). -
6. Re: accessing stateful session beans in ears from the outsid
bill.burke Feb 1, 2006 10:17 AM (in response to ppphoenixxx)Please help us expand the WIKI
http://wiki.jboss.org/wiki/Wiki.jsp?page=EJB3 -
7. Re: accessing stateful session beans in ears from the outsid
ppphoenixxx Feb 1, 2006 11:17 AM (in response to ppphoenixxx)done. Maybe you should make a sticky to advice users after they found a solution on this forum or elsewhere to extend the WIKI.