You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Bart Molenkamp <b....@bizzdesign.nl> on 2007/01/25 16:08:47 UTC

applicationContext.xml not valid according to schema?

Hi,

I can't start Cocoon 2.2, because the file
WEB-INF/applicationContext.xml isn't valid. I get the following
exception:

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 30 in XML document from ServletContext resource
[/WEB-INF/applicationContext.xml] is invalid; nested exception is
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration can be found for element
'cocoon:settings'.
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
matching wildcard is strict, but no declaration can be found for element
'cocoon:settings'.

I really don't understand why this error occurs. The file is created by
cocoon's webapp archetype, and I was able to run my application before
today. If I open the file in Eclipse (using WTP's XML editor, it also
notices the errors).

Does anybody have any clue (I'm using spring 2.0.2, cocoon
2.2.0-M3-SNAPSHOT)?

Thanks,
Bart.


Re: applicationContext.xml not valid according to schema?

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Bart Molenkamp wrote:
> Hi,
> 
> I can't start Cocoon 2.2, because the file
> WEB-INF/applicationContext.xml isn't valid. I get the following
> exception:
> 
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line 30 in XML document from ServletContext resource
> [/WEB-INF/applicationContext.xml] is invalid; nested exception is
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'cocoon:settings'.
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
> matching wildcard is strict, but no declaration can be found for element
> 'cocoon:settings'.
> 
> I really don't understand why this error occurs. The file is created by
> cocoon's webapp archetype, and I was able to run my application before
> today. If I open the file in Eclipse (using WTP's XML editor, it also
> notices the errors).
> 
> Does anybody have any clue (I'm using spring 2.0.2, cocoon
> 2.2.0-M3-SNAPSHOT)?

The syntax you're using is outdated (I also have hard time to keep up 
lately). Your applicationContext.xml should state:

> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:util="http://www.springframework.org/schema/util"
>        xmlns:configurator="http://cocoon.apache.org/schema/configurator"
>        xmlns:avalon="http://cocoon.apache.org/schema/avalon"
>        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
>                            http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.xsd
>                            http://cocoon.apache.org/schema/avalon http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd">
> 
>   <!-- Activate Cocoon Spring Configurator -->
>   <configurator:settings/>
> 
>   <!-- Configure Log4j -->
>   <bean name="org.apache.cocoon.spring.configurator.log4j"
>         class="org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator"
>         scope="singleton">
>     <property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
>     <property name="resource" value="/WEB-INF/cocoon/log4j.xml"/>
>   </bean>
> 
>   <!-- Activate Avalon Bridge -->
>   <avalon:bridge/>
> 
> </beans>


no <cocoon:settings/> anymore...

-- 
Leszek