Hello ,
I was hunting several related 'bugs' for a couple of days.
The problem in your case is that you have some bad file / directory
name inside the 'repositories' statement
repositories=NONE/servlets
JServ can't instantiate new classloader for this repository.
in JServ1.1 you'll get warning message inside the jserv.log file, but
as far as I remember you won't see this message with JServ 1.1beta3
(not sure thought, but I had to add a lot of additional logging myself ....)
try {
loader = new AdaptiveClassLoader(repository);
} catch (IllegalArgumentException e) {
JServ.log.log(CH_WARNING,"Error creating classloader for servlet zone " +
name + " : " + e.toString());
}
the line that throws NullPointerException is
public synchronized void checkReload(JServSendError errorHandler) {
>> if ((checkClasses && loader.shouldReload()) ||
(checkFile && confFile.lastModified() != lastInitialization)) {
I had several other BAD experiences while I was playing with .jps and
.gsp engines and some other configuration - generally speaking
1. the 'correct' URL does not work (browser is waiting ...).
2. you won't see anything inside the logs
which is very frustrating.
JServ should at least.
1. send 'JServ is not initialized' answer to the browser (or at least
'Internal Error', but LOG that message) when there are configuration
problems.
2. catch all Throwable ! (not only Exceptions) everywhere and log them
(and send the appropriate answer to the browser).
(note that the other frustrating problem was that the line
loader.getResourceAsStream(classname.replace('.', File.separatorChar) +
".initArgs");
which is part of the method
protected JServContext load_init(String name, JServSendError se)
throws NullPointerException
:( - which 'disappears inside the cyberspace' :(
Simple error messages displayed inside the browser and good logging
will make JServ much better.
I can invest some time in JServ (I like GNU), I'm (almost) Java
expert, but I've never participated in such a 'Internet projects' and
as you can see, my English is not very good :(
If anybody is interested (jon* ?), please contact me
P.S.
for the curious ones
NullPointerException comes from
AdaptiveClassLoader.getResourceAsStream()
when you are using .jar / .zip filename with '/' on Windows machine -
like 'd:/temp/jspservlet.jar'
--- the code ---
else if(name.endsWith(".initArgs")) {
File dir = new File(file.getParent()); // file.getParent()
== null
s = loadResourceFromDirectory(dir, name);
} else {
--- code end ---
Wednesday, January 19, 2000, 8:41:37 AM, you wrote:
PG> in zone.properties, the default file has
PG> repositories=NONE/servlets
PG> I changed this to
PG> repositories=/usr/local/jserv/libexec/NONE/servlets
PG> I also did a
PG> cp examples/NONE /usr/local/jserv/libexec -Rv
PG> And Hey Presto! It works!
PG> So, is this a non-bug? PEBKAC? Should `make install` have installed the
PG> examples? Especially since `./configure` talks about them.
PG> Anyway, I got it working, I'm happy, on to gnujsp.
PG> -Philip
PG> --
PG> ----------------------------------------------------------
PG> To subscribe: [EMAIL PROTECTED]
PG> To unsubscribe: [EMAIL PROTECTED]
PG> Archives and Other: <http://java.apache.org/main/mail.html>
PG> Problems?: [EMAIL PROTECTED]
--
Best regards,
Ivan mailto:[EMAIL PROTECTED]
--
----------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]