[jdom-interest] Issues with b7

Erik Nord eknord at yahoo.com
Sat Jul 7 09:38:43 PDT 2001


Inside the *_BaseStub object there is a method matching the method that
you are calling.  In my case it is execute that takes in an Element. 
It is a w3c Element.  Then half way down is the following line of code:
in=(org.omg.CORBA_2_3.portable.InputStream)_invoke(out);  Inside this
_invoke(out) call a system exception is thrown.  Here is a copy of the
method that I am trying to eventually make it into:
public org.w3c.dom.Element execute(org.w3c.dom.Element element) {
    try {
            System.out.println("Inside execute()");
        org.jdom.input.DOMBuilder build = new
org.jdom.input.DOMBuilder();
        org.jdom.Element jElement = build.build(element);
        org.jdom.Document jdom = new org.jdom.Document(jElement);

        org.jdom.output.DOMOutputter out = new
org.jdom.output.DOMOutputter();
        jElement = jdom.getRootElement();
        System.out.println("Leaving execute()");
        return out.output(jElement);
    } catch (org.jdom.JDOMException jodme) {
        jodme.printStackTrace();
        return null;
    }
}

As you can see I am really doing nothing in this method as of yet. 
There will eventually be some business logic added to this method. 
Here is a copy of the Unit Test program that I wrote to test this
method:
protected void handleDo() {
    try {
            System.out.println("handleDo()");
        java.util.Properties p = new java.util.Properties();
        p.put(javax.naming.Context.PROVIDER_URL, "iiop:///");
        p.put(
            javax.naming.Context.INITIAL_CONTEXT_FACTORY,
            "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
        javax.naming.InitialContext init = new
javax.naming.InitialContext(p);
        String jndiName =
           
csg.dispatcher.ejb.DispatcherSFB.class.getName().replace('.', '/');
        Object o = init.lookup(jndiName);
        System.out.println("Obtaining DispatcherSFB object.");
        csg.dispatcher.ejb.DispatcherSFBHome dispatcherHome =
            (csg.dispatcher.ejb.DispatcherSFBHome)
javax.rmi.PortableRemoteObject.narrow(
                o,
                csg.dispatcher.ejb.DispatcherSFBHome.class);
        csg.dispatcher.ejb.DispatcherSFB dispatcher =
dispatcherHome.create();
        String xmlString =
           
"<Transaction><UserID>Erik</UserID><Password>Nord</Password></Transactio
n>";
        org.jdom.input.SAXBuilder sBuilder = new
org.jdom.input.SAXBuilder();
        org.jdom.Document jdom = sBuilder.build(new
java.io.StringReader(xmlString));
        org.jdom.output.DOMOutputter dOutput = new
org.jdom.output.DOMOutputter();
        org.w3c.dom.Document dom = dOutput.output(jdom);
        org.w3c.dom.Element pass = dom.getDocumentElement();
        //org.jdom.Element jdomElement =
dispatcher.execute(jdom.getRootElement());
        //org.w3c.dom.Document backDom = dispatcher.execute(dom);
        org.w3c.dom.Element element = dispatcher.execute(pass);
        org.jdom.input.DOMBuilder dBuilder = new
org.jdom.input.DOMBuilder();
        org.jdom.Element jElement = dBuilder.build(element);
        org.jdom.output.XMLOutputter xOutput = new
org.jdom.output.XMLOutputter();
        System.out.println("Back from Dispatcher:  " +
xOutput.outputString(jElement));
    } catch (javax.naming.NamingException ne) {
        ne.printStackTrace();
    } catch (java.rmi.RemoteException re) {
        re.printStackTrace();
    } catch (javax.ejb.CreateException ce) {
        ce.printStackTrace();
    } catch (org.jdom.JDOMException jdome) {
        jdome.printStackTrace();
    }
}
So, this just creates the DOM and passes the Element.  It would then
get an Element back.  When I run this I get the following stack trace:
java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is: 
        org.omg.CORBA.MARSHAL:   
Ê 
 #  minor code: 0  completed: No
org.omg.CORBA.MARSHAL:   
Ê 
 #  minor code: 0  completed: No
        java.lang.Throwable(java.lang.String)
        java.lang.Exception(java.lang.String)
        java.lang.RuntimeException(java.lang.String)
        org.omg.CORBA.SystemException(java.lang.String, int,
org.omg.CORBA.CompletionStatus)
        org.omg.CORBA.MARSHAL(java.lang.String, int,
org.omg.CORBA.CompletionStatus)
        org.omg.CORBA.MARSHAL(java.lang.String)
        java.lang.Object
java.lang.reflect.Constructor.newInstance(java.lang.Object [])
        org.omg.CORBA.SystemException
com.ibm.CORBA.iiop.ReplyMessage.getSystemException()
        org.omg.CORBA.SystemException
com.ibm.rmi.iiop.ClientResponseImpl.getSystemException()
        org.omg.CORBA.portable.InputStream
com.ibm.CORBA.iiop.ClientDelegate.invoke(org.omg.CORBA.Object,
org.omg.CORBA.portable.OutputStream)
        org.omg.CORBA.portable.InputStream
org.omg.CORBA.portable.ObjectImpl._invoke(org.omg.CORBA.portable.OutputS
tream)
        org.w3c.dom.Element
csg.dispatcher.ejb._DispatcherSFB_BaseStub.execute(org.w3c.dom.Element)
        org.w3c.dom.Element
csg.dispatcher.ejb._DispatcherSFB_Stub.execute(org.w3c.dom.Element)
        void csg.dispatcher.test.DispatcherUT.handleDo()
        void csg.dispatcher.test.DispatcherUT.main(java.lang.String [])

I hope this helps you out.
Thank you
Erik Nord


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 7/6/01, 5:27:11 PM, Jason Hunter <jhunter at collab.net> wrote regarding 
Re: [jdom-interest] Issues with b7:


> You don't say what the problem is.  Just that things "stopped working".
> If you could provide more details, we could be more help.

> -jh-

> > Erik Nord wrote:
> >
> > I have just built a web architecture that is using JDOM extensively.
> > When we were using the b6 release we were having no problems.  When we
> > upgraded to the b7 our EJB's stopped working.  We all of the sudden had
> > issues passing any kind of JDOM or W3C objects.  We eventually tracked
> > this back to being an issue with the JDOM b7 release. We have since
> > went back to b6 and everything is working fine.  We wanted to use the
> > detach() method in b7.  Has anyone seen this problem yet?
> > Thank you for you help.
> > Erik Nord
> > Senior Systems Programmer
> > CSG Systems, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010707/c1074345/attachment.htm


More information about the jdom-interest mailing list