But is it the reloader that loads classes the first time classes are
accessed (like when the servlet container is started for the first
time)?
I am having the issue where I can't even deploy my application (which
is in WAR form) because the class reloader can't find a class inside
my WAR. The fact that it can't find the class is not the surprise. I
am surprised that the reloader is 'reloading' a class when this is the
first time the class is being accessed.
I got around this by adding the class path to the exploded directory
on the server - but this makes the induction xml much less portable.
Is the class reloader the only way classes are loaded into induction?
If so, then is it the case that no application should be deployed in
WAR format for now?
thanks,
david
I understand that the class reloader can not reload classes if the
application is deployed using a war file.
But is it the reloader that loads classes the first time classes are
accessed (like when the servlet container is started for the first
time)?
I am having the issue where I can't even deploy my application (which
is in WAR form) because the class reloader can't find a class inside
my WAR. The fact that it can't find the class is not the surprise. I
am surprised that the reloader is 'reloading' a class when this is the
first time the class is being accessed.
I got around this by adding the class path to the exploded directory
on the server - but this makes the induction xml much less portable.
Is the class reloader the only way classes are loaded into induction?
If so, then is it the case that no application should be deployed in
WAR format for now?
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.
david
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.
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