4 Replies Latest reply on Mar 5, 2009 8:56 PM by stalep

    Log Messages Not Showing with Compile Time Weaving

      I have a few Interceptors that seem to work fine with load time weaving. I'd like to shift to compile time weaving using the maven plugin. I have the following defined in my pom.xml file. When I run my application I am not able to see the log statements generated by the interceptors. I can see that the compiled classes have be instrumented. Any help would be greatly appreciated!

      Thanks,

      John

      <build>
       <plugins>
       <plugin>
       <groupId>org.jboss.maven.plugins</groupId>
       <artifactId>maven-jbossaop-plugin</artifactId>
       <version>1.0.0.GA</version>
       <executions>
       <execution>
       <id>compile</id>
       <configuration>
       <verbose>true</verbose>
       <suppress>false</suppress>
       <includeProjectDependency>true</includeProjectDependency>
       <aoppaths>
       <aoppath>src/main/resources/jboss-aop.xml</aoppath>
       </aoppaths>
       <properties>
       <property>
       <name>jboss.aop.verbose</name>
       <value>true</value>
       </property>
       </properties>
       </configuration>
       <goals>
       <goal>compile</goal>
       </goals>
       </execution>
       </executions>
       </plugin>
       </plugins>
       </build>
      


        • 1. Re: Log Messages Not Showing with Compile Time Weaving
          kabirkhan

          Ståle is more familiar with maven plugin, but when running your application you also need to include the path to jboss-aop.xml. In ant/plain java this is done by using the -Djboss.aop.path property

          • 2. Re: Log Messages Not Showing with Compile Time Weaving

            Do you need the jboss-aop.xml in the classpath if you have done compile time weaving? I thought that was only necessary if you do load time weaving? In the maven plugin config above, I provide that path to the plugin. I can see that the code has been instrumented by looking at the class files.

            Any help would be greatly appreciated... If we don't figure the problem out soon we'll probably have to revert to aspectj as we've used it in the past successfully with maven plugins.

            Thanks,

            John

            • 3. Re: Log Messages Not Showing with Compile Time Weaving
              kabirkhan

               

              "john.pfeifer@billmelater.com" wrote:
              Do you need the jboss-aop.xml in the classpath if you have done compile time weaving?

              Yes at runtime you need
              -Djboss.aop.path=/path/to/jboss-aop.xml


              I thought that was only necessary if you do load time weaving

              http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4150875


              • 4. Re: Log Messages Not Showing with Compile Time Weaving
                stalep

                hi, please take a look at the pom.xml file in the method-execution example provided in the distro; jboss-aop-2.0.0.GA/docs/aspect-framework/examples/method-execution/pom.xml. there you'll see an example of a 2-step process where the classes are compile time woven, and then executed with the jboss-aop.xml referenced in the run step.

                <plugin>
                 <groupId>org.jboss.maven.plugins</groupId>
                 <artifactId>maven-jbossaop-plugin</artifactId>
                 <version>${jboss.aop.plugin.version}</version>
                 <executions>
                 <execution>
                 <id>compile</id>
                 <configuration>
                 <aoppaths>
                 <aoppath>jboss-aop.xml</aoppath>
                 </aoppaths>
                 </configuration>
                 <goals>
                 <goal>compile</goal>
                 </goals>
                 </execution>
                 <execution>
                 <id>run</id>
                 <configuration>
                 <aoppaths>
                 <aoppath>jboss-aop.xml</aoppath>
                 </aoppaths>
                 <executable>Driver</executable>
                 </configuration>
                 <goals>
                 <goal>run</goal>
                 </goals>
                 </execution>
                 </executions>
                 </plugin>