[SOLVED] Local blynk server on raspberry pi 3

Hi,
my current project is building a toy-car which i can control with my smartphone. For that i want to use blynk. Because i want to be mobile with my car and also i don’t want to use all my mobile data for blynk, i want to install a local sever on the used raspberry pi. To be independent from my local router i set up my raspberry pi as an access point. Now i can connect my phone to the PI and i should be able to control my raspberry pi with it. So in my plans the raspberry pi is the local server for blynk and also the blynk-hardware.

When i try to start the local server via java and the newest .jar file, i get the following error:

pi@raspberrypi:~/BlynkServer $ java -jar server-0.21.3.jar -dataFolder /home/pi/BlynkServer/Data
Exception in thread "main" java.lang.ClassFormatError: Extra bytes at the end of class file java/net/SocketAddress
	at java.lang.ClassLoader.findBootstrapClass(Native Method)
	at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1012)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:413)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.fasterxml.jackson.databind.deser.std.FromStringDeserializer.types(FromStringDeserializer.java:31)
	at com.fasterxml.jackson.databind.deser.std.JdkDeserializers.<clinit>(JdkDeserializers.java:25)
	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findDefaultDeserializer(BasicDeserializerFactory.java:1605)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.findStdDeserializer(BeanDeserializerFactory.java:166)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:131)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:406)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:352)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
	at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
	at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:476)
	at com.fasterxml.jackson.databind.ObjectReader._prefetchRootDeserializer(ObjectReader.java:1899)
	at com.fasterxml.jackson.databind.ObjectReader.<init>(ObjectReader.java:185)
	at com.fasterxml.jackson.databind.ObjectMapper._newReader(ObjectMapper.java:641)
	at com.fasterxml.jackson.databind.ObjectMapper.readerFor(ObjectMapper.java:3358)
	at cc.blynk.utils.JsonParser.<clinit>(JsonParser.java:42)
	at cc.blynk.server.core.dao.FileManager.lambda$deserialize$1(FileManager.java:140)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401)
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734)
	at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:496)
	at cc.blynk.server.core.dao.FileManager.deserialize(FileManager.java:150)
	at cc.blynk.server.Holder.<init>(Holder.java:85)
	at cc.blynk.server.launcher.ServerLauncher.start(ServerLauncher.java:71)
	at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:65)

The command java -version gives me:

java version “1.8.0_65”
Java™ SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot™ Client VM (build 25.65-b01, mixed mode)

When i tried to run the server before i set up the raspberry pi as an access point everything worked just fine. Does anyone have an idea what i did wrong ? Is my plan to set up the Raspberry pi as blynk-server and blynk-hardware at the same time even possible ?

Regards
Max

Hello. Please try with latest server version.

Oh sorry I didn’t mention that I tried different versions. With the latest version I get the same error.

pi@raspberrypi:~/BlynkServer $ java -jar server-0.24.6.jar -dataFolder /home/pi/BlynkServer/Data
Exception in thread “main” java.lang.ClassFormatError: Extra bytes at the end of class file java/net/SocketAddress
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1012)
at java.lang.ClassLoader.loadClass(ClassLoader.java:413)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.fasterxml.jackson.databind.deser.std.FromStringDeserializer.types(FromStringDeserializer.java:31)
at com.fasterxml.jackson.databind.deser.std.JdkDeserializers.(JdkDeserializers.java:25)
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findDefaultDeserializer(BasicDeserializerFactory.java:1609)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.findStdDeserializer(BeanDeserializerFactory.java:166)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:131)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:403)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:476)
at com.fasterxml.jackson.databind.ObjectReader._prefetchRootDeserializer(ObjectReader.java:1902)
at com.fasterxml.jackson.databind.ObjectReader.(ObjectReader.java:185)
at com.fasterxml.jackson.databind.ObjectMapper._newReader(ObjectMapper.java:650)
at com.fasterxml.jackson.databind.ObjectMapper.readerFor(ObjectMapper.java:3367)
at cc.blynk.utils.JsonParser.(JsonParser.java:48)
at cc.blynk.server.core.dao.FileManager.lambda$deserializeUsers$1(FileManager.java:138)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401)
at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734)
at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:496)
at cc.blynk.server.core.dao.FileManager.deserializeUsers(FileManager.java:148)
at cc.blynk.server.Holder.(Holder.java:104)
at cc.blynk.server.launcher.ServerLauncher.start(ServerLauncher.java:81)
at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:75)

Ok. I’m afraid you need to remove your profile in order to fix that. Please clean up your data folder (yes, you will loss all your data).

Ok, I tried to remove the whole folder with the .jar file and everything else. Then I downloaded the newest version again and tried to run it. Unfortunately also the same error :confused:

Could it be that there is something wrong with the settings of the network interfaces ?

Ok. I’ll check. Not sure what it could be right.

@max1 please try update your java to the latest version. Same instructions as here: https://github.com/blynkkk/blynk-server#install-java-for-ubuntu

Please let me know if that helped.

I finally managed it to update my java but I still have an error. But this time its another one:

pi@raspberrypi:~/BlynkServer $ java -version
java version “1.8.0_131”
Java™ SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot™ Client VM (build 25.131-b11, mixed mode)

pi@raspberrypi:~/BlynkServer $ java -jar server-0.24.6.jar -dataFolder /home/pi/BlynkServer/Serverdata
/opt/jdk1.8.0_131/jre/lib/rt.jar: invalid LOC header (bad signature)
Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/transform/Source
at org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:46)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:522)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:459)
at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:265)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:613)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
at org.apache.logging.log4j.core.async.AsyncLoggerContext.start(AsyncLoggerContext.java:76)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:242)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
at cc.blynk.utils.LoggerUtil.changeLogLevel(LoggerUtil.java:44)
at cc.blynk.utils.LoggerUtil.configureLogging(LoggerUtil.java:34)
at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:58)
Caused by: java.lang.ClassNotFoundException: javax.xml.transform.Source
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 14 more

This error means only 1 issue. Your jar is corrupted. However, I’m not sure this is regarding the java jar or the blynk server jar.

Please try to remove server jar and download it again. Please repeat same with Java - uninstall and install again.

Ok, I will try and reply if it worked :slight_smile:

So I reinstalled everything including java and the libraries and now I don’t have any errors. Even my first problem with the compiling error with BlynkTimer is gone and I can use this function as intended :slight_smile:

Thank you very much for your help :)))

Is there any opportunity to close this topic ? Or do I just set the label to solved ?

2 Likes