Author

Topic: Bitcoinj - error when signing message with UTF8 encoding (Read 2909 times)

legendary
Activity: 1526
Merit: 1129
A bug in Google Code would not surprise me, unfortunately.
legendary
Activity: 1001
Merit: 1003
Hey Mike! Thanks for your help. The -DskipTests=true helped a lot Tongue

It was my mistake (and possibly a bug in google code repository)
I had download a zip from the repository instead of using git clone.

When I did using git clone, it worked perfectly.
legendary
Activity: 1526
Merit: 1129
OK, great. Let me know how you get on. If you figure out a solution for the negative time thing, that'd also be useful to know. I'd start by checking the file times in the source tree to make sure none are unrealistically early.
legendary
Activity: 1001
Merit: 1003
Negative time?! I've never seen that error before, you're on Windows? If so, what JDK version and what filing system are you using? From a quick Googling it seems that this error can happen if you have files in your directory tree with timestamps before the UNIX epoch (1970) which obviously should never happen on a working setup.

I don't recommend doing anything in Java with just a text editor. The language is awkwardly verbose. A good IDE like IntelliJ will hide most of the uglyness from you and make it bearable. IntelliJ is free so you can go grab it and then load it up. If you tell it where to find your Maven install, it should work things out for you.

If you want to download the JARs by hand, go ahead, look inside the pom file to see what the library depends on. But it'll take a while. I'd recommend figuring out why Maven thinks time is going backwards instead. I suspect some clock issue or a filing system that doesn't store timestamps properly.



I use windows 7 Professional 64 bit. Time has been correct.

About the IDE, I actually don't use Java directly but usually write in Scala (I consider Scala a wrapper for Java). With Scala, notepad++ is more than enough unless the project is very large.

I will try to recompile on a different PC tomorrow at work, where I have 32 bit Win 7. I have all the dependencies for the earlier version 0.10, so they should just work anyway.
legendary
Activity: 1526
Merit: 1129
Negative time?! I've never seen that error before, you're on Windows? If so, what JDK version and what filing system are you using? From a quick Googling it seems that this error can happen if you have files in your directory tree with timestamps before the UNIX epoch (1970) which obviously should never happen on a working setup.

I don't recommend doing anything in Java with just a text editor. The language is awkwardly verbose. A good IDE like IntelliJ will hide most of the uglyness from you and make it bearable. IntelliJ is free so you can go grab it and then load it up. If you tell it where to find your Maven install, it should work things out for you.

If you want to download the JARs by hand, go ahead, look inside the pom file to see what the library depends on. But it'll take a while. I'd recommend figuring out why Maven thinks time is going backwards instead. I suspect some clock issue or a filing system that doesn't store timestamps properly.

legendary
Activity: 1001
Merit: 1003
This is the output on compile using mvn install -DskipTests=true

Code:
INFO] ------------------------------------------------------------------------
INFO] Reactor Summary:
INFO]
INFO] bitcoinj Parent ................................... SUCCESS [0.225s]
INFO] bitcoinj .......................................... FAILURE [12.582s]
INFO] bitcoinj Examples ................................. SKIPPED
INFO] bitcoinj Tools .................................... SKIPPED
INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
INFO] ------------------------------------------------------------------------
INFO] Total time: 12.976s
INFO] Finished at: Mon Oct 07 21:03:52 IST 2013
INFO] Final Memory: 10M/62M
INFO] ------------------------------------------------------------------------
ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:2.1.2:jar-no-fork (attach-sources) on project bitcoinj: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:2.1.2:jar-no-fork failed: Negative time -> [Help 1]

Should this work in some IDE (and which one)? (I currently only use notepad++)


If we provided compiled JARs you'd have to grab all the dependencies by hand, which is painful.

I think I can manage with the dependencies Tongue
legendary
Activity: 1526
Merit: 1129
Maven isn't great, but it handles resolution of dependencies and is reasonably standard - lots of IDEs and tools support it.

If you were having issues with the unit tests try

mvn install -DskipTests=true

or something similar. Or just open it up with your IDE and let it handle things.

If we provided compiled JARs you'd have to grab all the dependencies by hand, which is painful.
legendary
Activity: 1001
Merit: 1003
D'oh, schoolboy error, sorry. I just pushed a fix to git master.

Thanks! BTW can you put a compiled jar somewhere? I could not compile it with Maven (some errors I cannot remember... will post later).

PS lots of people dislike maven. Why are so many good projects hampered by Maven?
legendary
Activity: 1526
Merit: 1129
D'oh, schoolboy error, sorry. I just pushed a fix to git master.
legendary
Activity: 1001
Merit: 1003
I have tried the latest build of bitcoinj and get error signing messages containing non-ascii characters. This problem also occurs with older versions.

Here is the string.

C'est par mon ordre et pour le bien de l'Etat que le porteur du présent a fait ce qu'il a fait.

This is the default string on brainwallet verify tab

When I use the com.google.bitcoin.core.ECKey.signMessage() method to try to sign this message. I get an exception "array index out of bound". This works nicely if the string contains only ASCII characters. So if we remove the é from the above string, things work fine.

Hope this is fixed soon.

Cheers!


Jump to: