graylog-labs / graylog-plugin-jabber

Jabber Alarmcallback Plugin for Graylog
GNU General Public License v3.0
2 stars 4 forks source link

Could not initialize class org.graylog.plugins.jabber.shaded.smack.tcp.XMPPTCPConnectionConfiguration #11

Closed jhaar closed 6 years ago

jhaar commented 7 years ago

Hi there

We have a working prosody server (ie clients like pidgin work fine). I've configured the XMPP account/password options, but when I push the "test" button, I get the following error, and tcpdump shows no evidence of any packets being sent from the graylog server to the XMPP server

Could not send test alert notification Sending test alert notification failed with message: cannot POST https://our.server/api/alerts/callbacks/58b8c1a69cdbc27c699c20b6/test (500)

Using tcpdump, I captured the POST and unpacked the returned error page below - FYI this does not show up in /var/log/graylog-server/server.log - this kind of error should?

It's obviously some kind of java error. I have java-1.8.0-openjdk-headless on CentOS-7. Any ideas how I can fix this?

Thanks

java.lang.NoClassDefFoundError: Could not initialize class org.graylog.plugins.jabber.shaded.smack.tcp.XMPPTCPConnectionConfiguration

Stacktrace

org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.graylog.plugins.jabber.shaded.smack.tcp.XMPPTCPConnectionConfiguration
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer$ResponseWriter.rethrow(GrizzlyHttpContainer.java:324)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer$ResponseWriter.failure(GrizzlyHttpContainer.java:306)
    at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:509)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384)
    at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.graylog.plugins.jabber.shaded.smack.tcp.XMPPTCPConnectionConfiguration
    at org.graylog2.alarmcallbacks.jabber.JabberAlarmCallback.login(JabberAlarmCallback.java:60)
    at org.graylog2.alarmcallbacks.jabber.JabberAlarmCallback.call(JabberAlarmCallback.java:96)
    at org.graylog2.rest.resources.alarmcallbacks.AlarmCallbacksResource.test(AlarmCallbacksResource.java:150)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    ... 14 more            
joschi commented 7 years ago

@jhaar Which version of the plugin are you using?

The class seems to be included in the latest version of the plugin JAR:

$ unzip -l graylog-plugin-jabber-2.0.0.jar |grep XMPPTCPConnectionConfiguration.class
     2225  02-28-2017 14:06   org/graylog/plugins/jabber/shaded/smack/tcp/XMPPTCPConnectionConfiguration.class
jhaar commented 7 years ago

I have that version

unzip -l graylog-plugin-jabber-2.0.0.jar |grep XMPPTCPConnectionConfiguration.class

does show it exists - with the same timestamp

grignix commented 7 years ago

Good day,

Faced the same problem. After installing graylog-2.2.3-1.ova, I put graylog-plugin-jabber-2.0.0.jar in /opt/graylog/plugin/, Restarting the server and configure Jabber Alarm Callback, I press test and test ended with a error. After making a screen shot with an error, I wrote down the request and made a request through the Curl

curl -X POST -v -u admin:admin http://localhost:9000/api/alerts/callbacks/58f73c8343c69e034b72588a/test

Among the answers were an error org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.graylog.plugins.jabber.shaded.smack.tcp.XMPPTCPConnectionConfiguration

If you install the previous version of the plug-in graylog-plugin-jabber-1.2.1.jar then everything works fine

P.S. Client library XMPP Smack is already version 4.2.0 it may be time to update the version in the plug-in?

jhaar commented 7 years ago

Wow - you're right. I just replaced 2.0.0 with 1.2.1 and restarted graylog-server and XMPP started working