stagemonitor / stagemonitor-mailinglist

GitHub issues abused as a mailing list
3 stars 0 forks source link

Is it possible to monitor an Embedded Jersey app? #27

Open hank345 opened 8 years ago

hank345 commented 8 years ago

Hello,

I have recently been checking out stagemonitor and think it looks awesome, I want to use it! I'm currently building a Jersey REST app with an _embedded _Jetty container. Example code here: https://github.com/hank345/jersey-app-monitored

Is it possible to monitor this app in a good way with stagemonitor? Right now I'm using this approach (which works ok, but I can't really monitor response codes etc): https://github.com/stagemonitor/stagemonitor/wiki/Integrate-stagemonitor-into-non-servlet-based-applications

...and I'm a bit worried when I read this :) https://github.com/spring-projects/spring-boot/issues/321

So I guess the question is if I have to resort to building a deployable war file to be able to make full use of the monitoring? Or is there a work-around similar to what's used for Spring-boot?

Thanks.

felixbarny commented 8 years ago

Hi,

thank you for setting up the example application. That really helped me!

You can add this snippet to your startServer method (for example after server.setHandler(contextHandler):

contextHandler.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() {
    @Override
    public void lifeCycleStarting(LifeCycle event) {
        new WebPlugin().onStartup(null, contextHandler.getServletContext());
    }
});

Don't forget to remove the @MonitorRequests annotation then.

hank345 commented 8 years ago

Thanks for the quick reply Felix! I will try this out tomorrow and post back how it went.

felixbarny commented 8 years ago

Have you tried it out yet? Did it work? Note that catching the exception is not necessary anymore (as of 0.24.0). See my updated comment.

hank345 commented 8 years ago

Hi Felix,

Now I tried it out. First with version 0.22.0, and then with 0.24.0

Check out this commit (with 0.22.0): https://github.com/hank345/jersey-app-monitored/commit/174591fca1469a69252b464bff65073fa647afbc

I'm getting this error (I have not really had the time to analyse it yet):

