zzsoszz / ehcache-spring-annotations

Automatically exported from code.google.com/p/ehcache-spring-annotations
0 stars 0 forks source link

XSD Exception when starting on OC4j #98

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When starting application on Oracle OC4J

Operation failed with error: Configuration problem: Failed to import bean 
definitions from URL location 
[classpath:/META-INF/spring/dal-application-context.xml] Offending resource: 
ServletContext resource [/WEB-INF/spring-config/base-context.xml]; nested 
exception is 
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Failed to import bean definitions from URL location 
[classpath:/META-INF/spring/spring-cache-application-context.xml] Offending 
resource: class path resource [META-INF/spring/dal-application-context.xml]; 
nested exception is 
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 
in XML document from class path resource 
[META-INF/spring/spring-cache-application-context.xml] is invalid; nested 
exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 
'annotation' 

Server version is 10.1.3.1
Spring 3.0

XML Config:
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring 
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcac
he-spring-1.2.xsd">

    <!-- START ehcache -->
    <ehcache:annotation-driven />

    <ehcache:config cache-manager="cacheManager">
        <ehcache:evict-expired-elements interval="60" />
    </ehcache:config>

    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
        <property name="configLocation"  value="classpath:/META-INF/spring/ehcache.xml"/>
        <property name="shared" value="true" />
    </bean>
   <!--  END ehcache -->    
</beans>

Original issue reported on code.google.com by tadas.subonis@gmail.com on 7 Jun 2012 at 7:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You are using the buggy parser. Please define in the Eclipse 
Window->Preferences->Tomcat->JVM settings:

-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAX
ParserFactoryImpl
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.ja
xp.DocumentBuilderFactoryImpl

Or it must be defined in the VM-Parameters of your Run-Configuration if you use 
the main()-method.

Original comment by AdeqW...@googlemail.com on 2 Oct 2012 at 12:28