0 Replies Latest reply on Oct 18, 2010 1:03 PM by sat90210

    Connection Timed out while parsing XML - Issue with JbossEntityResolverMgr

    sat90210

      Hi, I am trying to parse an input file in JBoss AS 4.2.3 GA. I have defined JbossEntityResolverMgr as Jboss Service. But While parsing the input xml, request is timing out. I suspect that the EntityResolverMgr is not picking up the local path for the dtd in the input xml.

      Here is my JBossEntityResolverMgr settings

       

      <mbean code="org.jboss.services.xml.JBossEntityResolverMgr"
            name="jboss.xml:service=JBossEntityResolverMgr">
            <attribute name="WarnOnNonFileURLs">true</attribute>
            <attribute name="EntityMap">     
            http\://www.xxx.com/support/tech/dtd/yyy/ZZZScheduleUploadRequest.dtd=dtd/ZZZScheduleUploadRequest.dtd
            </attribute>
         </mbean>

       

      my input XML starts with

       

      <!DOCTYPE EES SYSTEM "http://www.xxx.com/support/tech/dtd/yyy/ZZZScheduleUploadRequest.dtd">

       

      Error in the logs:

      Error when parsing an XML file using parser in servlet in public Document parse(InputStream aFile, String filename) throws AppError
      java.net.ConnectException: Connection timed out: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.Socket.connect(Socket.java:519)
          at java.net.Socket.connect(Socket.java:469)
          at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:382)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:509)
          at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
          at sun.net.www.http.HttpClient.New(HttpClient.java:304)
          at sun.net.www.http.HttpClient.New(HttpClient.java:316)
          at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:817)
          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:769)
          at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:694)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:938)
          at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
          at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
          at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
          at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.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(Unknown Source)

       

       

      Just wondering if starting the JbossEntityResolverMgr mbean service with the systemId/publicId - dtd/schema mapping  is enough or do we need to set the entityResolver to the parser that is being used to parse the input file?