`
jarchitect
  • 浏览: 34558 次
  • 性别: Icon_minigender_1
  • 来自: GuangZhou
社区版块
存档分类
最新评论

Spring疑难杂症 - XML配置(3)-cvc-complex-type.2.4.c

阅读更多

 

 

问题: 

org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'ha:host-adapter'

 

 

解决方法:

原来这个问题已有前人碰到过,从spring官方论坛上找到了答案。

其实spring提示的exception message不够清晰,让人误以为是XML,Parser的问题。

真正的原因是缺少了 element 'ha:host-adapter' 所需要的jar包。

参考帖子 http://forum.springframework.org/showthread.php?t=35417

 

 

异常完整信息:

Jan 23, 2008 4:20:37 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh 
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7b86bfdf: display name [org.springframework.context.support.ClassPathXmlApplicationContext@7b86bfdf]; startup date [Wed Jan 23 16:20:37 CST 2008]; root of context hierarchy 
Jan 23, 2008 4:20:37 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 
INFO: Loading XML bean definitions from class path resource [es6message/fixlength/ism12_fixlength.xml] 
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 16 in XML document from class path resource [es6message/fixlength/ism12_fixlength.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 'ha:host-adapter'.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 'ha:host-adapter'. 
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) 
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) 
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) 
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) 
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) 
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) 
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) 
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) 
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) 
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) 
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) 
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) 
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351) 
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) 
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) 
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) 
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) 
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173) 
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112) 
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79) 
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101) 
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389) 
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324) 
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91) 
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75) 
at com.hsbc.pfs.gbl.message.ES6FixMessageTest.main(ES6FixMessageTest.java:48) 

 

分享到:
评论
3 楼 zhjxzhj 2011-09-01  
能不能不发这种烂帖子,把人骗进来了不说怎么解决
2 楼 xiaobojava 2009-11-24  
博主,包呢??
1 楼 only_java 2009-03-09  
http://www.jroller.com/habuma/entry/fixing_spring_modules_xsd_errors
这个更清晰

相关推荐

Global site tag (gtag.js) - Google Analytics