Multibit-Legacy / multibit-hd

Deprecated Bitcoin Wallet
https://multibit.org/blog/2017/07/26/multibit-shutdown.html
Other
172 stars 114 forks source link

Mac installation fails to start with incorrect cast of Log4jLoggerAdapter #400

Open mdance opened 9 years ago

mdance commented 9 years ago

I am trying to run Multibit HD.app and get the following error:

java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger at org.multibit.hd.core.logging.LoggingFactory.getCleanRoot(LoggingFactory.java:106) at org.multibit.hd.core.logging.LoggingFactory.bootstrap(LoggingFactory.java:32) at org.multibit.hd.core.services.CoreServices.main(CoreServices.java:144) at org.multibit.hd.ui.MultiBitHD.initialiseCore(MultiBitHD.java:291) at org.multibit.hd.ui.MultiBitHD.start(MultiBitHD.java:122) at org.multibit.hd.ui.MultiBitHD.main(MultiBitHD.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.exe4j.runtime.LauncherEngine.launch(Unknown Source) at com.install4j.runtime.launcher.MacLauncher.main(Unknown Source)

gary-rowe commented 9 years ago

Thanks for the feedback. Are you using the 0.0.5beta installer? Have you made any custom changes to the mbhd.yaml file?

There shouldn't be any reference to Log4j within MultiBit HD - it uses Logback.

mdance commented 9 years ago

I used whatever was on the website from the day when I emailed, I have deleted the installer afterwards so I am unable to check the version

On Sun, Feb 8, 2015 at 8:59 PM, Gary Rowe notifications@github.com wrote:

Thanks for the feedback. Are you using the 0.0.5beta installer?

— Reply to this email directly or view it on GitHub https://github.com/bitcoin-solutions/multibit-hd/issues/400#issuecomment-73404356 .

gary-rowe commented 9 years ago

OK, if you only downloaded the installer off the beta site recently then it will be 0.0.5beta. However, just to be absolutely sure would you mind downloading the 0.0.0 release which represents the latest build (currently pre-Beta 6)?

Could you describe how you start the app and how the symptoms manifest because just clicking MultiBit HD.app is unable to replicate the problem here.

mdance commented 9 years ago

I'm receiving the same error

On Mon, Feb 9, 2015 at 1:59 AM, Gary Rowe notifications@github.com wrote:

OK, if you only downloaded the installer off the beta site recently then it will be 0.0.5beta. However, just to be absolutely sure would you mind downloading the 0.0.0 release https://multibit.org/releases/multibit-hd/multibit-hd-0.0.0/ which represents the latest build (currently pre-Beta 6)?

Could you describe how you start the app and how the symptoms manifest because just clicking MultiBit HD.app is unable to replicate the problem here.

— Reply to this email directly or view it on GitHub https://github.com/bitcoin-solutions/multibit-hd/issues/400#issuecomment-73414270 .

gary-rowe commented 9 years ago

Thanks for the update. Could you upload some logs/console output/screenshots so I can see the start up sequence?

Assuming there is anything, you'll find logs in:

In addition, could you try the following:

  1. Ensure you have Java 7+ installed on your Mac (Terminal java -version should show 1.7.0_12 or higher)
  2. Navigate in Finder to Applications/MultiBit HD
  3. Right click Show Package Contents
  4. Navigate to Contents/java/app
  5. Copy multibit-hd.jar to ~/Desktop
  6. Open Terminal and cd ~/Desktop
  7. Launch with java -jar multibit-hd.jar

This last sequence should absolutely rule out any Log4j dependencies that could be creeping in although I've checked the Install4j supporting JARs and no sign of Log4j is present.

Let me know how you get on, and thanks for taking the time to help out with this - much appreciated.

gary-rowe commented 9 years ago

I've updated my earlier comment to provide additional locations for logs that will shed some light on what's going on here.

mdance commented 9 years ago

The initial log directory did not exist.

cat error.log
Mon  9 Feb 2015 08:42:35 AEDT
log4j:WARN No appenders could be found for logger (org.multibit.hd.core.concurrent.SafeExecutors).
log4j:WARN Please initialize the log4j system properly.
java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger
at org.multibit.hd.core.logging.LoggingFactory.getCleanRoot(LoggingFactory.java:106)
at org.multibit.hd.core.logging.LoggingFactory.bootstrap(LoggingFactory.java:32)
at org.multibit.hd.core.services.CoreServices.main(CoreServices.java:144)
at org.multibit.hd.ui.MultiBitHD.initialiseCore(MultiBitHD.java:291)
at org.multibit.hd.ui.MultiBitHD.start(MultiBitHD.java:122)
at org.multibit.hd.ui.MultiBitHD.main(MultiBitHD.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.MacLauncher.main(Unknown Source)

Then

md at mactop in /A/M/C/j/app 22.370 Mb
java -jar multibit-hd.jar
Mon  9 Feb 2015 08:42:38 AEDT

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/multibit/hd/ui/MultiBitHD : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Then

md at mactop in /A/M/C/j/app 22.370 Mb
pwd
Mon  9 Feb 2015 08:42:58 AEDT

/Applications/MultiBit HD.app/Contents/java/app
gary-rowe commented 9 years ago

Hmm no installer.log? OK that class 51 error means you're running Java6 which is Mac default. Can you install Java 7 and try that last command again?

gary-rowe commented 9 years ago

@mdance Have you seen this error again?

Perhaps try the Beta 6 installer: https://beta.multibit.org/releases/multibit-hd/multibit-hd-0.0.6beta/

mdance commented 9 years ago

I am still experiencing the same issue with the latest installer

On Thu, Feb 26, 2015 at 12:42 AM, Gary Rowe notifications@github.com wrote:

@mdance https://github.com/mdance Have you seen this error again?

Perhaps try the Beta 6 installer: https://beta.multibit.org/releases/multibit-hd/multibit-hd-0.0.6beta/

— Reply to this email directly or view it on GitHub https://github.com/bitcoin-solutions/multibit-hd/issues/400#issuecomment-75960969 .

gary-rowe commented 9 years ago

Thanks for coming back on this. I'm really struggling to work out how a dependency on Log4j is getting in since neither Install4j nor MultiBitHD includes that framework. Consequently I'm suspecting an unusual configuration at your end. Getting to the bottom of this will certainly help with installation instructions.

Were you able to upgrade to Java 7 and try the earlier manual instructions?

gary-rowe commented 9 years ago

I've not heard anyone else reporting this error since we began bundling JRE 7 so I'm going to close this as resolved.

gary-rowe commented 8 years ago

There has been a repeat of this so re-opening to prompt further investigation.

java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger
    at org.multibit.hd.core.logging.LoggingFactory.getCleanRoot(LoggingFactory.java:119)
    at org.multibit.hd.core.logging.LoggingFactory.bootstrap(LoggingFactory.java:34)
    at org.multibit.hd.ui.MultiBitHD.start(MultiBitHD.java:119)
    at org.multibit.hd.ui.MultiBitHD.main(MultiBitHD.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.install4j.runtime.launcher.MacLauncher.main(Unknown Source)