The echoing port never gets instantiated, the attempt to instantiate, by invoking Class.newInstance(), throws an InstantiationException. However, if you are asking what is the function of EchoingPort? ... it is a test stub for for the session side of an http tunneling package to support applet/client access to ejb's via http.
 
The relevant code follows:--------------------------------------------
 
 /**
  * Instantiates the session port if not yet done
  */
  private void instantiateIt(String className) throws Exception {
    Class hj = null;
    try {
      hj = Class.forName(className);
      System.out.println(
       "class: " + hj +
       "\n. isInterface: " + hj.isInterface() +
       "\n. isArray: "     + hj.isArray() +
       "\n. isPrimitive: " + hj.isPrimitive() +
       "\n. isAbstract: "  + Modifier.isAbstract(hj.getModifiers()) +
       "\n. isFinal: "     + Modifier.isFinal(hj.getModifiers()) +
       "\n. isNative: "    + Modifier.isNative(hj.getModifiers()) +
       "\n. isPrivate: "   + Modifier.isPrivate(hj.getModifiers()) +
       "\n. isProtected: " + Modifier.isProtected(hj.getModifiers()) +
       "\n. isPublic: "    + Modifier.isPublic(hj.getModifiers()) +
       "\n. isStatic: "    + Modifier.isStatic(hj.getModifiers()) +
       "\n. isStrict: "    + Modifier.isStrict(hj.getModifiers()) +
       "\n. isStrict: "    + Modifier.isStrict(hj.getModifiers()) +
       "\n. isTransient: " + Modifier.isTransient(hj.getModifiers()) +
       "\n. isVolatile: "  + Modifier.isVolatile(hj.getModifiers())
      );
      try {
        Object oj = hj.newInstance();
        trace("obj: "+ oj);
        trace("Instantiated: " + hj);
      } catch (InstantiationException e) {
        throw new Exception(
                "Cant instantiate a session object: " + e);
      } catch (IllegalAccessException e) {
        throw new Exception(
                "Cant instantiate a session object" + e);
      }
    } catch (Exception ex) {
      throw new Exception(
        "Failed to instantiate className: " + className +
        "\n" + ex.toString() );
    }
  }
 
  private void trace(String s) { System.out.println(s); }
 
The console log produced by the above code is as follows -----------------
 
class: class com.wynnon.appletChannel.test.EchoingPort
. isInterface: false
. isArray: false
. isPrimitive: false
. isAbstract: false
. isFinal: false
. isNative: false
. isPrivate: false
. isProtected: false
. isPublic: true
. isStatic: false
. isStrict: false
. isStrict: false
. isTransient: false
. isVolatile: false
Failed to instantiate className: com.wynnon.appletChannel.test.EchoingPort
javax.servlet.ServletException: Cant instantiate a session object: java.lang.InstantiationException: com.wynnon.appletChannel.test.EchoingPort
----- Original Message -----
From: menonv
Sent: Tuesday, February 05, 2002 1:38 AM
Subject: RE: Class.newInstance() Fails with InstantiationException.

What exactly does it do when it gets instantiated?
-----Original Message-----
From: Bill Winspur [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 9:47 PM
To: Orion-Interest
Subject: Class.newInstance() Fails with InstantiationException.

I have a servlet that would instantiate an object, if everything worked. Unfortunately, it fails with the following exception from the Class.newInstance() method:
 
java.lang.InstantiationException: com.wynnon.appletChannel.test.EchoingPort
 
where EchoingPort is the class I would instantiate from.
 
The api says this about the Exception thrown by newInstance():
InstantiationException - Thrown if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the instantiation fails for some other reason .
 
I printed all the modifiers for the the class, and it is not an interface, not abstract, etc.
 
The odd thing is, if I run the instantiation code outside orion, EchoingPort instantiates properly.
 
Questions
--------
Does orion intervene somehow in the instantiation process ?
Does anybody have a clue what I'm doing wrong ?


Disclaimer

This communication together with any attachments transmitted with it ('this E-mail') is intended only for the use of the addressee and may contain information which is privileged and confidential. If the reader of this E-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient you are notified that any use of this E-mail is prohibited. Addressees should check this E-mail for viruses. The Carphone Warehouse Group PLC makes no representations as regards the absence of viruses in this E-mail. If you have received this E-mail in error please notify our ISe Response Team immediately by telephone on + 44 (0)20 8896 5828 or via E-mail at [EMAIL PROTECTED] Please then immediately destroy this E-mail and any copies of it.

Please feel free to visit our website: http://www.phonehouse.com

Reply via email to