2 Replies Latest reply on Mar 17, 2003 12:56 PM by digitalwarrior

    XML Application File Not Found

    digitalwarrior Newbie

      I have an XML file that I need to parse in my application but when I Use JDOM to open the file and try to parse it I get a JDOMException.

      This is the code:

      SAXBuilder builder = new SAXBuilder();
      Document doc = builder.build("SubGPUs.xml");
      Element docRoot = doc.getRootElement();

      This is the error:

      Error in building: C:\jboss-3.0.4_tomcat-4.1.12\bin\SubGPUs.xml

      I've tried putting the xml file in my web-inf, classes, lib, and even the root of my WAR file, but it can't find it. For some reason it's looking in the bin directory of JBoss. If I put it in the bin directory it finds it and parses it just fine. It needs to be in the WAR file.

      Is there some configuration issue that can solve this?
      I've seen postings similar to this, but none found the solution for my problem.

      Thanks in advance........

        • 1. Re: XML Application File Not Found
          digitalwarrior Newbie

          this.getClass().getClassLoader().getResource("SubGPUs.xml").getFile()

          This will find the file in the root of the WAR file and return the path. This works, but I still shouldn't have to explicitly make the application look inside itself like this.

          In the previous version of JBoss I had no problems with this, I put the file in the web-inf/classes directory and it found it.

          The version I'm using is Jboss-3.0.4_Tomcat-4.1.12.

          If anyone has any other suggestions, please let me know.

          • 2. Re: XML Application File Not Found
            digitalwarrior Newbie

            this.getClass().getClassLoader().getResource("SubGPUs.xml").getFile()

            This will find the file in the root of the WAR file and return the path. This works, but I still shouldn't have to explicitly make the application look inside itself like this.

            In the previous version of JBoss I had no problems with this, I put the file in the web-inf/classes directory and it found it.

            The version I'm using is Jboss-3.0.4_Tomcat-4.1.12.

            If anyone has any other suggestions, please let me know.