cryxy / my-owntracks-recorder

Store and access data published by OwnTracks apps within InfluxDB
GNU General Public License v3.0
11 stars 1 forks source link

can´t connect to mqtt #2

Closed wuast94 closed 4 years ago

wuast94 commented 4 years ago

whatever i enter in config i get alwasy an error about wrong uri: mqtt://ip:port ws://ip:port https://ip:port ssl://sub.domain.tld:443/ws and so on ...

the only uri that don´t throw this error is not working uri: ssl://sub.domain.tld:443

INFO: Startup, read config from: /start/config/config.properties
WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by org.eclipse.paho.client.mqttv3.internal.FileLock (file:/start/libs/org.eclipse.paho.client.mqttv3-1.2.0.jar) to method sun.nio.ch.FileLockImpl.release()

WARNING: Please consider reporting this to the maintainers of org.eclipse.paho.client.mqttv3.internal.FileLock

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

Apr 23, 2020 8:16:40 PM de.cryxy.owntracks.recorder.mqtt.OwntracksMqttClient connect
INFO: Connect to mqtt server ... ssl://sub.domain.tld:443
Apr 23, 2020 8:16:40 PM de.cryxy.owntracks.recorder.mqtt.OwntracksMqttClient onContainerInitializedEvent
WARNING: Error connection to MQTT Broker.

this is the error when i try something other:

INFO: Startup, read config from: /start/config/config.properties
Exception in thread "main" java.lang.IllegalArgumentException: http://192.168.178.26:9001 <- no matter what of the example above i enter .. always the same ... 
at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:552)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:463)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:328)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:323)
at org.eclipse.paho.client.mqttv3.MqttClient.<init>(MqttClient.java:229)
at org.eclipse.paho.client.mqttv3.MqttClient.<init>(MqttClient.java:140)
at de.cryxy.owntracks.recorder.mqtt.OwntracksMqttClient.connect(OwntracksMqttClient.java:50)
at de.cryxy.owntracks.recorder.mqtt.OwntracksMqttClient.connect(OwntracksMqttClient.java:45)
at de.cryxy.owntracks.recorder.mqtt.OwntracksMqttClient.onContainerInitializedEvent(OwntracksMqttClient.java:102)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85)
at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:177)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:159)
at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:632)
at org.jboss.weld.environment.se.WeldContainer.fireContainerInitializedEvent(WeldContainer.java:236)
at org.jboss.weld.environment.se.WeldContainer.endInitialization(WeldContainer.java:188)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:803)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:176)
at org.glassfish.jersey.inject.cdi.se.CdiSeInjectionManager.completeRegistration(CdiSeInjectionManager.java:253)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:370)
at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:256)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:315)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:282)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:269)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.<init>(GrizzlyHttpContainer.java:334)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:138)
at de.cryxy.owntracks.recorder.Application.main(Application.java:44)
cryxy commented 4 years ago

For allowed values see https://www.eclipse.org/paho/files/javadoc/org/eclipse/paho/client/mqttv3/MqttClient.html#MqttClient-java.lang.String-java.lang.String-

The address of the server to connect to is specified as a URI. Two types of connection are supported tcp:// for a TCP connection and ssl:// for a TCP connection secured by SSL/TLS. For example:

tcp://localhost:1883
ssl://localhost:8883

If the port is not specified, it will default to 1883 for tcp://" URIs, and 8883 for ssl:// URIs.

In addition websocket based connections should work (wss://yourserverWithTls or ws://yourserverWithoutTls).