org.springframework.beans.factory.xml.XmlBeanDefinitionReader -Ignored XML validation warning问题

本文主要是介绍org.springframework.beans.factory.xml.XmlBeanDefinitionReader -Ignored XML validation warning问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

03-10 12:59:59[WARN]org.springframework.beans.factory.xml.XmlBeanDefinitionReader
-Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 72; schema_reference.4: 无法读取方案文档 ‘http://www.springframework.org/schema/beans/spring-beans-5.1.4.xsd’, 原因为 1) 无法找到文档; 2) 无法读取文档; 3) 文档的根元素不是 xsd:schema。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:99)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:392)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:306)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4158)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaWarning(XSDHandler.java:4149)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument1(XSDHandler.java:2491)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2193)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:578)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:610)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2447)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1768)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl N S C o n t e n t D r i v e r . s c a n R o o t E l e m e n t H o o k ( X M L N S D o c u m e n t S c a n n e r I m p l . j a v a : 613 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L D o c u m e n t F r a g m e n t S c a n n e r I m p l NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImplFragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl P r o l o g D r i v e r . n e x t ( X M L D o c u m e n t S c a n n e r I m p l . j a v a : 852 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L D o c u m e n t S c a n n e r I m p l . n e x t ( X M L D o c u m e n t S c a n n e r I m p l . j a v a : 602 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L N S D o c u m e n t S c a n n e r I m p l . n e x t ( X M L N S D o c u m e n t S c a n n e r I m p l . j a v a : 112 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L D o c u m e n t F r a g m e n t S c a n n e r I m p l . s c a n D o c u m e n t ( X M L D o c u m e n t F r a g m e n t S c a n n e r I m p l . j a v a : 505 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . p a r s e r s . X M L 11 C o n f i g u r a t i o n . p a r s e ( X M L 11 C o n f i g u r a t i o n . j a v a : 842 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . p a r s e r s . X M L 11 C o n f i g u r a t i o n . p a r s e ( X M L 11 C o n f i g u r a t i o n . j a v a : 771 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . p a r s e r s . X M L P a r s e r . p a r s e ( X M L P a r s e r . j a v a : 141 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . p a r s e r s . D O M P a r s e r . p a r s e ( D O M P a r s e r . j a v a : 243 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . j a x p . D o c u m e n t B u i l d e r I m p l . p a r s e ( D o c u m e n t B u i l d e r I m p l . j a v a : 339 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . D e f a u l t D o c u m e n t L o a d e r . l o a d D o c u m e n t ( D e f a u l t D o c u m e n t L o a d e r . j a v a : 77 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . d o L o a d D o c u m e n t ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 434 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . d o L o a d B e a n D e f i n i t i o n s ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 392 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 336 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 304 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 188 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 224 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 195 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 257 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . j a v a : 128 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . j a v a : 94 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t R e f r e s h a b l e A p p l i c a t i o n C o n t e x t . r e f r e s h B e a n F a c t o r y ( A b s t r a c t R e f r e s h a b l e A p p l i c a t i o n C o n t e x t . j a v a : 133 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . o b t a i n F r e s h B e a n F a c t o r y ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 622 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 518 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . &lt; i n i t &gt; ( C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . j a v a : 144 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . &lt; i n i t &gt; ( C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . j a v a : 85 ) a t m y s p r i n g . t e s t H e l l o S p r i n g . m a i n ( t e s t H e l l o S p r i n g . j a v a : 10 ) C a u s e d b y : j a v a . i o . F i l e N o t F o u n d E x c e p t i o n : h t t p : / / w w w . s p r i n g f r a m e w o r k . o r g / s c h e m a / b e a n s / s p r i n g − b e a n s − 5.1.4. x s d a t s u n . n e t . w w w . p r o t o c o l . h t t p . H t t p U R L C o n n e c t i o n . g e t I n p u t S t r e a m 0 ( H t t p U R L C o n n e c t i o n . j a v a : 1890 ) a t s u n . n e t . w w w . p r o t o c o l . h t t p . H t t p U R L C o n n e c t i o n . g e t I n p u t S t r e a m ( H t t p U R L C o n n e c t i o n . j a v a : 1492 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L E n t i t y M a n a g e r . s e t u p C u r r e n t E n t i t y ( X M L E n t i t y M a n a g e r . j a v a : 647 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L V e r s i o n D e t e c t o r . d e t e r m i n e D o c V e r s i o n ( X M L V e r s i o n D e t e c t o r . j a v a : 148 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . x s . o p t i . S c h e m a P a r s i n g C o n f i g . p a r s e ( S c h e m a P a r s i n g C o n f i g . j a v a : 583 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . x s . o p t i . S c h e m a P a r s i n g C o n f i g . p a r s e ( S c h e m a P a r s i n g C o n f i g . j a v a : 686 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . x s . o p t i . S c h e m a D O M P a r s e r . p a r s e ( S c h e m a D O M P a r s e r . j a v a : 530 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . x s . t r a v e r s e r s . X S D H a n d l e r . g e t S c h e m a D o c u m e n t ( X S D H a n d l e r . j a v a : 2181 ) . . . 34 m o r e E x c e p t i o n i n t h r e a d &quot; m a i n &quot; o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n S t o r e E x c e p t i o n : L i n e 5 i n X M L d o c u m e n t f r o m c l a s s p a t h r e s o u r c e [ a p p l i c a t i o n C o n t e x t . x m l ] i s i n v a l i d ; n e s t e d e x c e p t i o n i s o r g . x m l . s a x . S A X P a r s e E x c e p t i o n ; l i n e N u m b e r : 5 ; c o l u m n N u m b e r : 72 ; c v c − e l t . 1 : 找 不 到 元 素 ′ b e a n s ′ 的 声 明 。 a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . d o L o a d B e a n D e f i n i t i o n s ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 404 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 336 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . x m l . X m l B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( X m l B e a n D e f i n i t i o n R e a d e r . j a v a : 304 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 188 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 224 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 195 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t B e a n D e f i n i t i o n R e a d e r . j a v a : 257 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . j a v a : 128 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . l o a d B e a n D e f i n i t i o n s ( A b s t r a c t X m l A p p l i c a t i o n C o n t e x t . j a v a : 94 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t R e f r e s h a b l e A p p l i c a t i o n C o n t e x t . r e f r e s h B e a n F a c t o r y ( A b s t r a c t R e f r e s h a b l e A p p l i c a t i o n C o n t e x t . j a v a : 133 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . o b t a i n F r e s h B e a n F a c t o r y ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 622 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 518 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . &lt; i n i t &gt; ( C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . j a v a : 144 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . &lt; i n i t &gt; ( C l a s s P a t h X m l A p p l i c a t i o n C o n t e x t . j a v a : 85 ) a t m y s p r i n g . t e s t H e l l o S p r i n g . m a i n ( t e s t H e l l o S p r i n g . j a v a : 10 ) C a u s e d b y : o r g . x m l . s a x . S A X P a r s e E x c e p t i o n ; l i n e N u m b e r : 5 ; c o l u m n N u m b e r : 72 ; c v c − e l t . 1 : 找 不 到 元 素 ′ b e a n s ′ 的 声 明 。 a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . u t i l . E r r o r H a n d l e r W r a p p e r . c r e a t e S A X P a r s e E x c e p t i o n ( E r r o r H a n d l e r W r a p p e r . j a v a : 203 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . u t i l . E r r o r H a n d l e r W r a p p e r . e r r o r ( E r r o r H a n d l e r W r a p p e r . j a v a : 134 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L E r r o r R e p o r t e r . r e p o r t E r r o r ( X M L E r r o r R e p o r t e r . j a v a : 396 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L E r r o r R e p o r t e r . r e p o r t E r r o r ( X M L E r r o r R e p o r t e r . j a v a : 327 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L E r r o r R e p o r t e r . r e p o r t E r r o r ( X M L E r r o r R e p o r t e r . j a v a : 284 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . x s . X M L S c h e m a V a l i d a t o r . h a n d l e S t a r t E l e m e n t ( X M L S c h e m a V a l i d a t o r . j a v a : 1901 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . x s . X M L S c h e m a V a l i d a t o r . s t a r t E l e m e n t ( X M L S c h e m a V a l i d a t o r . j a v a : 741 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L N S D o c u m e n t S c a n n e r I m p l . s c a n S t a r t E l e m e n t ( X M L N S D o c u m e n t S c a n n e r I m p l . j a v a : 374 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L N S D o c u m e n t S c a n n e r I m p l PrologDriver.next(XMLDocumentScannerImpl.java:852) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:257) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:622) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:518) at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:85) at myspring.testHelloSpring.main(testHelloSpring.java:10) Caused by: java.io.FileNotFoundException: http://www.springframework.org/schema/beans/spring-beans-5.1.4.xsd at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:647) at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:583) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:686) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:530) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2181) ... 34 more Exception in thread &quot;main&quot; org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 72; cvc-elt.1: 找不到元素 &#x27;beans&#x27; 的声明。 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:257) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:622) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:518) at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:85) at myspring.testHelloSpring.main(testHelloSpring.java:10) Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 72; cvc-elt.1: 找不到元素 &#x27;beans&#x27; 的声明。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1901) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl PrologDriver.next(XMLDocumentScannerImpl.java:852)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)atcom.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)atcom.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)atcom.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)atcom.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)atcom.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)atcom.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)atorg.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:257)atorg.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128)atorg.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94)atorg.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)atorg.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:622)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:518)atorg.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)atorg.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)atmyspring.testHelloSpring.main(testHelloSpring.java:10)Causedby:java.io.FileNotFoundException:http://www.springframework.org/schema/beans/springbeans5.1.4.xsdatsun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)atsun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)atcom.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:647)atcom.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148)atcom.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:583)atcom.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:686)atcom.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:530)atcom.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2181)...34moreExceptioninthread"main"org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line5inXMLdocumentfromclasspathresource[applicationContext.xml]isinvalid;nestedexceptionisorg.xml.sax.SAXParseException;lineNumber:5;columnNumber:72;cvcelt.1:beansatorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:257)atorg.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128)atorg.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94)atorg.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)atorg.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:622)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:518)atorg.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)atorg.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)atmyspring.testHelloSpring.main(testHelloSpring.java:10)Causedby:org.xml.sax.SAXParseException;lineNumber:5;columnNumber:72;cvcelt.1:beansatcom.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)atcom.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)atcom.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)atcom.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)atcom.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)atcom.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1901)atcom.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)atcom.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)atcom.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImplNSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl F r a g m e n t C o n t e n t D r i v e r . n e x t ( X M L D o c u m e n t F r a g m e n t S c a n n e r I m p l . j a v a : 3132 ) a t c o m . s u n . o r g . a p a c h e . x e r c e s . i n t e r n a l . i m p l . X M L D o c u m e n t S c a n n e r I m p l FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImplPrologDriver.next(XMLDocumentScannerImpl.java:852)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
… 14 more