/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -Dvisualvm.id=251910872441728 -Didea.launcher.port=7534 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 15 CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar:/Users/Henrik/dev/stagemonitor/stagemonitor-test/jersey-app-monitored/build/classes/main:/Users/Henrik/dev/stagemonitor/stagemonitor-test/jersey-app-monitored/build/resources/main:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.21/7238b064d1aba20da2ac03217d700d91e02460fa/slf4j-log4j12-1.7.21.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.21/2f22c882ffa479d1e9ff4eb0e8e2c29f2a0871ed/jul-to-slf4j-1.7.21.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-server/9.3.7.v20160115/59cf44c6d05c0179ccbb9ec06a46083bfb96bbf6/jetty-server-9.3.7.v20160115.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-servlet/9.3.7.v20160115/6213334a9b8b533f6af047bcd5b9fa2a7150720d/jetty-servlet-9.3.7.v20160115.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-http/9.3.7.v20160115/1ae96c106af283080f4eb468597788650fdc0597/jetty-http-9.3.7.v20160115.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.core/jersey-server/2.7/443dfe312adcbc4b88a87841021f358cf8d12676/jersey-server-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.containers/jersey-container-servlet-core/2.7/154b384e478ce7d57252a0f1622959ee15c47142/jersey-container-servlet-core-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.containers/jersey-container-jetty-http/2.7/ba16852f81b7e27796b302ee4335ef27e2fbb2e4/jersey-container-jetty-http-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.media/jersey-media-moxy/2.7/4f45a72fe3849d1b6c5df8b0c7b75f388ae359cf/jersey-media-moxy-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-web/0.22.0/22af3dc0696f01d6231de9520c9aa3c34b9eda22/stagemonitor-web-0.22.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.21/139535a69a4239db087de9bab0bee568bf8e0b70/slf4j-api-1.7.21.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.17/5af35056b4d257e4b64b9e8069c0746e8b08629f/log4j-1.2.17.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/javax.servlet/javax.servlet-api/3.1.0/3cd63d075497751784b2fa84be59432f4905bf7c/javax.servlet-api-3.1.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-io/9.3.7.v20160115/a37a88dda790f595f002102d746b5371a1c80150/jetty-io-9.3.7.v20160115.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-security/9.3.7.v20160115/2ab9d3ecf02ba8ca918a047e090a0cad351588a6/jetty-security-9.3.7.v20160115.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-util/9.3.7.v20160115/d97b3d3676d69df5e635c5576dc3c46e17294898/jetty-util-9.3.7.v20160115.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.core/jersey-common/2.7/4f6bdf547f1a7f4f140cbfac42379ad898f36216/jersey-common-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.core/jersey-client/2.7/fb973800c0329e5fd51b1b3ea8d5dd8835ec191d/jersey-client-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/javax.ws.rs/javax.ws.rs-api/2.0/61f0983eb190954ccdede31e786a9e0bd9767c4a/javax.ws.rs-api-2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.2/479c1e06db31c432330183f5cae684163f186146/javax.annotation-api-1.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-api/2.2.0/62948cc26572ee26a3f2343fdcb9f9025f278ce6/hk2-api-2.2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2.external/javax.inject/2.2.0/2a9e23e3d64a93ed7ba5515e6169f65f56965292/javax.inject-2.2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-locator/2.2.0/58242e53d1fde189e2957e7bd107fecd42fb875a/hk2-locator-2.2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.1.0.Final/8613ae82954779d518631e05daa73a6a954817d5/validation-api-1.1.0.Final.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-continuation/9.1.1.v20140108/5c93a8bdad9e33eacd07060dc725044daf28a2a2/jetty-continuation-9.1.1.v20140108.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-entity-filtering/2.7/7bb9a79898e9377798a66a0e7000e68d86d883a4/jersey-entity-filtering-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.persistence/org.eclipse.persistence.moxy/2.5.0/24e44cbb82855555cb71899f3056f493c9881489/org.eclipse.persistence.moxy-2.5.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.persistence/org.eclipse.persistence.antlr/2.5.0/9d40a7c98d60fc9f3772d29fc6e19f736a769ae6/org.eclipse.persistence.antlr-2.5.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-requestmonitor/0.22.0/2125e18ee42a51bce3a9c9aee607ea0969399310/stagemonitor-requestmonitor-0.22.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-jvm/0.22.0/a1ba9a6d61b38b1fe5d23f3d3dfe97ca42f43dbb/stagemonitor-jvm-0.22.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-jdbc/0.22.0/d2724222a86fbdd5bafcf109041d97da19e8046a/stagemonitor-jdbc-0.22.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-json/3.1.2/88d9e57e1ef6431109d4030c717cf5f927900fd9/metrics-json-3.1.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/net.sf.uadetector/uadetector-resources/2014.10/973d8ec015a740b20cd3cdbc593315c521cb0128/uadetector-resources-2014.10.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.bundles.repackaged/jersey-guava/2.7/1bb881955553e4fb22904e7ff66b59c6c03a13a9/jersey-guava-2.7.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/osgi-resource-locator/1.0.1/4ed2b2d4738aed5786cfa64cba5a332779c4c708/osgi-resource-locator-1.0.1.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2/hk2-utils/2.2.0/4a51122aaa338df59eecd06e3baa6d5de702046d/hk2-utils-2.2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.glassfish.hk2.external/aopalliance-repackaged/2.2.0/38e954f6c768b3f097b169ec6c937327c179a4a/aopalliance-repackaged-2.2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.18.1-GA/d9a09f7732226af26bf99f19e2cffe0ae219db5b/javassist-3.18.1-GA.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.persistence/org.eclipse.persistence.core/2.5.0/1d3a637adbf5340ff624851c546b5066924deeaa/org.eclipse.persistence.core-2.5.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-core/0.22.0/ec9fba887014561e030344d7edc7da809bc053f2/stagemonitor-core-0.22.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-jvm/3.1.2/ed364e77218e50fdcdebce4d982cb4d1f4a8c187/metrics-jvm-3.1.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/p6spy/p6spy/2.2.0/55192e8ae783c1bf36646199320f45eb08a53937/p6spy-2.2.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-core/3.1.2/224f03afd2521c6c94632f566beb1bb5ee32cf07/metrics-core-3.1.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/net.sf.uadetector/uadetector-core/0.9.22/e40e4e391e27fdb798a574a3ee0c26debe36c6cd/uadetector-core-0.9.22.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.eclipse.persistence/org.eclipse.persistence.asm/2.5.0/de6b65fef5c3beca35586456cb9ed7d090a7536d/org.eclipse.persistence.asm-2.5.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-javaagent/0.22.0/56fcb68865296b2816e4e282ac29deafc2652bd4/stagemonitor-javaagent-0.22.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-graphite/3.1.2/15a68399652c6123fe6e4c82ac4f0749e2eb6583/metrics-graphite-3.1.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-annotation/3.1.2/7ee8e9afe8e15f921a3bc9f8d4b1109b58b63d46/metrics-annotation-3.1.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-afterburner/2.7.2/e301bb9a9de05ccbc81d8b5a850f619ed365fa08/jackson-module-afterburner-2.7.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/cglib/cglib-nodep/2.2.2/d456bb230c70c0b95c76fb28e429d42f275941/cglib-nodep-2.2.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/net.sf.qualitycheck/quality-check/1.3/5387135c674a783fd2dec7f05b6c17a7f6517c8b/quality-check-1.3.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/2.0.3/5871fb60dc68d67da54a663c3fd636a10a532948/jsr305-2.0.3.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/javax.annotation/jsr250-api/1.0/5025422767732a1ab45d93abfea846513d742dcf/jsr250-api-1.0.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.7.2/8b8310381b690e317f5f0574e9b2dd7034778b4c/jackson-core-2.7.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.7.2/84ffa765dd258dbab8695963c41308b054f3a1cb/jackson-databind-2.7.2.jar:/Users/Henrik/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.7.0/19f42c154ffc689f40a77613bc32caeb17d744e3/jackson-annotations-2.7.0.jar:/Applications/IntelliJ IDEA 15 CE.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain se.henriks.webapp.Main
2016-05-03 11:41:52 INFO  org.eclipse.jetty.util.log:186 - Logging initialized @743ms
2016-05-03 11:41:52 INFO  org.eclipse.jetty.server.Server:345 - jetty-9.3.7.v20160115
May 03, 2016 11:41:53 AM org.stagemonitor.core.instrument.AgentLoader loadAgent
INFO: Trying to load agent @ /Users/Henrik/.gradle/caches/modules-2/files-2.1/org.stagemonitor/stagemonitor-javaagent/0.22.0/56fcb68865296b2816e4e282ac29deafc2652bd4/stagemonitor-javaagent-0.22.0.jar
objc[13782]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering SpringMvcRequestNameDeterminerInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering ProfilingInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering MonitorRequestsInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering ElasticsearchSearchQueryInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering RemoteEjbMonitorInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering ConnectionMonitoringInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering ExceptionMeteredInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering MeteredInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering TimedInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:57 - Registering GaugeInstrumenter
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:107 - Retransforming 2 classes...
2016-05-03 11:41:53 INFO  org.stagemonitor.core.instrument.MainStagemonitorClassFileTransformer:110 - Retransformed 2 classes in 517 ms
2016-05-03 11:41:53 INFO  org.stagemonitor.core.Stagemonitor:91 - Measurement Session is initialized: [application=Jersey REST API Webapp] [instance=localhost] [host=Henriks-MacBook-Pro.local]
2016-05-03 11:41:53 INFO  org.stagemonitor.core.Stagemonitor:135 - Initializing plugin WebPlugin
2016-05-03 11:41:53 INFO  org.stagemonitor.web.configuration.ConfigurationServlet:28 - Registering configuration Endpoint /stagemonitor/configuration. You can dynamically change the configuration by issuing a POST request to /stagemonitor/configuration?key=stagemonitor.config.key&value=configValue&stagemonitor.password=password. If the password is not set, dynamically changing the configuration is not available. The password can be omitted if set to an empty string.
Exception in thread "main" java.lang.IllegalArgumentException: Inappropriate listener class org.stagemonitor.web.session.SessionCounter
    at org.eclipse.jetty.server.handler.ContextHandler$Context.checkListener(ContextHandler.java:2366)
    at org.eclipse.jetty.server.handler.ContextHandler$Context.addListener(ContextHandler.java:2316)
    at org.eclipse.jetty.servlet.ServletContextHandler$Context.addListener(ServletContextHandler.java:1432)
    at org.eclipse.jetty.server.handler.ContextHandler$Context.addListener(ContextHandler.java:2331)
    at org.eclipse.jetty.servlet.ServletContextHandler$Context.addListener(ServletContextHandler.java:1445)
    at org.stagemonitor.web.WebPlugin.onStartup(WebPlugin.java:399)
    at se.henriks.webapp.Main$1.lifeCycleStarting(Main.java:38)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarting(AbstractLifeCycle.java:188)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:67)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:405)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:372)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at se.henriks.webapp.Main.startServer(Main.java:56)
    at se.henriks.webapp.Main.main(Main.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
2016-05-03 11:41:54 INFO  org.stagemonitor.core.Stagemonitor:135 - Initializing plugin RequestMonitorPlugin
2016-05-03 11:41:54 INFO  org.eclipse.jetty.server.ServerConnector:270 - Started ServerConnector@3cd3e762{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2016-05-03 11:41:54 INFO  org.stagemonitor.core.Stagemonitor:135 - Initializing plugin JvmPlugin
2016-05-03 11:41:54 INFO  org.stagemonitor.core.elasticsearch.ElasticsearchClient:274 - Deleting indices: http://localhost:9200/stagemonitor-requests-*,-stagemonitor-requests-2016.05.*,-stagemonitor-requests-2016.04.30,-stagemonitor-requests-2016.04.29,-stagemonitor-requests-2016.04.28,-stagemonitor-requests-2016.04.27,-stagemonitor-requests-2016.04.26?timeout=20m&ignore_unavailable=true
2016-05-03 11:41:54 INFO  org.stagemonitor.core.elasticsearch.ElasticsearchClient:278 - Deleting indices: Done http://localhost:9200/stagemonitor-requests-*,-stagemonitor-requests-2016.05.*,-stagemonitor-requests-2016.04.30,-stagemonitor-requests-2016.04.29,-stagemonitor-requests-2016.04.28,-stagemonitor-requests-2016.04.27,-stagemonitor-requests-2016.04.26?timeout=20m&ignore_unavailable=true
2016-05-03 11:41:54 INFO  org.stagemonitor.core.Stagemonitor:135 - Initializing plugin JdbcPlugin
2016-05-03 11:41:54 INFO  org.stagemonitor.core.Stagemonitor:135 - Initializing plugin CorePlugin
2016-05-03 11:41:54 INFO  org.stagemonitor.core.CorePlugin:484 - Not sending metrics to InfluxDB (url=null, interval=60s)
2016-05-03 11:41:54 INFO  org.stagemonitor.core.CorePlugin:492 - Sending metrics to Elasticsearch ([http://localhost:9200]) every 60s
2016-05-03 11:41:54 WARN  org.stagemonitor.core.util.HttpClient$ErrorLoggingResponseHandler:154 - http://localhost:9200/stagemonitor: 400 {"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"already exists","index":"stagemonitor"}],"type":"index_already_exists_exception","reason":"already exists","index":"stagemonitor"},"status":400}

If I move to 0.24.0 I get this error:

2016-05-03 11:51:31 ERROR org.stagemonitor.core.Stagemonitor:41 - org/springframework/web/servlet/HandlerExecutionChain
java.lang.NoClassDefFoundError: `org/springframework/web/servlet/HandlerExecutionChain
hank345 commented 8 years ago

Seems like Jetty expects SessionCounter to be of any of these types:

hank345 commented 8 years ago

Seems like it works if I remove this row from WebPlugin: ctx.addListener(SessionCounter.class);

...except counting sessions I guess :)

felixbarny commented 8 years ago

I screwed up the SpringMvcRequestNameDeterminerTransformer. Fixed in in master: https://github.com/stagemonitor/stagemonitor/commit/ba263bcebe3ad2992dab76f07acdd1fdee158a8b Thx for reporting! Will release 0.25.0 now.

felixbarny commented 8 years ago

0.25.0 is now available via maven central: http://repo1.maven.org/maven2/org/stagemonitor/stagemonitor-web/0.25.0/