Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running daemon with Version 2.0 ends in NullPointerException #11

Closed
erikp152 opened this issue May 1, 2020 · 11 comments
Closed

Running daemon with Version 2.0 ends in NullPointerException #11

erikp152 opened this issue May 1, 2020 · 11 comments

Comments

@erikp152
Copy link

erikp152 commented May 1, 2020

I have tested the refactored Version 2.0 on my RPI. But if i am starting the daemon, it ends in NullpointerExceptions every ms.

28 Apr. 2020 11:59:26,378 - ERROR:rocks.voss.musicsync.Application:main:47: Exception
java.lang.NullPointerException
	at rocks.voss.musicsync.Application.sync(Application.java:61)
	at rocks.voss.musicsync.Application.main(Application.java:42)

Does somebody else have this problem as well? @maximilianvoss any idea?

@maximilianvoss
Copy link
Owner

How have you started the musicsync? It seems like it did not detect any fitting input plugin.
Please check following file: https://github.com/maximilianvoss/spotify-toniebox-sync/blob/v2.0/package/src/main/resources/musicsync
It puts all generated jars into a classpath to run musicsync. Haven't had time yet to build a single jar with all dependencies included

@paschmal
Copy link

I've got the same problem. Running musicsync script from package\target\output doesn't load any plugins:

Usage: spotify-toniebox-sync.jar [--daemon | --input INPUT --output OUTPUT]
--daemon
                Run in daemon mode to sync periodically all lists in the properties file
--input INPUT
                Define an input source for a one-time run
--output OUTPUT
                Define an output destination for a one-time run

Input Plugins:

Output Plugins:

I also tried to debug PluginLoader.java but it cannot find any subTypes in method loadPlugins(...). My environment is Ubuntu 20.04 LTS with openjdk-11. Do you have any idea why it's not working?

@maximilianvoss
Copy link
Owner

Hi @paschmal,
how do you launch the application? It seems that the plugins are not loaded/in your classpath.
Max

@matthiaslau
Copy link

I´ve experienced the same problem that no plugins were loaded. I started the application via the script: ./musicsync --input spotify:playlist:... --output toniebox:...

@paschmal
Copy link

I run the same command as @matthiaslau using musicsync script. I also tried to run it directly from vscode with explicit classpath set to the plugin jar files in launch.json, but that's not working either.

@bergerf
Copy link

bergerf commented Aug 22, 2020

Is there an solution for this? I have the same issue...

@maximilianvoss
Copy link
Owner

What JDK version do you use? It seems to be an issue with reflections

@bergerf
Copy link

bergerf commented Aug 24, 2020

[~/src/music-sync/package/target/output]$ java -cp musicsync-application-2.0-SNAPSHOT.jar:musicsync-plugins-input-spotify-2.0-SNAPSHOT.jar:musicsync-plugins-output-filesystem-2.0-SNAPSHOT.jar:musicsync-plugins-output-toniebox-2.0-SNAPSHOT.jar:musicsync-plugins-output-toniebox-2.0-SNAPSHOT.jar rocks.voss.musicsync.Application --input "spotify:playlist:ZZZ" --output "toniebox:XXX:YYY"
Exception in thread "main" java.lang.NullPointerException
at rocks.voss.musicsync.Application.sync(Application.java:61)
at rocks.voss.musicsync.Application.main(Application.java:52)

[~/src/music-sync/package/target/output]$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)

Its an Ubuntu 18.04 derivative.

@maximilianvoss
Copy link
Owner

Thanks for confirmation. It seems to be a Java 9+ issue as the module management with Jigsaw has changed which prevents easy reflection. I will have a look to get this resolved.

@moritzj29
Copy link

moritzj29 commented Sep 13, 2020

Hi everyone, I tried to set up this project this weekend and ran into this same issue. Thanks for the note, that this is related to the java version. I downgraded to version 8 for testing (https://askubuntu.com/questions/1133216/downgrading-java-11-to-java-8) and got rid of this.

Unfortunately, I'm not able to log into the Toniecloud:

> 13 Sep 2020 12:44:20,901 - ERROR:rocks.voss.musicsync.plugins.output.toniebox.TonieboxOutputPlugin:openConnection:175: IOException while login
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "errors" (class rocks.voss.toniebox.beans.toniebox.JWTToken), not marked as ignorable (one known property: "jwt"])
at [Source: N/A; line: -1, column: -1] (through reference chain: rocks.voss.toniebox.beans.toniebox.JWTToken["errors"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79)
at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:555)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:708)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1160)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:315)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:2860)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1569)
at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:1902)
at rocks.voss.toniebox.beans.Transformer.createBean(Transformer.java:23)
at rocks.voss.toniebox.beans.Transformer.createBean(Transformer.java:16)
at rocks.voss.toniebox.RequestHandler.executeRequest(RequestHandler.java:159)
at rocks.voss.toniebox.RequestHandler.executePostRequest(RequestHandler.java:125)
at rocks.voss.toniebox.RequestHandler.Login(RequestHandler.java:48)
at rocks.voss.toniebox.TonieHandler.login(TonieHandler.java:43)
at rocks.voss.musicsync.plugins.output.toniebox.TonieboxOutputPlugin.openConnection(TonieboxOutputPlugin.java:172)
at rocks.voss.musicsync.plugins.output.toniebox.TonieboxOutputPlugin.establishConnection(TonieboxOutputPlugin.java:126)
at rocks.voss.musicsync.Application.sync(Application.java:62)
at rocks.voss.musicsync.Application.main(Application.java:42)
13 Sep 2020 12:44:21,188 - INFO:rocks.voss.musicsync.plugins.input.spotify.SpotifyRecordingHandler:isFileValid:95: File doesn't exists
13 Sep 2020 12:44:21,188 - INFO:rocks.voss.musicsync.plugins.input.spotify.SpotifyRecordingHandler:downloadFile:37: Downloading: spotify:track:0yD2V18wbhNdFlE4rg3ovd

Spotify seems to work, at least it says that it tries to download. I double checked my toniebox login credentials. But the unknown field "error" suggest that something is wrong. Any ideas whats causing this? I get the same error with v1.3 and v2.0...
EDIT: moving this to a separate issue at toniebox-API

@maximilianvoss
Copy link
Owner

Code was merged and it should work now on JDK8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants