Cause: org.xml.sax.SAXParseException; lineNumber: 57; columnNumber: 22; 元素内容必须由格式正确的字符数据或标记组成

Cause: org.xml.sax.SAXParseException; lineNumber: 57; columnNumber: 22; 元素内容必须由格式正确的字符数据或标记组成_第1张图片sql语句运行没啥问题,写在xml文件中,就显示报红。解决方案:

Cause: org.xml.sax.SAXParseException; lineNumber: 57; columnNumber: 22; 元素内容必须由格式正确的字符数据或标记组成_第2张图片

运行项目后,会报一大堆错误:

13:22:58.006 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - [refresh,591] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'examinationOrderApic': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'examinationOrderService': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'examinationOrderMapper' defined in file [D:\javawebproject\zdxj\ihis-pharmacy\ihis-pharmacy-app\target\classes\com\cechds\examination\mapper\ExaminationOrderMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.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.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\javawebproject\zdxj\ihis-pharmacy\ihis-pharmacy-app\target\classes\mapper\PrescriptionTransferMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 57; columnNumber: 22; 元素内容必须由格式正确的字符数据或标记组成。 13:22:58.008 [main] INFO c.b.d.d.DynamicRoutingDataSource - [destroy,211] - dynamic-datasource start closing .... 13:22:58.009 [main] INFO c.a.d.p.DruidDataSource - [close,2063] - {dataSource-1} closing ... 13:22:58.028 [main] INFO c.a.d.p.DruidDataSource - [close,2136] - {dataSource-1} closed 13:22:58.029 [main] INFO c.b.d.d.DynamicRoutingDataSource - [destroy,215] - dynamic-datasource all closed success,bye 13:22:58.030 [main] INFO o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat] 13:22:58.066 [main] ERROR o.s.b.SpringApplication - [reportFailure,821] - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'examinationOrderApic': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'examinationOrderService': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'examinationOrderMapper' defined in file [D:\javawebproject\zdxj\ihis-pharmacy\ihis-pharmacy-app\target\classes\com\cechds\examination\mapper\ExaminationOrderMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.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.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\javawebproject\zdxj\ihis-pharmacy\ihis-pharmacy-app\target\classes\mapper\PrescriptionTransferMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 57; columnNumber: 22; 元素内容必须由格式正确的字符数据或标记组成。 at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:332) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) at com.cechds.Application.main(Application.java:20)

你可能感兴趣的:(xml,java,数据库)