问题:

这是因为,Spring就是加载不了bean

解决办法:

Spring bean的一个属性default-lazy-init="true"和关于xsd解析文件版本号,把本来是5.0的版本号改成4.0项目,在再后边加上default-lazy-init=“true”,就能正常启动,如图所示:
在这里插入图片描述

这篇关于org.springframework.beans.factory.xml.XmlBeanDefinitionReader -Ignored XML validation warning问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/364399

相关文章

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

MySQL新增字段后Java实体未更新的潜在问题与解决方案

《MySQL新增字段后Java实体未更新的潜在问题与解决方案》在Java+MySQL的开发中,我们通常使用ORM框架来映射数据库表与Java对象,但有时候,数据库表结构变更(如新增字段)后,开发人员可... 目录引言1. 问题背景:数据库与 Java 实体不同步1.1 常见场景1.2 示例代码2. 不同操作

如何解决mysql出现Incorrect string value for column ‘表项‘ at row 1错误问题

《如何解决mysql出现Incorrectstringvalueforcolumn‘表项‘atrow1错误问题》:本文主要介绍如何解决mysql出现Incorrectstringv... 目录mysql出现Incorrect string value for column ‘表项‘ at row 1错误报错

如何解决Spring MVC中响应乱码问题

《如何解决SpringMVC中响应乱码问题》:本文主要介绍如何解决SpringMVC中响应乱码问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Spring MVC最新响应中乱码解决方式以前的解决办法这是比较通用的一种方法总结Spring MVC最新响应中乱码解

