天天看點

nested exception is com.ibatis.common.exception.NestedRuntimeException: Error o

今天在整合Spring+Ibatis+Struts2的時候,啟動的時候報一個spring 初始化ibatis執行個體的時候,連接配接逾時的異常..

原因是因為我在配置的時候,

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sqlMapConfig     

    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"     

    "https://ibatis.apache.org/dtd/sql-map-config-2.dtd">

我不小心把http連結改成了https,導緻連接配接逾時.。把https改成http就行啦..

錯誤資訊:

嚴重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.net.ConnectException: Connection timed out: connect

Caused by: java.net.ConnectException: Connection timed out: connect

Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.net.ConnectException: Connection timed out: connect

Caused by: java.net.ConnectException: Connection timed out: connect

 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)

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

 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

 at java.security.AccessController.doPrivileged(Native Method)

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

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