cancel
Showing results for 
Search instead for 
Did you mean: 

Error creating web form,when i select schema file

bluffmaster007
Champ in-the-making
Champ in-the-making
I am using alfresco 2.1,
when i create a web form and select an xsd (company-footer.xsd), error comes:
On top :       Please correct the errors below then click Finish.

                   * unable to parse company-footer.xsd: org.apache.xerces.dom.DOMXSImplementationSourceImpl

Next to root element label :
              This schema does not contain any element declarations. A schema must contain at least one element declaration in order to generate a form.
(but this schema file is correct, i have checked and contains 2 elements)

On console:
11:58:32,515 ERROR [ui.common.Utils] unable to parse company-footer.xsd: org.apa
che.xerces.dom.DOMXSImplementationSourceImpl
java.lang.ClassCastException: org.apache.xerces.dom.DOMXSImplementationSourceImp
l
        at org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(Unknown S
ource)
        at org.alfresco.web.forms.xforms.SchemaUtil.parseSchema(SchemaUtil.java:
210)
        at org.alfresco.web.bean.wcm.CreateFormWizard.schemaFileValueChanged(Cre
ateFormWizard.java:632)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java
:132)
        at javax.faces.component.UIInput.broadcast(UIInput.java:244)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:9
7)
        at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:139)
        at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(Apply
RequestValuesExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl
.java:95)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
:70)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(Authentica
tionFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16
0)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:683)
        at java.lang.Thread.run(Thread.java:595)






Please help me asap,
i want to create a site in alfresco so i want to need to know.
6 REPLIES 6

pmonks
Star Contributor
Star Contributor
It looks like your schema doesn't contain any root elements.  Can you post it here?

Cheers,
Peter

samuel_penn
Champ in-the-making
Champ in-the-making
I'm seeing the same error in AlfrescoLabs 3c. I've tried creating a web form from an XSD that works fine in Alfresco 2.1, so I think it's something to do with the Alfresco configuration rather than the XSD definition.

My quick search of the forums showed up two people with this problem (including the thread I'm replying to). The other was using JBoss, and I'm installing Alfresco into a shared Tomcat, so I'm guessing that the issue is down to some complication in how WCM is installed.

All I did was copy the bootstrap file into place, and stick studio.war into the webapps folder. I don't have the virtual server running yet, but I don't see that this should make a difference.

I can cut my XSD down to the following simple form:


<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:alf="http://www.alfresco.org"
           xmlns:p="http://glendale.org.uk/alfresco/page"
           targetNamespace="http://glendale.org.uk/alfresco/page"
           elementFormDefault="qualified">

    <xs:element name="page">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="header" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

And still get the error. The stack trace is the same as in 2.1 in the post above (class cast exception). Could it be a library inconsistency?

Thanks,
Sam.

samuel_penn
Champ in-the-making
Champ in-the-making
As a further test, I've tried creating a web form using an invalid XSD (no element declarations, just a type declaration) in a standalone install of Alfresco 3.0.1 (I don't have a standalone install of Labs3c to test with). There is no stack trace given in the logs, but just a simple clean error shown in the front end stating that there is a missing element declaration. If I break an otherwise valid (containing an element) XSD (removing a closing tag for example), then I get a stack trace from the parsing exception as well as a UI error about missing elements.

To me, it looks like the error about missing elements is a red herring - the real problem is that Alfresco is unable to parse the XML file (despite it working fine in a standalone install of 2.1) and is crashing with an exception. The warning about missing elements is just because the UI is assuming that any errors at this point are due to missing elements, even though they're not.

I've still no idea why it's failing, but I'm pretty certain at this point that it's not the XSD at fault, but some configuration issue within Alfresco.

Sam.

samuel_penn
Champ in-the-making
Champ in-the-making
I've fixed the problem for me.

In case anyone else has the same issue, I moved xercesImpl.jar out of common/endorsed, and replaced it with the more recent Alfresco version xercesImpl-2.8.0.jar from the war file (no rename necessary). Apparently it's a general problem with app servers, where different versions of the same class get picked up depending on what's being done.

My other apps seem to be working fine still.

Sam.

jayesh_prajapat
Star Contributor
Star Contributor
Hi Samuel,

I am facing same problem even after replacing the jar file.

what could be the root cause for this problem?

could you please suggest me the solution if you have?

Thanks in advance.

samuel_penn
Champ in-the-making
Champ in-the-making
Have you got other copies of old jar files anywhere in Tomcat's classpath? I must admit that after I got this working, I gave up. AlfrescoLabs 3 seems to be completely broken as far as WCM is concerned, so I'm waiting for Labs 3.1 (assuming there will be one) before looking at this any more (it would be nice to move off 2.1 one day).

Sam.