hey folks, in a web application, i noticed an NPE in
BeanModel.java:180. Looking at the source, that line
throws NPE when there's no entry for a class in
BeanWrapper's class cache. In my application, i have
model classes loaded dynamically from an
java.net.URLClassLoader and freemarker seems to detect
this judging by it's log output, but it NPE's
nonetheless. I've paired it down to a relatively
simple test case and I've attached it to this post.
It's basically a .zip of the little Netbeans project
for the test case which includes the freemarker.jar
from the 2.3.6 release. Due to SF upload limit, you'll
have to put a "freemarker.jar" from 2.3.6 in the
dist/lib dir before compiling/running.
Just run the fmtest.Main (via "java -jar
dist/fmtest.jar") class in the same directory as the
fmtest.ftl and mymodel_v1.jar and mymodel_v2.jar.
In my initial analysis so far, it seems that the
BeansWrapper detects that a class is getting reloaded,
but then blows away it's entire class cache so that
subsequent lookups of other classes get null references.
I'll keep looking, but to whoever wrote the class
caching in BeansWrapper, any ideas?