[jboss-user] [Beginners Corner] - Parsing XML file out of jar

dr_doom do-not-reply at jboss.com
Thu Aug 9 03:08:10 EDT 2007


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:

anonymous wrote : 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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072338#4072338

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072338



More information about the jboss-user mailing list