pip无法安装osgeo失败的问题解决

《pip无法安装osgeo失败的问题解决》本文主要介绍了pip无法安装osgeo失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 进入官方提供的扩展包下载网站寻找版本适配的whl文件注意:要选择cp(python版本)和你py

解决Java中基于GeoTools的Shapefile读取乱码的问题

《解决Java中基于GeoTools的Shapefile读取乱码的问题》本文主要讨论了在使用Java编程语言进行地理信息数据解析时遇到的Shapefile属性信息乱码问题,以及根据不同的编码设置进行属... 目录前言1、Shapefile属性字段编码的情况:一、Shp文件常见的字符集编码1、System编码

Spring MVC使用视图解析的问题解读

《SpringMVC使用视图解析的问题解读》:本文主要介绍SpringMVC使用视图解析的问题解读,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Spring MVC使用视图解析1. 会使用视图解析的情况2. 不会使用视图解析的情况总结Spring MVC使用视图

Redis解决缓存击穿问题的两种方法

《Redis解决缓存击穿问题的两种方法》缓存击穿问题也叫热点Key问题,就是⼀个被高并发访问并且缓存重建业务较复杂的key突然失效了,无数的请求访问会在瞬间给数据库带来巨大的冲击,本文给大家介绍了Re... 目录引言解决办法互斥锁(强一致,性能差)逻辑过期(高可用,性能优)设计逻辑过期时间引言缓存击穿:给

SpringBoot中配置文件pom.xml的使用详解

《SpringBoot中配置文件pom.xml的使用详解》SpringBoot的pom.xml文件是Maven项目的核心配置文件,用于定义项目的依赖、插件、构建配置等信息,下面小编就来和大家详细介绍一... 目录1. 基本结构2. 关键部分详解2.1 <modelVersion>2.2 项目坐标2.3 <p

Java程序运行时出现乱码问题的排查与解决方法

《Java程序运行时出现乱码问题的排查与解决方法》本文主要介绍了Java程序运行时出现乱码问题的排查与解决方法,包括检查Java源文件编码、检查编译时的编码设置、检查运行时的编码设置、检查命令提示符的... 目录一、检查 Java 源文件编码二、检查编译时的编码设置三、检查运行时的编码设置四、检查命令提示符