AnsweredAssumed Answered

Chiba problem

Question asked by tradiate on May 28, 2008
Latest reply on May 29, 2008 by tradiate
I managed to get Alfresco2.1/WCM running on Glassfish.  I am now trying to bring up WSF1.5.  I can successfully do everything I have tried so far with the exception of adding web content that is of type XML.  At step 2 of the Create Web Content Wizard, instead of an XML editor appearing, I simply get a one-line msg that reads:

     java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl

I examined Glassfish server.log and the exception has a stack trace that looks like this:


[#|2008-05-28T14:21:01.718-0400|SEVERE|sun-appserver9.1|org.alfresco.web.ui.common.Utils|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8880-0;_RequestID=eefbaed9-4f32-4759-90e5-5250b252748e;|com.sun.org.apache.xerces.internal.dom.ElementNSImpl
java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl
   at org.chiba.xml.xforms.Container.init(Container.java:324)
   at org.chiba.xml.xforms.ChibaBean.init(ChibaBean.java:421)
   at org.alfresco.web.forms.xforms.XFormsBean.setXFormsSession(XFormsBean.java:244)
   at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:140)
   at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:121)
   at org.alfresco.web.ui.wcm.component.UIFormProcessor.encodeBegin(UIFormProcessor.java:123)
   at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467)
    ….

I upgraded Chiba to 1.4.0, but the problem persists.

The com.sun.org.apache.xerces.internal.dom.ElementNSImpl class seems to originate in rt.jar from my Java 1.5 JRE.

I obtained the Chiba source, and line 324 of Chiba's Container.java looks like this:

        ((ElementImpl) this.root).setUserData(this);

and this.root is defined like this:

       private Element root;

and the imports at the top of Container.java include the following:

import org.apache.xerces.dom.ElementImpl;
import org.w3c.dom.Element;

Note that I have xercesImpl-2.8.0.jar installed in various places in an attempt to get it used instead of the JRE's com.sun.org.apache.xerces.* but I haven't had success yet.  For example, I have put xercesImpl-2.8.0.jar in /glassfish/lib as well as /glassfish/lib/endorsed as well as /glassfish/domains/domain1/lib/ext, and have even tried this:

-Dcom.sun.aas.ClassPathPrefix=F:\glassfish\domains\domain1\lib\ext\xercesImpl-2.8.0.jar

but I still get the exception.

Can anyone enlighten me about how to get the ElementNSImpl class loaded from xerces instead of the JRE (if, of course, that is indeed what my problem is)?

Outcomes