Announcement Announcement Module
Collapse
No announcement yet.
<context:load-time-weaver> for Glassfish? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <context:load-time-weaver> for Glassfish?

    Does the <context:load-time-weaver> statment work with Glassfish, or do I need to use the -javaagent:aspectjweaver.jar?

    I'm using Spring 2.5.1.

  • #2
    I'm also looking at the library files that came with the spring distribution, and I see there's a glassfish-clapi.jar. Does anyone know what that's for?

    Comment


    • #3
      GlassFish and load-time aspectjweaver

      Ive added -javaagent:"$anypath/aspectjweaver.jar" to glassfish using glashfish webadmin and when I start it I got the following Exception:

      java.lang.ClassNotFoundException:
      com.sun.enterprise.server.logging.ServerLogManager


      Does anyone can help me?

      Comment


      • #4
        So I have read spring documentation, it said for a galssfish server using web application enviroment(not ear) we need to follow the same steps as in tomcat in order to run load time weaver. So I have followed its steps:

        setting the following line in my applicationContext.xml

        <context:load-time-weaver weaver-class="org.springframework.instrument.classloading .ReflectiveLoadTimeWeaver"/>


        ReflectiveLoadTimeWeaver - Fallback, expecting the underlying ClassLoader to follow common conventions (e.g. applicable to TomcatInstrumentableClassLoader and to Resin)

        For web applications deployed onto Apache Tomcat 5.0 and above, Spring provides a TomcatInstrumentableClassLoader to be registered as the web app class loader. The required Tomcat setup looks as follows, to be included either in Tomcat's central server.xml file or in an application-specific META-INF/context.xml file within the WAR root. Spring's spring-tomcat-weaver.jar needs to be included in Tomcat's common lib directory in order to make this setup work.


        then I added Loader to my myApp/META-INF/context.xml
        <Context path="/myApp" >
        <Loader loaderClass="org.springframework.instrument.classl oading.tomcat.TomcatInstrumentableClassLoader"
        useSystemClassLoaderAsParent="false"/>
        </Context>

        also I added spring-tomcat-weaver.jar to $GLASSFISH_HOME/lib directory

        when i try to start the server with myApp server crashes when it try to instantiate FacesContext

        Also I tryed to use <Loader loaderClass="com.sun.enterprise.loader.Instrumenta bleClassLoader"
        useSystemClassLoaderAsParent="false"/>
        that is in glassfish-clapi.jar instead of TomcatInstrumentableClassLoader but it crashess also.

        So I wonder if anyone has started load-time-weaver with glassfish v2 in a web application successfully.

        Comment


        • #5
          War Load time weaving glassfish

          I also wonder if Load Time Weaving on Glassfish works with War's... I have also tried all these combos.. I've even added -javaagent:... to the JVM opts of glassfish... no go... Has anyone actually gotten this to work?

          Comment

          Working...
          X