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

Exception on initialize #52

Open
yarygin opened this issue Nov 3, 2016 · 5 comments
Open

Exception on initialize #52

yarygin opened this issue Nov 3, 2016 · 5 comments

Comments

@yarygin
Copy link

yarygin commented Nov 3, 2016

I tried to use your library for android but I've got an error at MPD class init: com.google.inject.internal.cglib.core.$MethodWrapper$MethodWrapperKey$$$KeyFactoryByCGLIB$$e23ecb5d
Here's code
try { MPD mpd = new MPD.Builder().build(); } catch (Exception error) { String text = error.getMessage(); Toast.makeText(this, "Exception: " + text, Toast.LENGTH_LONG).show(); }
I've tried to compile with graddle
compile 'net.thejavashop:javampd:5.0.3'
for android SDK version 22 java 7.
I'm new at android development.
Please lead me if this is not a bug and I do something wrong.

@finnyb
Copy link
Owner

finnyb commented Nov 4, 2016

I ran a quick test and was able to connect using your example.

The default values for connecting are localhost host using port 6600. Are you able to telnet to localhost over port 6600?

@yarygin
Copy link
Author

yarygin commented Nov 5, 2016

Thank you for reply!
I have mpd host at 192.168.0.111 but I created ssh tunnel to the host:
ssh -L 6600:127.0.0.1:6600 username@192.168.0.111
and tried to telnet it like a localhost:
telnet localhost 6600
Connection was esteblised successfully.
As I said - I did it with android. Can this cause an issues?

@yarygin
Copy link
Author

yarygin commented Nov 5, 2016

The exception is thrown at MPD.java:186
Builder() method
at row
injector = Guice.createInjector(new MPDModule());

This is a Guice exception but I can't find out the reason.

@yarygin
Copy link
Author

yarygin commented Nov 5, 2016

Here is stack trace:
W/nalizableReferenceQueue: Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move Google Collections to your system class path.
java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class
at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.getBaseUrl(FinalizableReferenceQueue.java:269)
at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.loadFinalizer(FinalizableReferenceQueue.java:253)
at com.google.inject.internal.util.$FinalizableReferenceQueue.loadFinalizer(FinalizableReferenceQueue.java:175)
at com.google.inject.internal.util.$FinalizableReferenceQueue.(FinalizableReferenceQueue.java:100)
at com.google.inject.internal.util.$MapMaker$QueueHolder.(MapMaker.java:787)
at com.google.inject.internal.util.$MapMaker$WeakEntry.(MapMaker.java:946)
at com.google.inject.internal.util.$MapMaker$Strength$1.newEntry(MapMaker.java:312)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(MapMaker.java:498)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(MapMaker.java:419)
at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2029)
at com.google.inject.internal.Annotations$AnnotationChecker.hasAnnotations(Annotations.java:116)
at com.google.inject.internal.Annotations.isScopeAnnotation(Annotations.java:124)
at com.google.inject.internal.ScopeBindingProcessor.visit(ScopeBindingProcessor.java:40)
at com.google.inject.internal.ScopeBindingProcessor.visit(ScopeBindingProcessor.java:30)
at com.google.inject.spi.ScopeBinding.acceptVisitor(ScopeBinding.java:59)
at com.google.inject.internal.AbstractProcessor.process(AbstractProcessor.java:55)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:165)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.bff.javampd.MPD$Builder.(MPD.java:186)
at com.yarygin.alex.mpd_test.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5971)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2522)
at android.app.ActivityThread.access$800(ActivityThread.java:167)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1417)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5534)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)

@finnyb
Copy link
Owner

finnyb commented Nov 7, 2016

this might be an issue with android and Guice 3. I'm not familiar with android development so I'm not sure how hard it would be for you to try upgrading Guice to 4.

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

2 participants