I still have problems...here is a detailed description of what I did
and the result:
To describe the scenario visually i also draw 'stick' figures
Scenario 1:
- I had all my resources (including induction.xml) in the WEB-INF
folder.
- In inductionl.xml I had in <java-class-path> the paths to WEB-INF,
WEB-INF/classes
visual representation of scenario 1:
---------------------------------------------------------
\WEB-INF (java-class-path points here)
[xml resources here, induction.xml here]
\classes (java-class-path points here)
---------------------------------------------------------
this WORKS, but I want to get rid of all java-class-path entries
Scenario 2:
- I put all resources (including induction.xml) in WEB-INF\classes
folder
- I removed all <java-class-path> entries from induction.xml
visual representation of scenario 2:
---------------------------------------------------------
\WEB-INF
\classes
[xml resources here, induction.xml here (induction.xml could
not be found!) ]
---------------------------------------------------------
this DID NOT work - I got an error from the XMLConfigLoader when it
tried to load induction.xml..it could not find induction.xml
Scenario 3:
- I moved induction.xml to WEB-INF without changing anything else.
- So at this point there is still no <java-class-path> entries in
Induction.xml
- Also all my other resources are in the WEB-INF classes folder
visual representation of scenario 3:
---------------------------------------------------------
\WEB-INF
[induction.xml here]
\classes
[xml resources here]
(error - could not find application classes!)
---------------------------------------------------------
this DID NOT work - it could not find my application class files (even
though they are in the WEB-INF/classes folder)
Scenario 4:
- i added <java-class-path> for WEB-INF/classes only
visual representation of scenario 3:
---------------------------------------------------------
\WEB-INF
[induction.xml here]
\classes (java-class-path points here)
[xml resources here]
---------------------------------------------------------
this WORKS
This is a big improvement over scenario 1 where I only have java-class-
path for WEB-INF classes.
All resources except for induction.xml are in resources.
Summary:
- if resources are in WEB-INF you need java-class-path to WEB-INF
- i could not find a scenario where i did not need to specify WEB-INF
classes in java-class-path
david
On Feb 21, 1:04 pm, Adinath <adin...@acciente.com> wrote:
> On Sun, Feb 21, 2010 at 10:47 AM, DavidNia <da
...@3dex.com> wrote:
> > Yes, I do have a <java-class-path>.
> > My application loads resources (property file) through the
> > ClassLoader.getResourceAsStream().
> > I think I can get around this by putting the resource I am accessing
> > the 'classes' folder. That way I can get rid of the <java-class-path>
> > altogether.
> > I will submit the result of what happens when I put the resource in
> > the 'classes' folder.
> Correct, you do not need a an Induction classpath (specified in
> <java-class-path>) for ClassLoader.getResourceAsStream() to work, that works
> via any classloader.
> Adi
> --
> Acciente, LLC
> Systems Architecture and Software Design
> www.acciente.comwww.inductionframework.org