Posted: Thu Jan 29, 2015 6:37 am Post subject: Unable to run my client code
Newbie
Joined: 21 Jan 2015 Posts: 4
Hi everybody,
I want to integrate an MQTT client (Paho for example) in my JBoss application. I get a broker running on a server and an android device taht send messages. Now i want to send/receive message form my java app under JBoss.
I've tried to put Paho code in a @startup bean but i get an IllegalState.
Now i'm reading a lot of documentation about MQTT but i can't find a way to integrate a MQTT Client in my AS.
Can you please help me resolve why my code is not running?
Errors found is
Caused by: java.lang.NoClassDefFoundError: org.eclipse.paho.client.mqttv3.MqttCallback
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:275)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:540)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
at java.net.URLClassLoader.access$300(URLClassLoader.java:79)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1034)
Caused by: java.lang.ClassNotFoundException: org.eclipse.paho.client.mqttv3.MqttCallback
at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:76)
at java.net.URLClassLoader.findClass(URLClassLoader.java:396)
at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
... 29 more
Class loader issues usually mean that you did not put all of the necessary jar files in the right place, or that you didn't mark those jar flies as being needing to be loaded.
So it's not anything with your code. It's with the configuration of the app server or the deployed application. I don't know JBOSS, so I can't help.
However, an important question is - which piece are you expecting to actually send the MQTT message? The android applicatoin? Or the JBOSS application running on the server side?
If you want the android app to send the message, you should look at using the javascript websockets samples instead of the paho Java client.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum