Announcement Announcement Module
Collapse
No announcement yet.
Failure loading Spring service Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failure loading Spring service

    Hello,
    I am a Spring newbie, and am struggling with an error. I have a project in GWT-Spring using JPA and Maven, and I am getting an error as

    java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    ...
    Caused by: org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 42 in XML document from URL [file:/C:/Dami/workspace/cosmic/src/main/webapp/WEB-INF/classes/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 'tx:annotation-driven'.
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:396)
    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 'tx:annotation-driven'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(ErrorHandlerWrap per.java:195)
    ..
    [WARN] Nested in java.lang.ExceptionInInitializerError:
    org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 42 in XML document from URL [file:/C:/Dami/workspace/cosmic/src/main/webapp/WEB-INF/classes/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 'tx:annotation-driven'.
    ..
    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 'tx:annotation-driven'.
    ..



    My applicationContext file is as -

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schem...ing-tx-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd">

    <!-- JPA -->
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerE ntityManagerFactoryBean">

    <property name="persistenceUnitName" value="cosmic-jpa" />
    <property name="persistenceXmlLocation" value="classpath:/META-INF/test-persistence.xml" />

    <property name="jpaVendorAdapter">
    <bean class="org.springframework.orm.jpa.vendor.EclipseL inkJpaVendorAdapter">
    <!-- log the sql queries -->
    <property name="showSql" value="true" />
    </bean>
    </property>


    </bean>

    <context:annotation-config />



    <!-- JPA Transaction Manager (from Spring) -->

    <tx:annotation-driven transaction-manager="transactionManager" />


    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionM anager">
    <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>

    <bean class="org.springframework.dao.annotation.Persiste nceExceptionTranslationPostProcessor" />
    <bean class="org.springframework.orm.jpa.support.Persist enceAnnotationBeanPostProcessor" />

    <!-- Inside JSF we'll use the FacesContext, but for testing we need an application
    context provider -->
    <bean id="applicationContextProvider" class="com.az.rd.cosmic.utils.ApplicationContextPr ovider" />

    <!-- Packages to scan go here -->
    <context:component-scan base-package="com.astrazeneca.rd.cosmic" />

    <!-- DAOs -->
    <bean class="com.az.rd.cosmic.dao.CosmicMartDaoImpl" id="cosmicMartDao" />
    <bean class="com.az.rd.cosmic.dao.HumanGeneInfoDao" id="humanGeneInfoDao" />
    <bean class="com.az.rd.cosmic.dao.GeneListDaoImpl" id="geneListDao" />

    <!-- Spring Services -->
    <bean class="com.az.rd.cosmic.service.GeneSpringService" id="geneSpringService" >
    <property name="cosmicMartDao" ref="cosmicMartDao" />
    <property name="humanGeneInfoDao" ref="humanGeneInfoDao" />
    <property name="geneListDao" ref="geneListDao" />
    </bean>

    <!-- SYSTEM SERVICES - ALPHABETICAL ORDER -->
    <!-- MESSAGE RESOURCE FOR SERVICES -->
    <bean class="org.springframework.context.support.Resourc eBundleMessageSource" id="messageSource">
    <property name="basename" value="Messages" />
    </bean>

    <!-- Jackson JSON -->
    <bean class="org.codehaus.jackson.map.ObjectMapper" id="jacksonMapper" />

    </beans>

    Any help would be MUCH appreciated. Thanks
    Last edited by nupurgupta; Aug 26th, 2011, 10:25 AM.
Working...
X