`
zhb8015
  • 浏览: 397116 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
Group-logo
Spring Roo杂谈
浏览量:0
社区版块
存档分类
最新评论

求助: exception is java.net.UnknownHostException: mybatis.org

阅读更多

报错: exception is java.net.UnknownHostException: mybatis.org

现象:连网时没有问题,断网时就会报错。

详细信息:

 

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\beyond\WEB-INF\classes\common\mybatis-config.xml]; nested exception is java.net.UnknownHostException: mybatis.org
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:408)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
 at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
 at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
 at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
 at org.apache.catalina.core.StandardService.start(StandardService.java:525)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.net.UnknownHostException: mybatis.org
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
 at java.net.Socket.connect(Socket.java:519)
 at java.net.Socket.connect(Socket.java:469)
 at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
 at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
 at sun.net.www.http.HttpClient.New(HttpClient.java:306)
 at sun.net.www.http.HttpClient.New(HttpClient.java:323)
 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:837)
 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:778)
 at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:703)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1026)
 at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
 at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
 at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
 at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1192)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1089)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1002)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
 at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
 at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
 at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
 ... 28 more

 

 

分享到:
评论
1 楼 zhb8015 2014-02-21  
有一个解决的方法:
把DTD文件从mybatis.jar中拿出来,配置mybatis-config.xml header

<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"C:\Users\peter\Desktop/mybatis-3-config.dtd">

必须配置绝对路径,就能正常启动。

怀疑是不是包不对?

相关推荐

    Caused by: java.net.UnknownHostException: openapi.alipay.com

    Caused by: java.net.UnknownHostException: openapi.alipay.com

    linux系统下部署TOMCAT错误java.net.UnknownHostException bogon bogon

    linux系统下部署TOMCAT异常错误java.net.UnknownHostException :bogon: bogon 主要原因是主机映射原因 修改hosts文件即可

    linux系统下部署TOMCAT错误java.net.UnknownHostException bogon bogon.docx

    java HashMapDemo.java

    java HashMapDemo.java

    项目源码-java网络五子棋游戏

    【项目源码】-java网络...import java.net.UnknownHostException; import java.sql.Time; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; /** * 登录面板 *

    jmeter-plugins-manager-1.4.jar插件

    支持JMS(Java消息服务)协议,使得JMeter可以用于测试消息中间件的性能。 5. **Graph Results** 提供了丰富的图表组件,如响应时间和吞吐量图,帮助用户直观地理解测试结果。 四、注意事项 在使用Plugins ...

    java、.net

    Java 和 .NET 是两个主要的软件开发平台,它们各自提供了丰富的工具和技术来构建各种类型的应用程序。这两个平台在很多方面都有交集,但也各有特点。 Java 是一种面向对象的编程语言,由Sun Microsystems(现在是...

    consul客户端本地开发

    例如,在Java应用中,可以使用官方提供的`consul-client`库,通过`Registration`对象设置服务信息并调用`AgentService.register()`方法。对于其他语言,也有相应的SDK或HTTP请求实现。 5. **健康检查** Consul支持...

    DBeaver连接mysql数据库图文教程

    **DBeaver 连接 MySQL 数据库的详细步骤** DBeaver 是一款强大的数据库管理工具,因其免费、开源且支持多种数据库的特点,深受开发者和DBA的青睐。它提供了直观的用户界面,使得数据库的管理和操作变得更加简单。...

    java网络编程示例

    import java.net.UnknownHostException; public class TCPClient { public static void main(String[] args) { try { Socket socket = new Socket("127.0.0.1",4444); OutputStream oStream = socket....

    项目源码-java企业QQ项目

    import java.net.UnknownHostException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java...

    ip6-java.zip

    7. **配置和属性**:Java系统属性如`java.net.preferIPv6Addresses`和`java.net.preferIPv4Stack`可以用来配置系统首选的IP版本。 8. **异常处理**:处理网络编程中常见的异常,如`UnknownHostException`, `...

    ResidentialAreaMap:ResidentialAreaMap-android

    参考百度Java文档Android Studio模拟定位服务 (安装插件)无法从百度获取地图数据错误显示如下: java.net.UnknownHostException: Unable to resolve host "loc.map.baidu.com": No address associated with ...

    计算机网络实验报告 获取MAC socket通信

    import java.net.UnknownHostException; public class FileClient { /** * @param args */ public static void main(String[] args) { // 文件的输出流 try { java.io.FileOutputStream fos = new ...

    srping-cloud-alibaba-nacos-feign.zip

    Feign允许开发者通过接口定义来调用其他服务,提供了类似Java的注解方式来指定HTTP请求的路径、方法、参数等。 整合Nacos和Feign,可以让服务间的调用更加简洁和高效: 1. 引入Spring Cloud Alibaba Nacos Config和...

    Android错误解决方法大集合

    一、 android java.net.UnknownHostException: Unable to resolve host"...": No address associated 错误 该错误是 Android 开发中常见的错误,主要是由于网络连接未开启或 Manifest 文件未标明网络访问权限所致。...

    用java获取IP地址

    import java.net.UnknownHostException; public class NsLookup { public static void main(String[] args) { try { InetAddress address = InetAddress.getByName(args[0]); // 获取指定域名的InetAddress对象 ...

    TCP并发上传——java源码

    import java.net.UnknownHostException; public class ClientDemo { public static void main(String[] args) { try { InputStream in = new FileInputStream("D:\\Client"); byte[] buf = new byte[1024*1024...

    Tools.java

    import java.net.UnknownHostException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import net.sf.json.JSONArray; import org.apache.commons.codec.binary....

    java获取ipjava获取ipjava获取ipjava获取ipjava获取ip

    import java.net.UnknownHostException; public class Main { public static void main(String[] args) { try { InetAddress.getLocalHost(); // 获取本地主机的InetAddress对象 System.out.println("本地主机...

Global site tag (gtag.js) - Google Analytics