Re: Can not view logs

247 views
Skip to first unread message

Mark

unread,
Aug 31, 2012, 11:12:47 AM8/31/12
to psi-prob...@googlegroups.com
That stack trace is unreadable.  Be a pal and get some linebreaks in there?

On Friday, August 31, 2012 7:16:24 AM UTC-4, Petr Gladkikh wrote:
Probe started to show exception when I select "Logs" tab. It worked an hour ago but broke just yet. Application reload does not fix this.

PSI Probe Version 2.3.2 (installed today as WAR)
Stack trace:
java.lang.NoClassDefFoundError: org/apache/tools/ant/Project at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.privateGetPublicMethods(Class.java:2547) at java.lang.Class.getMethods(Class.java:1410) at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1284) at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1158) at java.beans.Introspector.getBeanInfo(Introspector.java:408) at java.beans.Introspector.getBeanInfo(Introspector.java:167) at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896) at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926) at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801) at org.apache.commons.beanutils.PropertyUtilsBean.isReadable(PropertyUtilsBean.java:1182) at org.apache.commons.beanutils.PropertyUtils.isReadable(PropertyUtils.java:440) at com.googlecode.psiprobe.tools.logging.DefaultAccessor.getProperty(DefaultAccessor.java:47) at com.googlecode.psiprobe.tools.logging.log4j.Log4JAppenderAccessor.getFile(Log4JAppenderAccessor.java:57) at com.googlecode.psiprobe.beans.LogResolverBean$LogDestinationComparator.compare(LogResolverBean.java:413) at java.util.Arrays.mergeSort(Arrays.java:1270) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.mergeSort(Arrays.java:1282) at java.util.Arrays.sort(Arrays.java:1210) at java.util.Collections.sort(Collections.java:159) at com.googlecode.psiprobe.beans.LogResolverBean.getLogDestinations(LogResolverBean.java:77) at com.googlecode.psiprobe.controllers.logs.ListLogsController.handleRequestInternal(ListLogsController.java:45) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at com.googlecode.psiprobe.ProbeServlet.doDispatch(ProbeServlet.java:54) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Project at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) ... 51 more

Petr Gladkikh

unread,
Sep 4, 2012, 8:08:23 AM9/4/12
to psi-prob...@googlegroups.com
пятница, 31 августа 2012 г., 22:12:47 UTC+7 пользователь Mark написал:
That stack trace is unreadable.  Be a pal and get some linebreaks in there?

On Friday, August 31, 2012 7:16:24 AM UTC-4, Petr Gladkikh wrote:
Probe started to show exception when I select "Logs" tab. It worked an hour ago but broke just yet. Application reload does not fix this.

PSI Probe Version 2.3.2 (installed today as WAR)
Stack trace:
This was exact copy-paste from error page. Stack trace there did not contain line breaks in the first place.

Each time I refresh http://host/probe/logs/index.htm following two messages (and nothing more) appear in probe.log:

04 Sep 2012 19:02:35 [http-8080-6] WARN  org.springframework.web.servlet.PageNotFound  - No mapping found for HTTP request with URI [/probe/logs/css/classic/main.css] in DispatcherServlet with name 'probe'

04 Sep 2012 19:02:35 [http-8080-2] WARN  org.springframework.web.servlet.PageNotFound  - No mapping found for HTTP request with URI [/probe/logs/css/classic/messages.css] in DispatcherServlet with name 'probe'
 

Petr Gladkikh

unread,
Sep 4, 2012, 8:22:09 AM9/4/12
to psi-prob...@googlegroups.com
вторник, 4 сентября 2012 г., 19:08:23 UTC+7 пользователь Petr Gladkikh написал:
Html page source did contain line breaks. I put stack trace into attachment to preserve line breaks.
 
probe-error-stacktrace.log

Mark

unread,
Sep 4, 2012, 12:23:01 PM9/4/12
to psi-prob...@googlegroups.com
The warning is not related to the exception.  Let's deal with that separately.

How many applications do you have deployed?  Try undeploying all of them.  Then deploy one at a time and check after each deployment whether the Logs tab works.  That should help you narrow it down to which app is causing this.  Then we can begin to look into the specifics of that app, like what version of log4j it has.

Petr Gladkikh

unread,
Sep 8, 2012, 12:06:20 PM9/8/12
to psi-prob...@googlegroups.com
I can reproduce it only when our application is deployed.
We use gradle to build it and dependency declaraions are following (so you can estimate our complete runtime classpath):

configurations {
    all*.exclude group: "commons-logging", module: "commons-logging"
}

