Tag Archives: Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134;

[Solved]Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134; Document root element “beans&quo…

Let’s take a look at my question first

.   ____          _            __ _ _

 /\\/___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, |////

 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::        (v1.3.3.RELEASE)



[2019-08-08 16:59:02.836] boot - 7212  INFO [main] --- BootMoreApplication: Starting BootMoreApplication on DESKTOP-1002GUL with PID 7212 (F:\Workidea\dubboOne\server\target\classes started by Liang in F:\Workidea\dubboOne)

[2019-08-08 16:59:02.843] boot - 7212  INFO [main] --- BootMoreApplication: No active profile set, falling back to default profiles: default

[2019-08-08 16:59:03.014] boot - 7212  INFO [main] --- AnnotationConfigEmbeddedWebApplicationContext: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2805d709: startup date [Thu Aug 08 16:59:03 CST 2019]; root of context hierarchy

[2019-08-08 16:59:04.765] boot - 7212  INFO [main] --- XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [spring/spring-jdbc.xml]

[2019-08-08 16:59:04.963] boot - 7212  INFO [main] --- XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [spring/spring-dubbo.xml]

[2019-08-08 16:59:05.028] boot - 7212  INFO [main] --- LoggerFactory: using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter

[2019-08-08 16:59:05.071] boot - 7212  WARN [main] --- ClassPathMapperScanner: No MyBatis mapper was found in '[com.debug.liang.dubbo.one.model.mapper]' package. Please check your configuration.

[2019-08-08 16:59:05.293] boot - 7212  INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]

[2019-08-08 16:59:05.321] boot - 7212  WARN [main] --- ClassPathMapperScanner: No MyBatis mapper was found in '[com.debug.liang.dubbo.one.server]' package. Please check your configuration.

[2019-08-08 16:59:05.455] boot - 7212  INFO [main] --- ServiceAnnotationBeanPostProcessor:  [DUBBO] BeanNameGenerator bean can't be found in BeanFactory with name [org.springframework.context.annotation.internalConfigurationBeanNameGenerator], dubbo version: 2.6.5, current host: 192.168.0.103

[2019-08-08 16:59:05.455] boot - 7212  INFO [main] --- ServiceAnnotationBeanPostProcessor:  [DUBBO] BeanNameGenerator will be a instance of org.springframework.context.annotation.AnnotationBeanNameGenerator , it maybe a potential problem on bean name generation., dubbo version: 2.6.5, current host: 192.168.0.103

[2019-08-08 16:59:05.456] boot - 7212  WARN [main] --- ServiceAnnotationBeanPostProcessor:  [DUBBO] No Spring Bean annotating Dubbo's @Service was found under package[com.debug.liang.dubbo.one.server.service.dubbo], dubbo version: 2.6.5, current host: 192.168.0.103

[2019-08-08 16:59:05.891] boot - 7212  INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$8fc9bf26] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

[2019-08-08 16:59:06.707] boot - 7212  INFO [main] --- TomcatEmbeddedServletContainer: Tomcat initialized with port(s): 8093 (http)

[2019-08-08 16:59:06.727] boot - 7212  INFO [main] --- StandardService: Starting service Tomcat

[2019-08-08 16:59:06.729] boot - 7212  INFO [main] --- StandardEngine: Starting Servlet Engine: Apache Tomcat/8.0.32

[2019-08-08 16:59:07.557] boot - 7212  INFO [localhost-startStop-1] --- TldScanner: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

[2019-08-08 16:59:07.567] boot - 7212  INFO [localhost-startStop-1] --- [/]: Initializing Spring embedded WebApplicationContext

[2019-08-08 16:59:07.567] boot - 7212  INFO [localhost-startStop-1] --- ContextLoader: Root WebApplicationContext: initialization completed in 4553 ms

[2019-08-08 16:59:08.123] boot - 7212  INFO [localhost-startStop-1] --- ServletRegistrationBean: Mapping servlet: 'dispatcherServlet' to [/]

[2019-08-08 16:59:08.134] boot - 7212  INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'characterEncodingFilter' to: [/*]

[2019-08-08 16:59:08.135] boot - 7212  INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'hiddenHttpMethodFilter' to: [/*]

[2019-08-08 16:59:08.136] boot - 7212  INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'httpPutFormContentFilter' to: [/*]

[2019-08-08 16:59:08.136] boot - 7212  INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'requestContextFilter' to: [/*]

[2019-08-08 16:59:08.585] boot - 7212  INFO [main] --- DruidDataSource: {dataSource-1} inited

[2019-08-08 16:59:08.962] boot - 7212  INFO [main] --- RequestMappingHandlerAdapter: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2805d709: startup date [Thu Aug 08 16:59:03 CST 2019]; root of context hierarchy

[2019-08-08 16:59:09.049] boot - 7212  INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)

[2019-08-08 16:59:09.051] boot - 7212  INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)

[2019-08-08 16:59:09.102] boot - 7212  INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

[2019-08-08 16:59:09.102] boot - 7212  INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

[2019-08-08 16:59:09.158] boot - 7212  INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

[2019-08-08 16:59:09.319] boot - 7212  WARN [main] --- AnnotationConfigEmbeddedWebApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134; The document root element "beans" must match the DOCTYPE root "null".

[2019-08-08 16:59:09.328] boot - 7212  INFO [main] --- DruidDataSource: {dataSource-1} closed

[2019-08-08 16:59:09.329] boot - 7212  INFO [main] --- ReferenceAnnotationBeanPostProcessor: class com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!

[2019-08-08 16:59:09.332] boot - 7212  INFO [main] --- StandardService: Stopping service Tomcat

[2019-08-08 16:59:09.343] boot - 7212 ERROR [main] --- SpringApplication: Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134; The document root element "beans" must match the DOCTYPE root "null".

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)

at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)

at com.debug.liang.dubbo.one.server.BootMoreApplication.main(BootMoreApplication.java:23)

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134; The document root element "beans" must match the DOCTYPE root "null".

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)

... 18 more

Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134; The document root element "beans" must match the DOCTYPE root "null".
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:259)

at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:125)

at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:78)

at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:407)

at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:381)

at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:546)

at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration.sqlSessionFactory(MybatisAutoConfiguration.java:130)

at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$e62baa56.CGLIB$sqlSessionFactory$0(<generated>)

at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$e62baa56$$FastClassBySpringCGLIB$$4e374310.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)

at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$e62baa56.sqlSessionFactory(<generated>)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

... 19 more

Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 134; The document root element "beans" must match the DOCTYPE root "null".

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.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1599)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1877)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1289)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$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.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)

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.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:257)

... 35 more

[2019-08-08 16:59:09.364] boot - 7212  WARN [main] --- SpringApplication: Error handling failed (Error creating bean with name 'referenceAnnotationBeanPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' is defined)

[2019-08-08 16:59:09.365] boot - 7212  INFO [DubboShutdownHook] --- DubboShutdownHook:  [DUBBO] Run shutdown hook now., dubbo version: 2.6.5, current host: 192.168.0.103

[2019-08-08 16:59:09.368] boot - 7212  INFO [DubboShutdownHook] --- AbstractRegistryFactory:  [DUBBO] Close all registries [], dubbo version: 2.6.5, current host: 192.168.0.103

Disconnected from the target VM, address: '127.0.0.1:59206', transport: 'socket'

As you can see, the project can be started and the port is 8093

However, the reason for the suspension is found in the. XML file under resources from Baidu

I’m here because the mybatis. XML file is incorrectly configured

Go to the Internet to find a complete copy in it