2 Replies Latest reply on Aug 10, 2007 7:50 AM by Ferdinand Funke

    Parsing XML file out of jar

    Ferdinand Funke Newbie

      Hello,
      I am trying to parse a XML file out of my jar which is deployed in JBOSS_HOME/server/default/deploy. But when I load the file with

      String path="DBConfig.xml";
      configFile=builder.build(new InputSource(path));
      


      I always get the following exception:

      14:51:36,671 ERROR [STDERR] java.io.FileNotFoundException: C:\j2ee\jboss420\bin\DBConfig.xml
      14:51:36,671 ERROR [STDERR] at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:94)
      14:51:36,671 ERROR [STDERR] at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:103)
      14:51:36,671 ERROR [STDERR] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
      14:51:36,671 ERROR [STDERR] at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
      14:51:36,671 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)


      Here C:\j2ee\jboss420\ is my JBOSS_HOME directory.

      Is there any way to load the file without using the classloader? For example a standard path in the jar file where such files can be stored? Or can I configure JBoss to search for the file in a specified directory?

      Thanks for any help on this issue.

      Best regards,

      dr_doom