Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / November 2003

Tip: Looking for answers? Try searching our database.

remote and local interface

Thread view: 
S. Wu - 20 Nov 2003 08:12 GMT
Hi,

I am a newbie to EJB and sorry if I am asking stupid question.

I implemented an EJB with both local and remote interface. When trying
create an EJB from another EJB, I lookup the JNDI name and I check the class
of the object returned. I found that the object class is of the remote type
rather the local. Therefore causing a casting exception when calling
PortableRemoteObject.narrow().

My question is, with only one JNDI name specified by the deployerment
descripter, how can I distinguish which interface I want to get?

TIA.
SF
Johann Burkard - 20 Nov 2003 12:35 GMT
> I implemented an EJB with both local and remote interface. When trying
> create an EJB from another EJB, I lookup the JNDI name and I check the class
> of the object returned. I found that the object class is of the remote type
> rather the local. Therefore causing a casting exception when calling
> PortableRemoteObject.narrow().

Obviously, you must make sure that both local and remote proxies are
bound to the JNDI directory. In Weblogic, there's something like

   <weblogic-enterprise-bean>
[...]
      <jndi-name>BlaSettings</jndi-name>
      <local-jndi-name>BlaSettingsLocal</local-jndi-name>
   </weblogic-enterprise-bean>

so you could get the local EJB proxy by

BlaSettingsLocalHome home = (BlaSettingsLocalHome)
ctxt.lookup("ejb/BlaSettingsLocal");

Johann
Signature

Deine Zurechtweisung hat mich sehr getroffen. Aussagekräftige Subjects
haben allerdings nach meiner Erfahrung nur mässigen Response. Sorry, hab
das getestet.
("kkaal" in <b471a2$9j1$06$1@news.t-online.com>)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.