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

mvn compile errors #31

Closed
lobsteroh opened this issue Mar 26, 2017 · 21 comments
Closed

mvn compile errors #31

lobsteroh opened this issue Mar 26, 2017 · 21 comments

Comments

@lobsteroh
Copy link

hi all, am running into some problems with the basic mvn install ...
osx 10.11.6 and
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

 [java] The following errors occurred during analysis:
 [java]   Unable to get XClass for java/lang/StringBuilder
 [java]     java.lang.ArrayIndexOutOfBoundsException: 5747
 [java]       At org.objectweb.asm.ClassReader.readClass(Unknown Source)
 [java]       At org.objectweb.asm.ClassReader.accept(Unknown Source)
 [java]       At edu.umd.cs.findbugs.asm.FBClassReader.accept(FBClassReader.java:44)
 [java]       At org.objectweb.asm.ClassReader.accept(Unknown Source)
 ....

and finally

 [INFO] ------------------------------------------------------------------------
 [INFO] Reactor Summary:
 [INFO] 
 [INFO] JavaOSC - Parent ................................... SUCCESS [  0.092 s]
 [INFO] JavaOSC - Core ..................................... FAILURE [  7.900 s]
 [INFO] JavaOSC - UI ....................................... SKIPPED
 [INFO] JavaOSC - Aggregation .............................. SKIPPED
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD FAILURE
 [INFO] ------------------------------------------------------------------------

any suggestions greatly welcome

@hoijui
Copy link
Owner

hoijui commented Mar 27, 2017

hey lob! :-)
... awww i spent soo much time making sure it compiles with Java 6, and apparently i forgot to check Java 8 compatibility in the end. :/
i am sorry!
i just tested (on the javaosc-0.4 release), and it compiles with Java 6 and 7, but not 8.
i think i will not change it anymore, but will soon make a new release 0.5, with many updates already in line. for now, you should be able to work around this with:

Workaround

in the file modules/core/pom.xml, starting from line 83 (in javaosc-0.4), remove the whole section <executions>...</executions>, and then run mvn install again.
you will not loose anything by that, just some tests are not run.

@lobsteroh
Copy link
Author

hi hoijui, thanx a huge bunch for your msg. i just ended up loading the folder into eclipse and compiling it there. actually i have been just importing the source files for my own compiles and everything worked out like a charm. just got into osc and am puzzled by how good this system is. kicking myself why i haven't used it earlier. thanks again, robert

@hoijui
Copy link
Owner

hoijui commented Mar 29, 2017 via email

@lobsteroh
Copy link
Author

lobsteroh commented Mar 29, 2017

hallo freut mich ungemein, bin Oesterreicher und lebe in den USA :-) I really appreciate your library, saved my bacon. i was using it to play sound in PureData for a series of site-specific acousmatic compositions and I was controlling it from a java-based videotracking application. it would have been very difficult to do this dynamic soundscape without your library. i had never used OSC before (or had even heard of it), but I can see its power and i will use it for many future projects from sensor logging to controlling robotic interfaces. the library is very elegant, beautifully abstracted and i managed to get it working even without much knowledge of the protocol. my favorite object is OSCPortOut - was my friend on first sight. only thing that took me a while was realizing that the 'address' in osc message was not referring to a hostname ... smooth sailing after. Vielen Dank noch einmal.

@hoijui
Copy link
Owner

hoijui commented Mar 29, 2017 via email

@lobsteroh
Copy link
Author

lobsteroh commented Mar 29, 2017 via email

@hoijui
Copy link
Owner

hoijui commented Mar 29, 2017

ahh... where did you find that? i would not know where that is.. ;-)
on a website maybe, or old version repo?

@hoijui
Copy link
Owner

hoijui commented Mar 29, 2017

i see...
yeah, nothing about the usage of OSCPort there, so no wonder you start searching elsewhere for putting the receiver IP. can't do much about that unfortunately, but will improve javadoc comments in the source. thanks! :-)

@dsouth
Copy link

dsouth commented Jun 22, 2017

