I plan to control my LED strips via HTTP. I've already tested with this code:
HttpResponse<String> response = Unirest.put("http://192.168.1.151:80/api/09107DA986/lights/1/state")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("{ \"on\": " + on + ",\r\n \"bri\": " + bri + ",\r\n \"hue\": " + hue + ",\r\n \"sat\": " + sat + ",\r\n \"transitiontime\": " + transitiontime + "\r\n}")
.asString();
but when I start it keeps getting this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.http.conn.ssl.AbstractVerifier.<init>(AbstractVerifier.java:61)
at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<init>(AllowAllHostnameVerifier.java:44)
at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<clinit>(AllowAllHostnameVerifier.java:46)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
at kong.unirest.apache.SecurityConfig.createDefaultRegistry(SecurityConfig.java:85)
at kong.unirest.apache.SecurityConfig.buildSocketFactory(SecurityConfig.java:75)
at kong.unirest.apache.SecurityConfig.createManager(SecurityConfig.java:59)
at kong.unirest.apache.ApacheClient.<init>(ApacheClient.java:53)
at kong.unirest.Config.buildClient(Config.java:648)
at kong.unirest.Config.getClient(Config.java:641)
at kong.unirest.BaseRequest.asString(BaseRequest.java:180)
at LED_Streifen.HttpRequestSetState(LED_Streifen.java:494)
at LED_Streifen.access$0(LED_Streifen.java:490)
at LED_Streifen$3.stateChanged(LED_Streifen.java:178)
at javax.swing.JSlider.fireStateChanged(Unknown Source)
at javax.swing.JSlider$ModelListener.stateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setValue(Unknown Source)
at javax.swing.JSlider.setValue(Unknown Source)
at LED_Streifen.<init>(LED_Streifen.java:435)
at LED_Streifen.main(LED_Streifen.java:57)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 22 more
I have already inserted various .jar files: