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

相关文章

MybatisGenerator文件生成不出对应文件的问题

《MybatisGenerator文件生成不出对应文件的问题》本文介绍了使用MybatisGenerator生成文件时遇到的问题及解决方法,主要步骤包括检查目标表是否存在、是否能连接到数据库、配置生成... 目录MyBATisGenerator 文件生成不出对应文件先在项目结构里引入“targetProje

C#使用HttpClient进行Post请求出现超时问题的解决及优化

《C#使用HttpClient进行Post请求出现超时问题的解决及优化》最近我的控制台程序发现有时候总是出现请求超时等问题,通常好几分钟最多只有3-4个请求,在使用apipost发现并发10个5分钟也... 目录优化结论单例HttpClient连接池耗尽和并发并发异步最终优化后优化结论我直接上优化结论吧,

Java内存泄漏问题的排查、优化与最佳实践

《Java内存泄漏问题的排查、优化与最佳实践》在Java开发中,内存泄漏是一个常见且令人头疼的问题,内存泄漏指的是程序在运行过程中,已经不再使用的对象没有被及时释放,从而导致内存占用不断增加,最终... 目录引言1. 什么是内存泄漏?常见的内存泄漏情况2. 如何排查 Java 中的内存泄漏?2.1 使用 J

在MyBatis的XML映射文件中<trim>元素所有场景下的完整使用示例代码

《在MyBatis的XML映射文件中<trim>元素所有场景下的完整使用示例代码》在MyBatis的XML映射文件中,trim元素用于动态添加SQL语句的一部分,处理前缀、后缀及多余的逗号或连接符,示... 在MyBATis的XML映射文件中,<trim>元素用于动态地添加SQL语句的一部分,例如SET或W

Python xmltodict实现简化XML数据处理

《Pythonxmltodict实现简化XML数据处理》Python社区为提供了xmltodict库,它专为简化XML与Python数据结构的转换而设计,本文主要来为大家介绍一下如何使用xmltod... 目录一、引言二、XMLtodict介绍设计理念适用场景三、功能参数与属性1、parse函数2、unpa

关于Maven中pom.xml文件配置详解

《关于Maven中pom.xml文件配置详解》pom.xml是Maven项目的核心配置文件,它描述了项目的结构、依赖关系、构建配置等信息,通过合理配置pom.xml,可以提高项目的可维护性和构建效率... 目录1. POM文件的基本结构1.1 项目基本信息2. 项目属性2.1 引用属性3. 项目依赖4. 构

numpy求解线性代数相关问题

《numpy求解线性代数相关问题》本文主要介绍了numpy求解线性代数相关问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧... 在numpy中有numpy.array类型和numpy.mat类型,前者是数组类型,后者是矩阵类型。数组

解决systemctl reload nginx重启Nginx服务报错:Job for nginx.service invalid问题

《解决systemctlreloadnginx重启Nginx服务报错:Jobfornginx.serviceinvalid问题》文章描述了通过`systemctlstatusnginx.se... 目录systemctl reload nginx重启Nginx服务报错:Job for nginx.javas

Redis缓存问题与缓存更新机制详解

《Redis缓存问题与缓存更新机制详解》本文主要介绍了缓存问题及其解决方案,包括缓存穿透、缓存击穿、缓存雪崩等问题的成因以及相应的预防和解决方法,同时,还详细探讨了缓存更新机制,包括不同情况下的缓存更... 目录一、缓存问题1.1 缓存穿透1.1.1 问题来源1.1.2 解决方案1.2 缓存击穿1.2.1

vue解决子组件样式覆盖问题scoped deep

《vue解决子组件样式覆盖问题scopeddeep》文章主要介绍了在Vue项目中处理全局样式和局部样式的方法,包括使用scoped属性和深度选择器(/deep/)来覆盖子组件的样式,作者建议所有组件... 目录前言scoped分析deep分析使用总结所有组件必须加scoped父组件覆盖子组件使用deep前言