users@glassfish.java.net

locating a static file on glassfish?

From: <glassfish_at_javadesktop.org>
Date: Sat, 10 Feb 2007 12:15:02 PST

I'm getting an exception because glassfish can't find my file.

Caused by: java.io.FileNotFoundException: C:\code\glassfish\domains\myDomain\config\applications\j2ee-modules\MyAPP\courses\course_7\course.xml (The system cannot find the path specified)

       String resourceLoc = "applications\j2ee-modules\MyAPP\courses\course_7\course.xml";
       DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
       docBuilder = docBuilderFactory.newDocumentBuilder();
        File docFile = new File(resourceLoc);
        doc = docBuilder.parse (docFile);

1. Why does it think my file lives in config?

The file actually lives in:
C:\code\glassfish\domains\myDomain\applications\j2ee-modules\MyAPP\courses\course_7\course.xml

2. How best to fix it so I'm locating the correct file. I'm tempted to use "../appliications", but that seems like a hack.

Advice?
[Message sent by forum member 'tmonteit' (tmonteit)]

http://forums.java.net/jive/thread.jspa?messageID=203124