Defining a local
and remote interface is acceptable and common. However, the remote and local
interfaces must have different jndi names. Configuring the different names
depends on the application server being used. In WebLogic 8.1, you define the jndi
names in the weblogic-ejb-jar.xml deployment descriptor like the following.
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>TimeAccountBean</ejb-name>
<jndi-name>TimeAccountHome</jndi-name>
<local-jndi-name>TimeAccountHomeLocal</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Here
TimeAccountHome can be used to look up the remote interface and
TimeAccountHomeLocal can be used to look up the local interface.
-----------------------------------------------
Christopher M. Judd
Judd Solutions, LLC
President & Consultant
Co-author of Enterprise
Java Development on a Budget
685 Farrington Dr.
Worthington,
OH 43085
phone: 614-378-4119
email:
cjudd@xxxxxxxxxxxxxxxxx
web: www.juddsolutions.com
-----Original Message-----
From: John Olmstead
[mailto:jolmstead2k@xxxxxxxxx]
Sent: Friday, April
30, 2004 6:47 AM
To: Cinjug
Subject: [cinjug-users] ClassCast
Exception while trying to reference a local home object. Additional Info.
Further investigation reveals the the reference being
returned from the local home context lookup in the session bean is actually
returning a reference to the remote home object. I do have both local and
home references defined and deployed for the entity bean. I'm going to
redeploy the project , removing the definitions for the remote home and
component interfaces and retry the client.
I thought defining both local and remote interfaces
for ejbs was acceptable practice?????
John Olmstead
jolmstead2k@xxxxxxxxx
Do you Yahoo!?
Win
a $20,000 Career Makeover at Yahoo! HotJobs