[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
Re: ghost classes
That makes sense. What's been the big problem here is that we don't
normally receive ClassCaseExceptions. We usually end up with an object
loaded from the ghost class that has never been created . . . just an
empty object.
anyway, our workaround is to stop apache, recompile ALL our classes,
delete the ghost classes and start the webserver.
thanks again!
eric
> > I hope I'm not being vague, but this situation is really hard to explain
> > as we have no idea why it's happening.
> >
> > Any thoughts on why ghost classes would be created under the compiled JSP
> > directory tree?
>
> The java compiler is called with a command line like
> javac -classpath ...:/tmp/jsp -d /tmp/jsp file.java
> where ... is your system classpath and file.java is the java file to
> compile. When javac encounters java files that are newer than the
> corresponding class files, javac will compile those. It will place the
> new class files below /tmp/jsp because of the -d flag.
>
> This can mess things up because the JSP class loader will load the class
> files below /tmp/jsp while the servlet classloader will load the class
> files from /var/lib/classes, causing ClassCastException. My plan is to
> modify the JSP class loader to only load classes whose name starts with
> "_jsp", and to call the servlet class loader (or the system class
> loader) for other classes.
>
> This will not prevent the ghost classes from appearing, but will prevent
> them from being loaded. If you do not want them to appear, the -d flag
> should be removed, but that means that compiling a JSP page could cause
> class files somewhere else on the disk to be changed. In any case, the
> javac command line will be configurable in the next version of GNUJSP,
> allowing you to decide for yourself.
>
> Regards, Vincent.
>