If I understand what you're saying, I think you're trying to access
EJBs without knowing what their names and home and remote interfaces are at
compile-time by using reflection at run-time.  Is this what you're trying to
do?

---
Michael R. Maraya


> ----------
> From:         Lorenzo Resta[SMTP:[EMAIL PROTECTED]]
> Reply To:     [EMAIL PROTECTED]
> Sent:         Thursday, July 19, 2001 12:20 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: [JBoss-user] Classnames in JNDI
> 
> Hi Burkhard,
> 
> The problem is that i don't know the bean's name. The list() method
> returns
> an enumeration of JNDI names found in the given context. If you have
> deployed beans in the context, you
> can get at the name and classname through the NameClassPair class.
> 
> I have also tried your approach :
> home.getEJBMetaData().getHomeInterfaceClass(),
> but i still get only classnames like "$Proxy0".
> 
> Do you get the real classnames?
> 
> Thanks 
> 
> Lorenzo
> 
> Burkhard Vogel wrote:
> 
> 
>       Hi,
>       not sure about the return values of list() but you can do:
>                       Object obj = new InitialContext().lookup(BeanName);
>                       EJBHome home =
>       (EJBHome)javax.rmi.PortableRemoteObject.narrow(obj, EJBHome.class);
>                       log.debug("HomeInterface: " +
>       home.getEJBMetaData().getHomeInterfaceClass());
>       Burkhard
> 
>       ----- Original Message -----
>       From: "Lorenzo Resta"  <[EMAIL PROTECTED]>
>       To:  <[EMAIL PROTECTED]>
>       Sent: Thursday, July 19, 2001 4:49 PM
>       Subject: [JBoss-user] Classnames in JNDI
> 
> 
> 
>               Hi,
> 
>               Does someone know how to get the thre "real" class names of
> EJB's looked
>               up through a given context?
>               Right now i try to look up all name in a specified context
> like this:
> 
>                   myContext = new InitialContext();
> 
>                   theNames = myContext.list("/company/applications");
> 
>                   while(theNames.hasMore()){
> 
>                     NameClassPair theName =
> (NameClassPair)theNames.next();
> 
>                     String theClassName = theName.getClassName(); //<---
> Here i get
>               always classnames like "$Proxy1"
> 
>                     Object theObjectRef   =
> 
>       myContext.lookup(aName+"/"+theName.getName());
> 
>                     EJBHome theHome =
>               (EJBHome)PortableRemoteObject.narrow(theObjectRef,
> EJBHome.class);
> 
>                   }
> 
>               So far the code works fine, but the trouble is that the
> class name
>               stores in JNDI is always something like "$Proxy1". But i
> would like to
>               get the real
>               Homeinterface class name.
> 
>               By the way : even in JNDIView the classnames appear as
> "$Proxy0",
>               "$Proxy1" , etc.
> 
>               Any ideas how to get at the "real" class names?
> 
>               Thanks
> 
>               Lorenzo Resta
> 
>               SurfKitchen Inc.
> 
> 
> 
>               _______________________________________________
>               JBoss-user mailing list
>               [EMAIL PROTECTED]
>               http://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> 
>       _______________________________________________
>       JBoss-user mailing list
>       [EMAIL PROTECTED]
>       http://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> 
> 

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to