Menu

#66 Configuration object causes NPE when servlet reloads

cewolf-0.10
open
nobody
5
2013-01-13
2005-03-07
Eric Sword
No

I believe the NullPointerExceptions that people are
complaining about happen when the servlet is reloaded
but the Configuration object is not re-inited. I see
this in JBoss 3.2.3 if I tweak my web app or an
associated mbean service. Since the cewolf.jar file is
in another service that is not auto-reloaded, the
static Configuration field configExists is not cleared
and a null config is set into the new ServletContext.

I think a safer approach is to not depend on that
configExists field at all, but to always verify that a
config exists in the servlet context in
Configuration.getInstance and create one if not.

I have attached a zip file with new CewolfRenderer.java
and Configuration.java that does this and fixes the
problems I was seeing. Hope they are useful.

e

Discussion

  • Eric Sword

    Eric Sword - 2005-03-07

    New java files to fix init problem.

     
  • Zoltan Luspai

    Zoltan Luspai - 2005-03-10

    Logged In: YES
    user_id=240232

    Thanks for the fix; I've incorporated them; will appear in
    next version.
    Regards,
    Zoltan

     

Log in to post a comment.