Hi everyone
I am new in ejb and I need to call an ejb by its local interfaces and I know that my app and ejb should be in the same VM and they are. when I use remote Interfaces its works just fine but the problem shows up when I try the code below in order to work locally
code:
Context ctx = new InitialContext(this.props);
Object obj = ctx.lookup("ejb/MemberHome");
MemberLocalHome home = (MemberLocalHome) obj;
I am not sure if the code is right. when I run it I get a ClassCastException error. what is wrong?
thanks and regards
yashar
-
problem using EJB by local interfaces (2 messages)
- Posted by: yashar kalantari
- Posted on: December 27 2004 05:46 EST
Threaded Messages (2)
- problem using EJB by local interfaces by Pampa S B on December 27 2004 06:14 EST
- problem using EJB by local interfaces by yashar kalantari on December 28 2004 05:54 EST
-
problem using EJB by local interfaces[ Go to top ]
- Posted by: Pampa S B
- Posted on: December 27 2004 06:14 EST
- in response to yashar kalantari
You have to modify your code just a bit, so that app server identifies the JNDI name and recognizes the EJB as a local interface. Just pre-append the JNDI name with this in your code "local:ejb" before ejb/MemberHome -> local:ejb/ejb/MemberHome. It will surely work. Good luck... -
problem using EJB by local interfaces[ Go to top ]
- Posted by: yashar kalantari
- Posted on: December 28 2004 05:54 EST
- in response to Pampa S B
thanks pampa. that solved the problem. I am using jboss and I should have done some changes in jboss.xml deployment descriptor in order to configure the jndi resources.