Yeah, that's a BIG problem.  You cannot simply instantiate a EJBHome
yourself via Object.newInstance()!  It's like trying to instantiate an
EJBObject or a  DataSource;  these service objects can only be looked-up,
not created.

Gene

-----Original Message-----
From: Ashish Ravi [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 4:03 AM
To: [EMAIL PROTECTED]
Subject: Re: Dynamic Invocation of a bean method


I've finally tracked down the problem to it's what i think is it's root. but
can't get anywhere from there :
    After i get the home interface of the bean, i try to create a new
instance of this object thru the Class.newInstance method. The object that
is returned is somehow incomplete, because when i try to invoke the
toString() or the hashCode() method, i get a nullpointerexception.......

    Class class1     = <<runtime class of entity bean home>>;
    Method method = class1.getDeclaredMethod("create",<<parameter array>>);
    Object object     = class1.newInstance();
    if(object != null){
        System.out.println(object.getClass());           // gets printed
        System.out.println(object.hashCode());        //
nullpointerexception
        System.out.println(object.toString());        //
nullpointerexception
    }

    Any idea why this is happening??

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

Reply via email to