#123 FM 2.3.6: NPE when using BeansWrapper with reloaded classes

closed-fixed
None
5
2006-05-04
2006-04-12
No

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?
thanks!
russ

Discussion

  • Russ Trotter

    Russ Trotter - 2006-04-12

    Test case Netbeans project

     
  • Attila Szegedi

    Attila Szegedi - 2006-04-19

    Logged In: YES
    user_id=52489

    It's fixed in SVN now. Can you please confirm that it works
    for you?

     
  • Attila Szegedi

    Attila Szegedi - 2006-04-19
    • assigned_to: nobody --> szegedia
    • status: open --> pending-fixed
     
  • Dániel Dékány

    Logged In: YES
    user_id=546667

    Do NOT use the SVN trunk! That contains an instable
    developement version of FM 2.4 or 3.0, not 2.3.x.

    Instead, please test this prebuilt fixed version (contains
    several other bugfixes as well), which is a 2.3.7 predecessor:
    http://freemarker.sourceforge.net/hotfix/freemarker.jar

     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks