MoSKito:“......中定义的建议尚未应用”

时间:2015-06-01 10:33:06

标签: java aspectj

我正在尝试使用moSKito监控工具来关注此step-by-step guide。我在pom.xml文件中添加了这些字符串:

<dependency>
   <groupId>net.anotheria</groupId>
   <artifactId>moskito-core</artifactId>
   <version>2.5.5</version>
</dependency>
<dependency>
    <groupId>net.anotheria</groupId>
    <artifactId>moskito-aop</artifactId>
    <version>2.5.5</version>
</dependency>

...

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.5</version>
    <configuration>
         <aspectLibraries>
             <aspectLibrary>
                 <groupId>net.anotheria</groupId>
                 <artifactId>moskito-aop</artifactId>
             </aspectLibrary>
         </aspectLibraries>
         <source>1.7</source>
         <target>1.7</target>
    </configuration>
    <executions>
         <execution>
              <goals>
                 <goal>compile</goal>
              </goals>
          </execution>
     </executions> 
</plugin>

我还添加了Monitor注释来从我的控制器收集统计信息:

@Monitor
@RestController
@RequestMapping(...)
public class MyController { ... }

当我试图将我的战争部署到tomcat时,我收到了警告:

  

警告:ajc:net.anotheria.moskito.aop.aspect.MonitoringAspect中定义的建议尚未应用[Xlint:adviceDidNotMatch]

     

警告:ajc:在中定义的建议   net.anotheria.moskito.aop.aspect.CounterAspect尚未应用   [Xlint:adviceDidNotMatch]

请描述出现这些警告的原因以及如何使它们消失。

提前致谢!

1 个答案:

答案 0 :(得分:1)

MonitoringAspect包含多个注释,特别是它包含@Monitor和@DontMonitor。 只要您不使用所有包含的注释,插件就会发出警告(无论是否有意义,是另一个问题)。 柜台也一样。

但更重要的问题是:监控中出现的类是什么?请记住,您必须至少访问一次,才能在MoSKito Inspect中查看它们。

问候 利昂

相关问题