2 Replies Latest reply on Oct 9, 2004 9:35 AM by crashedsnow

    Running JBoss offline, DTD Validation fails for struts-confi

    Michael Meyer Newbie

      I ran into a problem when running JBoss offline on my notebook with struts, the server failed to deploy the struts-examples.war because it could not resolve the DTD vor struts-config.xml, (see quote below).

      I know that JBoss uses JBossEntityResolver.java to resolve some common DTD and XSD files.

      How can I get JBoss to resolve other DTD's locally?

      Do I have to comment out the DTD's when running offline?

      Thanks,
      Michael


      20:24:21,031 INFO [TomcatDeployer] deploy, ctxPath=/struts-examples, warUrl=file:/D:/DATA/java/jboss-4.0.0/server/default/tmp/deploy/tmp60993struts-examples-exp.war/
      20:24:43,078 ERROR [ActionServlet] Parsing error processing resource path /WEB-INF/validator/struts-config.xml
      java.net.SocketException: Connection reset by peer: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:452)
      at java.net.Socket.connect(Socket.java:402)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
      at sun.net.www.http.HttpClient.New(HttpClient.java:339)
      at sun.net.www.http.HttpClient.New(HttpClient.java:320)
      at sun.net.www.http.HttpClient.New(HttpClient.java:315)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626)
      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)


        • 1. Re: Running JBoss offline, DTD Validation fails for struts-c
          Scott Stark Master

          No, we don't have the entity resolver local entity set externalized such that it could be expanded. Create an RFE on sourceforge and we can look into adding this.

          • 2. Re: Running JBoss offline, DTD Validation fails for struts-c
            crashedsnow Newbie

            I had the same problem and finally found a solution that worked for me.

            In the DOCTYPE declaration for struts-config (etc) you will see the reference to the DTD used to validate the XML file. Usually something like this:

            <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

            Given this is struts, I am assuming this is for a webapp so create a directory under WEB-INF called "dtds" or something. Then get this actual dtd from the struts distributable or from the URL in the doctype declaration and put it in your local dtds directory.

            EG

            WEB-INF/dtds/struts-config_1_2.dtd

            Then change the DOCTYPE declaration to:


            <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "dtds/struts-config_1_2.dtd">

            This tells the XML validator to look in the local (relative) path for the DTD. This assumes your struts-config.xml is in the WEB-INF root.

            Hope it works for you