关于javamelody配置后,工程出错问题

javamelody 的功能大家应该都知道,不知道的去google,在这不在多讲

配置也很简单

复制文件javamelody.jarjrobin-x.jar位于所提供的lib,下载javamelody.zip文件就包含这个包,放入web应用的的WEB-INF/lib目录中。


在项目的web.xml文件下添加

<filter> 
      <filter-name> monitoring </filter-name> 
                <filter-class> net.bull.javamelody.MonitoringFilter </filter-class> 
        </filter> 
        <filter-mapping> 
                <filter-name> monitoring </filter-name> 
                <url-pattern> /* </url-pattern> 
        </filter-mapping> 
        <listener> 
                <listener-class> net.bull.javamelody.SessionListener </listener-class> 
        </listener>
本人运行后monitoring 运行正常,但工程运行错误,
百度很久也没有相关问题,都是如何配置,
后仔细查看官方文档
文档如下:

Deployment on Tomcat without modification of monitored webapps (beta)

If there is one or several webapp(s) to monitor which are deployed on Tomcat 6, it is possible to monitor this or these webapp(s) without modification of this or these webapp(s), (except that it may not work well from javamelody v1.32 up to v1.35). That is to say without modification of the war file or of the directory of these webapps.

For this, copy the files  javamelody.jar and  jrobin-x.jar and optionally  itext-x.jar in the lib directory of Tomcat 6 (and not in the WEB-INF/lib directories of the webapps).
Then add the following lines in the web.xml file of the conf directory of Tomcat (and not in the WEB-INF/web.xml files of the webapps).

        <filter>
                <filter-name>monitoring</filter-name>
                <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
        </filter>
        <filter-mapping>
                <filter-name>monitoring</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
        <listener>
                <listener-class>net.bull.javamelody.SessionListener</listener-class>
        </listener>
In this conf/web.xml file of tomcat, some parameters can be added as written in the  user guide.

So and without modification of the webapps, all webapps deployed in this Tomcat instance are monitored (and it is then not possible to choose which, otherwise than with the url-exclude-pattern parameter described in the  user guide). This technique is specific to Tomcat 6 and does not apply to other JavaEE implementations.

The  ClassLoader in application servers is a complex subject. In consequence :

  • This feature is considered as beta for now
  • It works only in Tomcat 6 or 7 (Tomcat 5.5 is not supported)
  • Hot reployment is not supported when using this technique
  • It does not seem advisable to use the monitoring by Spring AOP in this case

注意红色的地方
本人用的就是tomcat 5.5 ,他的高版本是不支持tomcat 5.5的,后换成tomcat 6 工程和monitoring都运行正常

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值