Link to home
Start Free TrialLog in
Avatar of GAUTAM
GAUTAMFlag for United States of America

asked on

Issue with Javamelody with tomcat

I have setup Javamelody in my Tomcat container to view the statistics of my currently used website.

My website is configured in server.xml as follows and is not deployed as war but the classes and the jsp files are manually copied to "/dun/student/webapps" location as shown in the mapping:

<Context path="/stud" docBase="/dun/student/webapps" crossContext="false" debug="0" reloadable="true">
        </Context>

Open in new window


I have copied the jar files javamelody.jar and jrobin-1.5.9.1.jar in the lib directory of my web-app.

Now I have modified the web.xml of my web-app to have the following lines and I have pasted it above my servlet declarations.

<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>

Open in new window


I have restarted tomcat as well.

Now I'm trying to access my java melody statistics using the url:

http://student.studentgrade.com:8080/stud/monitoring

Open in new window

But I'm getting a 404 status saying requested resource is not available.

Now my web app which has many jsp files which were working fine too cannot be accessed and there too I'm getting a 404 error.

http://student.studentgrade.com:8080/stud/hello.jsp

Open in new window

But if I remove those lines which I added for javamelody in the web.xml file my jsp can be accessed.

What am I doing wrong here.

Please advice how I can fix this.
Avatar of mccarl
mccarl
Flag of Australia image

Is there any errors reported in any of the tomcat log files?

Can you post the full web.xml with the Java Melody configuration in place?
Avatar of GAUTAM

ASKER

Thanks for the reply.

I have attached my web.xml

I don't see any errors in my tomcat logs.

As soon as I make changes in my web.xml my jsp pages which were accessible earlier will not work too.
web.xml
Why do you need to specify a listener class for javamelody ? Can you remove the listener part and check.
Avatar of GAUTAM

ASKER

@all: Thanks for the replies.

I noticed one error in the catalina.out file.

Jul 16, 2013 7:40:34 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Jul 16, 2013 7:40:34 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/stud] startup failed due to previous errors
Jul 16, 2013 7:40:36 AM org.apache.coyote.http11.Http11BaseProtocol start

Open in new window


And in today's tomcat log I found this
Jul 16, 2013 7:50:12 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter monitoring
java.lang.NoClassDefFoundError: org.slf4j.ILoggerFactory
	at java.lang.J9VMInternals.verifyImpl(Native Method)
	at java.lang.J9VMInternals.verify(J9VMInternals.java:68)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:129)
	at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:109)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Jul 16, 2013 7:50:13 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
Jul 16, 2013 7:50:14 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jul 16, 2013 7:50:14 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()

Open in new window


Why are these errors showing up for the Filters for Javamelody
What is this error and how can I fix this?
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GAUTAM

ASKER

@mccarl: Thanks for the reply.

Added thhe slf4j-api-1.5.11.jar seems to be working now. Still testing.
Will get back If I face any issues.
Not a problem, thanks for accepting!