|
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
|
- Class.newInstance() Fails with InstantiationException. Bill Winspur
- RE: Class.newInstance() Fails with InstantiationExce... menonv
- Re: Class.newInstance() Fails with Instantiation... Bill Winspur
- Re: Class.newInstance() Fails with Instantia... Stephen Davidson
- Re: Class.newInstance() Fails with Insta... Bill Winspur
- RE: Class.newInstance() Fails with InstantiationExce... Cote, Robert