Your workaround removes the one error, but there are test failure.

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.illposed.osc.OSCBundleTest
[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.076 s <<< FAILURE! - in com.illposed.osc.OSCBundleTest
[ERROR] testSendBundle(com.illposed.osc.OSCBundleTest)  Time elapsed: 0.013 s  <<< FAILURE!
java.lang.AssertionError: Send Bundle did not receive the correct timestamp Thu Jan 01 10:00:00 EST 1970(0) (should be Thu Jun 22 12:58:08 EST 2017( 1498100288850)) 
	at com.illposed.osc.OSCBundleTest.sendBundleTimestampTestHelper(OSCBundleTest.java:30)
	at com.illposed.osc.OSCBundleTest.testSendBundle(OSCBundleTest.java:47)

[INFO] Running com.illposed.osc.OSCMessageTest
[INFO] Tests run: 36, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 s - in com.illposed.osc.OSCMessageTest
[INFO] Running com.illposed.osc.OSCPortTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.648 s - in com.illposed.osc.OSCPortTest
[INFO] Running com.illposed.osc.utility.OSCByteArrayToJavaConverterTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.illposed.osc.utility.OSCByteArrayToJavaConverterTest
[INFO] Running com.illposed.osc.utility.OSCJavaToByteArrayConverterTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.illposed.osc.utility.OSCJavaToByteArrayConverterTest
[INFO] Running com.illposed.osc.utility.OSCPacketDispatcherTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.illposed.osc.utility.OSCPacketDispatcherTest
[INFO] Running com.illposed.osc.utility.OSCPatternAddressSelectorTest
[INFO] Tests run: 29, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.illposed.osc.utility.OSCPatternAddressSelectorTest
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   OSCBundleTest.testSendBundle:47->sendBundleTimestampTestHelper:30 Send Bundle did not receive the correct timestamp Thu Jan 01 10:00:00 EST 1970(0) (should be Thu Jun 22 12:58:08 EST 2017( 1498100288850)) 
[INFO] 
[ERROR] Tests run: 97, Failures: 1, Errors: 0, Skipped: 0

@hoijui
Copy link
Owner

hoijui commented Jun 22, 2017

what works for me:

get latest repo status:

git fetch
# or
git clone https://github.com/hoijui/JavaOSC.git
cd JavaOSC

then:

mvn clean

and finally:

git checkout javaosc-0.4-java8fix
mvn install

this works for me with Java 8 on linux, including the unit tests.
did you try some other version?
does this fail for you too?

@lobsteroh
Copy link
Author

confirming it works like a charm on mac osx as well. thanks for doing this. a few minor heads-ups like
[WARNING] bootstrap class path not set in conjunction with -source 1.6
but clean compile and tests without failures. tx

@hoijui
Copy link
Owner

hoijui commented Jun 22, 2017

ook, nice! :-)
thanks for letting me know.
yeah, those warnings will be there until we switch source and target to Java 8, but they are only really relevant when compiling for a release.

@daveyarwood
Copy link
Collaborator

I just got bit by the same thing as in the original post, running Java 8 on the develop branch. Merging the java8 branch fixed the "Unable to get XClass for ..." errors, but findbugs still found one bug, causing mvn clean install to fail:

[INFO] --- findbugs-maven-plugin:3.0.5:check (default) @ javaosc-core ---
[INFO] BugInstance size is 1
[INFO] Error size is 0
[INFO] Total bugs: 1
[INFO] Class com.illposed.osc.OSCMessageEvent defines non-transient non-serializable instance field message [com.illposed.osc.OSCMessageEvent] In OSCMessageEvent.java SE_BAD_FIELD

The issue here is that we have a class OSCMessageEvent that is supposed to be Serializable (by way of extending java.util.EventObject), however it has a private final OSCMessage message property, and OSCMessage does not implement Serializable. If I'm understanding correctly, this is a problem because it means things will blow up us soon as somebody attempts to serialize an OSCMessageEvent.

This StackOverflow question is relevant here. I'm not quite sure how best to handle this. It feels like we just need to implement Serializable for OSCMessage, like we've done for other classes.

I'm about to submit a PR that merges java8 into develop and also fixes checkstyle violations -- hopefully that's a step in the right direction!

@daveyarwood
Copy link
Collaborator

BTW, I found that changing this line:

private final OSCMessage message;

to

private final transient OSCMessage message;

also fixes the bug and allows mvn install to run successfully, but that's probably not desirable because it means the message field will not be serialized. I would think that if somebody wants to serialize an OSCMessageEvent, they'll probably want the message to be part of it!

@hoijui
Copy link
Owner

hoijui commented Dec 31, 2018

ouhh yeah the OSCMessage should probably be serializable!
But java8 should not yet be merged into develop, because we are still on Java 7 regarding compatibility and release version target.

@daveyarwood
Copy link
Collaborator

That makes sense. Do you know what, exactly about the java8 branch is not compatible with Java 7? It would be great if we could go ahead and push toward compatibility with both Java 7 and 8.

@hoijui
Copy link
Owner

hoijui commented Jan 1, 2019

I think that is only possible with two different code-bases, or at least two different artifacts (like javaosc-0.5.0-java6and7 and javaosc-0.5.0-java8+, because the class-file format has changed in Java 8. If I remember right, that is the fundamental issue. Common practice to deal with this is to just change to the newer versions of Java at a new release... sometime. I find it a bit strange, because one never knows with which Java version a library is compiled.. that is not something that Maven has mechanisms for, for example.
So... at some point I would release a new version with Java 7, then very son move to Java 8, maybe even immediately, and make an other release right away.
I guess In the Java world, there is generally little reason not to update a system to a new JRE version, because there are few restrictions on the underlying OS in most cases. In the very worst case, someone being limited to Java 6 or 7, they would have to use an older release of the library, opr manually make some changes and compile it themselves.

@daveyarwood
Copy link
Collaborator

Ah, that all makes sense.

If your goal is to release some unreleased code and have it be available for Java 6-7, then I think it makes sense to release JavaOSC 0.5.0 as the last release that supports Java 6-7, then immediately release JavaOSC 0.6.0 as the first release that requires Java 8+.

FWIW, Java 7 reached EOL back in January 2015, so I don't think there is a compelling reason to continue to support it. Everybody should be using Java 8+ at this point, for critical security updates, etc.

@hoijui
Copy link
Owner

hoijui commented Jan 1, 2019

wow... makes me feel old! ;-)
you are right of course, and thanks for the info.

@hoijui
Copy link
Owner

hoijui commented Feb 18, 2019

the develop branch now uses Java 8, and so will the nest release.

@hoijui hoijui closed this as completed Feb 18, 2019
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

4 participants