Enabling Spring Repositories cvc-complex-type.2.4.c:The matching wildcard is strict,but no declaration can be found for element jpa:repositories -


the following applicationcontext.xml, not give warning, causing evil exception. reading old threads did not help. main part of exception

cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element jpa:repositories.

this applicationcontext.xml

<?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:beans="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">  <context:property-placeholder location="classpath*:spring/*.properties" /> <context:component-scan base-package="com.lh.clte" />   <bean id="datasource" class="org.apache.commons.dbcp.basicdatasource"     destroy-method="close">     <property name="driverclassname" value="${database.driverclassname}" />     <property name="url" value="${database.url}" />     <property name="username" value="${database.username}" />     <property name="password" value="${database.password}" />     <property name="initialsize" value="3" />     <property name="maxactive" value="10" /> </bean>  <tx:annotation-driven mode="proxy"     transaction-manager="transactionmanager" /> <bean class="org.springframework.orm.jpa.jpatransactionmanager"     id="transactionmanager">     <property name="entitymanagerfactory" ref="entitymanagerfactory" /> </bean>  <bean     class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean"     id="entitymanagerfactory">     <property name="persistenceunitname" value="persistenceunit" />     <property name="datasource" ref="datasource" /> </bean>  <jpa:repositories base-package="com.lh.clte.repository" /> </beans>   severe: exception sending context initialized event listener instance of class     org.springframework.web.context.contextloaderlistener org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 39 in xml document class path resource [spring/applicationcontext.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 39; columnnumber: 64; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'jpa:repositories'. @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:398) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:335) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:303) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:180) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:216) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:187) @ org.springframework.web.context.support.xmlwebapplicationcontext.loadbeandefinitions(xmlwebapplicationcontext.java:125) @ org.springframework.web.context.support.xmlwebapplicationcontext.loadbeandefinitions(xmlwebapplicationcontext.java:94) @ org.springframework.context.support.abstractrefreshableapplicationcontext.refreshbeanfactory(abstractrefreshableapplicationcontext.java:129) @ org.springframework.context.support.abstractapplicationcontext.obtainfreshbeanfactory(abstractapplicationcontext.java:540) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:454) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:403) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:106) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:4939) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5434) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745)   caused by: org.xml.sax.saxparseexception; linenumber: 39; columnnumber: 64; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'jpa:repositories'. @     com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.createsaxparseexception(errorhandlerwrapper.java:198) @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.error(errorhandlerwrapper.java:134) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:437) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:368) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:325) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator$xsierrorreporter.reporterror(xmlschemavalidator.java:458) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator.reportschemaerror(xmlschemavalidator.java:3237) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator.handlestartelement(xmlschemavalidator.java:1917) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator.emptyelement(xmlschemavalidator.java:766) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl.scanstartelement(xmlnsdocumentscannerimpl.java:355) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl$fragmentcontentdriver.next(xmldocumentfragmentscannerimpl.java:2770) @ com.sun.org.apache.xerces.internal.impl.xmldocumentscannerimpl.next(xmldocumentscannerimpl.java:606) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl.next(xmlnsdocumentscannerimpl.java:117) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl.scandocument(xmldocumentfragmentscannerimpl.java:510) @ com.sun.org.apache.xerces.internal.parsers.xml11configuration.parse(xml11configuration.java:848) @ com.sun.org.apache.xerces.internal.parsers.xml11configuration.parse(xml11configuration.java:777) @ com.sun.org.apache.xerces.internal.parsers.xmlparser.parse(xmlparser.java:141) @ com.sun.org.apache.xerces.internal.parsers.domparser.parse(domparser.java:243) @ com.sun.org.apache.xerces.internal.jaxp.documentbuilderimpl.parse(documentbuilderimpl.java:347) @ org.springframework.beans.factory.xml.defaultdocumentloader.loaddocument(defaultdocumentloader.java:76) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloaddocument(xmlbeandefinitionreader.java:428) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:390) ... 22 more  jun 27, 2014 6:42:35 pm org.apache.catalina.core.standardcontext startinternal severe: error listenerstart jun 27, 2014 6:42:35 pm org.apache.catalina.core.standardcontext startinternal severe: context [/clterestserver] startup failed due previous errors jun 27, 2014 6:42:35 pm org.apache.catalina.core.applicationcontext log info: closing spring root webapplicationcontext jun 27, 2014 6:42:35 pm org.apache.catalina.core.standardcontext listenerstop severe: exception sending context destroyed event listener instance of class org.springframework.web.context.contextloaderlistener java.lang.illegalstateexception: beanfactory not initialized or closed - call 'refresh' before accessing beans via applicationcontext @ org.springframework.context.support.abstractrefreshableapplicationcontext.getbeanfactory(abstractrefreshableapplicationcontext.java:170) @ org.springframework.context.support.abstractapplicationcontext.destroybeans(abstractapplicationcontext.java:921) @ org.springframework.context.support.abstractapplicationcontext.doclose(abstractapplicationcontext.java:895) @ org.springframework.context.support.abstractapplicationcontext.close(abstractapplicationcontext.java:841) @ org.springframework.web.context.contextloader.closewebapplicationcontext(contextloader.java:579) @ org.springframework.web.context.contextloaderlistener.contextdestroyed(contextloaderlistener.java:115) @ org.apache.catalina.core.standardcontext.listenerstop(standardcontext.java:4980) @ org.apache.catalina.core.standardcontext.stopinternal(standardcontext.java:5626) @ org.apache.catalina.util.lifecyclebase.stop(lifecyclebase.java:232) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:160) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) 

adding http://www.springframework.org/schema/context/spring-context.xsd schema location causes following warning appear:

  referenced bean 'jpamapppingcontext' not found    applicationcontext.xml 

try adding following xsi:schemalocation

http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -