Announcement Announcement Module
Collapse
No announcement yet.
BeansDtdResolver failure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BeansDtdResolver failure

    The following error occurs during this execution "Trying to resolve XML entity with public ID [-//iBATIS.com//DTD SQL Map Config 2.0//EN] and system ID [http://ibatis.apache.org/dtd/sql-map-config-2.dtd]". When I point my browser to "http://ibatis.apache.org/dtd/sql-map-config-2.dtd" the document opens without a problem.

    I am trying to use Spring and iBatis together with Spring doing all the managing, utilizing "org.springframework.orm.ibatis.SqlMapClientFactor yBean". The DTD definition above is located in my sql-map-config.xml file, which is the only file with a non-Spring DTD definition. The other configuration files are parsed correctly.

    I have not tried deploying a simple app, trying to get JUnit test cases working first.

    Any suggestions?

    Error that I receive.

    org.springframework.beans.factory.BeanDefinitionSt oreException: IOException parsing XML document from class path resource [sql-map-config.xml]; nested exception is java.net.ConnectException: Connection timed out: connect
    java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown Source)
    at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown Source)
    at sun.net.http://www.protocol.http.HttpURLConn...Stream(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.setupCurre ntEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntit y(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEn tity(Unknown Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputS ource(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDD ispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:254)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:205)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:180)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:126)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:142)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:113)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:81)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:279)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:87)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:72)
    at org.springframework.test.AbstractSpringContextTest s.loadContextLocations(AbstractSpringContextTests. java:121)
    at org.springframework.test.AbstractDependencyInjecti onSpringContextTests.loadContextLocations(Abstract DependencyInjectionSpringContextTests.java:210)
    at org.springframework.test.AbstractSpringContextTest s.getContext(AbstractSpringContextTests.java:101)
    at org.springframework.test.AbstractDependencyInjecti onSpringContextTests.setUp(AbstractDependencyInjec tionSpringContextTests.java:178)
    at junit.framework.TestCase.runBare(TestCase.java:125 )
    at junit.framework.TestResult$1.protect(TestResult.ja va:106)
    at junit.framework.TestResult.runProtected(TestResult .java:124)
    at junit.framework.TestResult.run(TestResult.java:109 )
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:2 08)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:478)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:344)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)

  • #2
    This problem appears usually if the XML parser (xerces) is old - the new versions are able to look the dtd in the classpath (inside the jars). See the answer for the same type of problem from HB site: http://www.hibernate.org/116.html#A34

    Comment


    • #3
      I don't think it is the parser because I have the latest Xerces parser, I think I just downloaded it prior to posting this msg. And also, it is able to resolve the DTDs for the SpringFramework config files.

      I will try change the iBatis file to a System id.

      Thx

      Comment


      • #4
        The suggestion from the Hibernate link resolved my issue.

        Thx Costin

        Comment


        • #5
          Hi Nicodemus, I am hitting same issue and could not find any answer yet the hibernate post link above seems to be broken. Do you remember what was the fix for issue? I am using jdk1.6 and spring 3.0 and xerces 2.9.11

          Comment

          Working...
          X