>Still, I don't understand what is the ejbMetaData purpose. Why I can't do it >in such way? > Context ctx = getInitialContext(); > EJBHome home = (EJBHome) ctx.lookup(...); > Class interface = home.getClass(); >and then use reflection on interface class? The reason that you cannot perform a lookup on the home interface and then use reflection on that is as follows... When you get the Clazz from the interface (using getClass), this will actually return the Clazz of the Home interface STUB not the home interface itself. Therefore any attempt to retrieve Methods as they are named in the interface will throw an exception. To do this properly you must get the interface Clazz from the ejbMetaData, introspect this to get the relevant methods, then invoke them on the remote object reference to the EJB. p.s. When I refer to a Clazz I am meaning the 'Class' of a class. >Still i need more information about methods (for example short description). >Why EJB doesn't supply such information as JavaBeans with BeanInfo class? It is possible to provide Java Beans style BeanInfo by creating bean info for each EJB and overriding the various methods such as getPropertyDescriptors. You will then have to bundle this with the client. -----Original Message----- From: ReJ [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 27, 1999 10:34 AM To: [EMAIL PROTECTED] Subject: Re: [EJB-INT] What is the purpose EJBMetadata class On Wed, 26 May 1999 15:17:29 +0200, Matthias David <[EMAIL PROTECTED]> wrote: >String str = EJBMetada.getHomeInterfaceClass.getName(); >System.out.println(Home Interface Name: " + str); > unless I have HomeInterface class on client side everything is ok, but if I'm trying to erase HomeInterface class on client side the following exception is raised: java.lang.ClassNotFoundException: untitled2.Enterprise1Home at weblogic.ejb.internal.EJBMetaDataImpl.getHomeInterfaceClass(EJBHomeImpl. java:1893) at untitled2.ejbTerminalClient.main(Compiled Code) note: this exception is caught by weblogic code and i receive no exception, and i see only this message... >This should work. It prints the name of the Home Interface class. See the >docs on java.lang.reflect. There are a number of classes and methods to >retrieve information on classes, methods, method parameters... Still, I don't understand what is the ejbMetaData purpose. Why I can't do it in such way? Context ctx = getInitialContext(); EJBHome home = (EJBHome) ctx.lookup(...); Class interface = home.getClass(); and then use reflection on interface class? Still i need more information about methods (for example short description). Why EJB doesn't supply such information as JavaBeans with BeanInfo class? ======================================================================== === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
