java - Failed to import bean definitions from URL location [classpath:transact-application-config.xml] -
i working on application in use , whenever so, error mentioned below. have checked other links similar problems, not useful options had. posting new question.
error code :
org.springframework.beans.factory.parsing.beandefinitionparsingexception: configuration problem: failed import bean definitions url location [classpath:transact-application-config.xml] offending resource: servletcontext resource [/web-inf/applicationcontext.xml]; nested exception org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 17 in xml document class path resource [transact-application-config.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 17; columnnumber: 40; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'aop:config'. @ org.springframework.beans.factory.parsing.failfastproblemreporter.error(failfastproblemreporter.java:68) @ org.springframework.beans.factory.parsing.readercontext.error(readercontext.java:85) @ org.springframework.beans.factory.parsing.readercontext.error(readercontext.java:76) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.importbeandefinitionresource(defaultbeandefinitiondocumentreader.java:245) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.parsedefaultelement(defaultbeandefinitiondocumentreader.java:196) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.parsebeandefinitions(defaultbeandefinitiondocumentreader.java:181) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.doregisterbeandefinitions(defaultbeandefinitiondocumentreader.java:140) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.registerbeandefinitions(defaultbeandefinitiondocumentreader.java:111) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.registerbeandefinitions(xmlbeandefinitionreader.java:493) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:390) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:334) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:302) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:174) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:209) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:180) @ 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:131) @ org.springframework.context.support.abstractapplicationcontext.obtainfreshbeanfactory(abstractapplicationcontext.java:530) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:444) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:388) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:293) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:111) @ 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(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown source) caused by: org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 17 in xml document class path resource [transact-application-config.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 17; columnnumber: 40; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'aop:config'. @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:396) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:334) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:302) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:174) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:209) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.importbeandefinitionresource(defaultbeandefinitiondocumentreader.java:239) ... 28 more caused by: org.xml.sax.saxparseexception; linenumber: 17; columnnumber: 40; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'aop:config'. @ org.apache.xerces.util.errorhandlerwrapper.createsaxparseexception(unknown source) @ org.apache.xerces.util.errorhandlerwrapper.error(unknown source) @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) @ org.apache.xerces.impl.xs.xmlschemavalidator$xsierrorreporter.reporterror(unknown source) @ org.apache.xerces.impl.xs.xmlschemavalidator.reportschemaerror(unknown source) @ org.apache.xerces.impl.xs.xmlschemavalidator.handlestartelement(unknown source) @ org.apache.xerces.impl.xs.xmlschemavalidator.startelement(unknown source) @ org.apache.xerces.impl.xmlnsdocumentscannerimpl.scanstartelement(unknown source) @ org.apache.xerces.impl.xmldocumentfragmentscannerimpl$fragmentcontentdispatcher.dispatch(unknown source) @ org.apache.xerces.impl.xmldocumentfragmentscannerimpl.scandocument(unknown source) @ org.apache.xerces.parsers.xml11configuration.parse(unknown source) @ org.apache.xerces.parsers.xml11configuration.parse(unknown source) @ org.apache.xerces.parsers.xmlparser.parse(unknown source) @ org.apache.xerces.parsers.domparser.parse(unknown source) @ org.apache.xerces.jaxp.documentbuilderimpl.parse(unknown source) @ org.springframework.beans.factory.xml.defaultdocumentloader.loaddocument(defaultdocumentloader.java:75) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:388) ... 33 more
transact-application-config.xml file :
<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd "> <!-- declare transaction manager --> <bean id="transactionmanager" class="org.springframework.orm.jpa.jpatransactionmanager"> <property name="entitymanagerfactory" ref="efentitymanagerfactory"/> <property name="datasource" ref="datasource"/> </bean> <aop:config proxy-target-class="true"> <aop:advisor pointcut="execution(* com.teldirectory.service..*.*(..))" advice-ref="txadvicesrv" /> </aop:config> <!-- generic transactional filter --> <tx:advice id="txadvicesrv"> <tx:attributes> <tx:method name="find*" propagation="supports" read-only="true" rollback-for="applicationexception"/> <tx:method name="*" propagation="required" read-only="false" rollback-for="applicationexception"/> </tx:attributes> </tx:advice> <!-- instructs container controllers beans decorate --> <aop:config> <aop:advisor pointcut="execution(* com.teldirectory.views..*.*(..))" advice-ref="txadvicectrl" /> </aop:config> <tx:advice id="txadvicectrl"> <tx:attributes> <tx:method name="*" propagation="required" read-only="false" rollback-for="applicationexception"/> </tx:attributes> </tx:advice> </beans>
if there else necessary, web.xml or so, kindly let me know. nice. thanks.
your xml looks ok - hard find error in such case. couple of things can do.
make sure there 1 version of xml parser in classpath. possible jdk has version/other parser loaded before parser. check classpath & check schemalocation attribute value exists. try change actual version ( 3.3 or 4.1 in xsd ensure not spring version issue.
Comments
Post a Comment