Hi,

is the following piece of code valid in an EJB. It works fine in the
Weblogic5.1 but is it allowed according to the spec.

I am trying to invoke sayHello method of the Trader Interface (this method
does not have any arguments).

log("Creating a trader");
Trader trader = (Trader) narrow(home.create(), Trader.class);
try
{
    Class myclass = trader.getClass();
    Method method = myclass.getDeclaredMethod("sayHello", null);
    method.invoke(trader, null);
}
catch(Exception e)
{
        e.printStackTrace();
}

According to EJB spec,
"The enterprise bean must not attempt to query a class to obtain information
about the declared
members that are not otherwise accessible to the enterprise bean because of
the security rules
of the Java language. The enterprise bean must not attempt to use the
Reflection API to access
information that the security rules of the Java programming language make
unavailable."

thanks

===========================================================================
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".

Reply via email to