当前位置: 首页 > news >正文

jdk11环境 提示“因为 accessExternalDTD 属性设置的限制导致不允许 ‘http‘ 访问“bug

在运行mybatis源码的时候,提示一下错误:

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:82)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:66)at org.fkit.test.OneToManyTest.main(OneToManyTest.java:16)
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:256)at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:125)at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:75)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:79)... 2 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:254)... 5 more

由于我的用的是jdk11,解决方案是在%JAVA_HOEE%\conf 目录下,新建一个文件jaxp.properties,内容:

javax.xml.accessExternalSchema=all
javax.xml.accessExternalDTD=all

就可以解决了

http://www.lryc.cn/news/101111.html

相关文章:

  • Android Studio 的版本控制Git
  • 一个 SpringBoot 项目能处理多少请求
  • Python中的r字符串前缀及其用法详解
  • LabVIEW实现三相异步电机磁通模型
  • 读书会-《影响力》
  • 141. 环形链表
  • 学习笔记|大模型优质Prompt开发与应用课(二)|第一节:大模型应用密码—Prompt的一千种打开方式
  • QT chart进行画图
  • Web3将自己写在合约中的代币添加到MetaMask中管理
  • 【微信小程序】显示自带的弹窗,包括加载中,成功,错误,提示,警告
  • vue-element-plus-admin框架的tag上下文切换bug
  • vue中,父子组件传递参数 props 实现方式
  • Unity如何快速接入iOS和GooglePlay的成就排行榜等GameCenter功能
  • Unity下如何实现低延迟的全景RTMP|RTSP流渲染
  • STM32 USB使用记录:HID类设备(后篇)
  • C# 快速写入日志 不卡线程 生产者 消费者模式
  • Pandas将对角线元素设为1
  • WPF实战学习笔记28-登录界面
  • 01背包
  • 064、故障处理之OMM_TiDB
  • 网络设备中的配置文件管理
  • HCIP BGP综合实验
  • 【mysql学习篇】Order by与Group by优化以及排序算法详解
  • 【业务功能篇60】Springboot + Spring Security 权限管理 【终篇】
  • 文章详情页 - 评论功能的实现
  • 使用贝叶斯滤波器通过运动模型和嘈杂的墙壁传感器定位机器人研究(Matlab代码实现)
  • Day 69-70:矩阵分解
  • 数据结构:树的存储结构
  • Vue前端渲染blob二进制对象图片的方法
  • Java的标记接口(Marker Interface)