dependencies {
    compile(
            'com.google.guava:guava:13.0',
            'commons-io:commons-io:2.4',

            'org.slf4j:slf4j-api:1.6.6',
            'org.slf4j:jcl-over-slf4j:1.6.6',

            'org.springframework:spring-context:3.1.2.RELEASE',
            'org.springframework:spring-web:3.1.2.RELEASE',
            'org.springframework:spring-webmvc:3.1.2.RELEASE',
            'org.springframework.security:spring-security-core:3.1.1.RELEASE',
            'org.springframework.security:spring-security-config:3.1.1.RELEASE',
            'org.springframework.security:spring-security-web:3.1.1.RELEASE',

            'commons-fileupload:commons-fileupload:1.2.2',
            'org.apache.httpcomponents:httpclient:4.2.1',

            'org.hibernate:hibernate-core:4.1.5.SP1',
            'org.springframework:spring-aop:3.1.2.RELEASE',
            'org.hibernate:hibernate-ehcache:4.1.5.SP1',
            'org.springframework:spring-orm:3.1.2.RELEASE',
            'commons-codec:commons-codec:1.6',

            'com.googlecode.json-simple:json-simple:1.1.1',
            'javax.servlet:servlet-api:2.5'
    )

    runtime(
            'ch.qos.logback:logback-classic:1.0.6', // slf4j implementation

            'org.springframework:spring-web:3.1.2.RELEASE',
            'org.apache.velocity:velocity-tools:2.0',

            'com.googlecode.flyway:flyway-ant:1.7',
            'com.mchange:c3p0:0.9.2-pre4',
            'postgresql:postgresql:9.1-901.jdbc4',

            'cglib:cglib-nodep:2.2.2',
            'org.aspectj:aspectjweaver:1.7.0',
            'org.aspectj:aspectjrt:1.7.0',

            'org.codehaus.jackson:jackson-core-asl:1.9.8',
            'org.codehaus.jackson:jackson-mapper-asl:1.9.8'
    )

    providedRuntime( 
            'javax.servlet.jsp:javax.servlet.jsp-api:2.2.1'
    )

Mark

unread,
Sep 8, 2012, 1:41:51 PM9/8/12
to psi-prob...@googlegroups.com
There is something strange going on.  PSI Probe is trying to resolve a log4j log, but I don't see any dependencies related to log4j.  If your app is using slf4j and jcl, maybe your Tomcat is configured to use log4j.  Can you share more about your logging configuration for your app and for your server?

Petr Gladkikh

unread,
Sep 25, 2012, 4:30:56 AM9/25/12
to psi-prob...@googlegroups.com
The problem was in flyway module that indirectly depends on log4j:

+--- com.googlecode.flyway:flyway-ant:1.7 [default]
| +--- org.slf4j:jcl-over-slf4j:1.6.6 [compile,runtime,master] (*)
| +--- com.googlecode.flyway:flyway-core:1.7 [compile,master,runtime]
| +--- org.slf4j:slf4j-log4j12:1.6.6 [compile,master,runtime]
| | +--- org.slf4j:slf4j-api:1.6.6 [compile,master,runtime] (*)
| | \--- log4j:log4j:1.2.17 [compile,master,runtime]
| \--- log4j:log4j:1.2.17 [compile,master,runtime] (*)

I added exclusion on classes related to log4j so everything uses slf4j
and logger provided by runtime classpath (Logback):

configurations {
compile.exclude group: "log4j", module: "log4j"
compile.exclude group: "org.slf4j", module: "slf4j-log4j12"
}

Logs viewer now works. I am not sure if one can prevent such problem
in future but IMO applications' classpaths should not interfere with
Probe (and each other).
> --
> You received this message because you are subscribed to the
> "psi-probe-discuss" Google Group.
>
> To post to this group, send email to:
> psi-prob...@googlegroups.com
>
> To unsubscribe from this group, send email to:
> psi-probe-disc...@googlegroups.com
>
> For more options, visit this group at:
> http://groups.google.com/group/psi-probe-discuss?hl=en

--
Petr Gladkikh

Mark

unread,
Sep 25, 2012, 10:03:50 AM9/25/12
to psi-prob...@googlegroups.com
If flyway is something you've enabled at the server level, it's bound to affect all apps, including Probe, due to the classloader inheritance that Tomcat uses.  If it's within an app, then I agree: it shouldn't affect other applications or Probe.  More than likely you would've gotten other errors because of log4j's absence, but I will see if I can find a way to make Probe more robust so it doesn't give these sorts of errors.

Mark

unread,
Sep 25, 2012, 10:22:07 AM9/25/12
to psi-prob...@googlegroups.com
I've filed issue 319 to hopefully address this issue.
Reply all
Reply to author
Forward
0 new messages