1 Reply Latest reply on May 26, 2003 10:56 AM by Jeroen Jansen

    IllegalAccessException (Velocity)

    Jeroen Jansen Newbie

      Hi,

      Im using JBoss 3.0.3 (Jetty) and I am trying to use
      Velocity 1.3.1 (velocity1.3.1-nodep.jar).
      I am invoking velocity functionality from struts action objects in various WAR's. I placed the velocity lib in each WAR''s lib folder (I have multiple WAR's, using same copy's of the velocity jar).

      I am loading the VelocityEngine into each WAR using a customized ActionServlet. Im not using the singleton approach, each WAR has a seperate instance of Velocity.

      Now, when struts tries to instantiate the action object containing velocity statements it fails to do so. See the attached exception stack trace.
      JBoss throws somehow the rather vague (to me that is) java.lang.IllegalAccessError that stumps me.

      I know it has something to do with classloading and shit, but I havent been able (yet) to figure out how the beast exactly works.

      Some pointers on this matter would be great, cuz my head is spinning.

      Regards,
      Jeroen Jansen

        • 1. Re: IllegalAccessException (Velocity)
          Jeroen Jansen Newbie

          fixed the problem.

          My directory structure was not good, which caused the classloader to be confused about where to look for what package.

          I ended up with having one central folder, called "lib" in the deploy dir, where share libs like struts and velocity are put into.

          You used a manifest file in my WARs for this kind of shared lib behaviour:

          Class-Path: lib\struts.jar lib\velocity-dep-1.3.1.jar lib\jakarta-regexp-1.2.jar checkout.war\WEB-INF\classes


          Regards,
          Jeroen