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

Issue compiling Hono #932

Closed
ctron opened this issue Nov 30, 2018 · 12 comments
Closed

Issue compiling Hono #932

ctron opened this issue Nov 30, 2018 · 12 comments
Milestone

Comments

@ctron
Copy link
Contributor

ctron commented Nov 30, 2018

I noticed this a while back, but didn't really look into it, as it only sporadically popped up in a CI instance.

However now I run into this when deploying Hono 0.8 (the released version) on OpenShift. I didn't run into this before though.

Compiling Hono gives:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile (default-testCompile) on project hono-client: Compilation failure
[ERROR] /tmp/src/client/src/test/java/org/eclipse/hono/client/impl/CommandConnectionImplTest.java:[243,25] cannot find symbol
[ERROR]   symbol:   method close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
[ERROR]   location: variable consumer of type java.lang.Object
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile (default-testCompile) on project hono-client: Compilation failure
/tmp/src/client/src/test/java/org/eclipse/hono/client/impl/CommandConnectionImplTest.java:[243,25] cannot find symbol
symbol:   method close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
location: variable consumer of type java.lang.Object
@ctron
Copy link
Contributor Author

ctron commented Nov 30, 2018

Adding the argument -Dmaven.test.skip=true to the maven build will work around this issue, as the test sources don't get compiled.

@ctron
Copy link
Contributor Author

ctron commented Nov 30, 2018

I actually can reproduce this locally when doing mvn clean test in the client directory.

Running with Java:

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

@ctron
Copy link
Contributor Author

ctron commented Nov 30, 2018

Same result with:

java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

@sophokles73
Copy link
Contributor

We are running into the same issue. However, since the code seems to be correct (at least nobody who took a look so far could find something suspicious), I would attribute this to the (growing) list of issues with OpenJDK 8 ... I (we at Bosch) have moved on to OpenJDK 11.0.1 which behaves as expected ...

@ctron
Copy link
Contributor Author

ctron commented Nov 30, 2018

I agree that this could be the issue. That would also explain why this isn't an issue with the Eclipse IDE, as it uses ECJ instead of javac.

On the other side, we did promise support for Java 8 in Hono 0.8, and so I would like to fix at least the deployment scripts for OpenShift S2I, adding this particular Maven switch. But this would need to be done in the branch of 0.8.x. We wouldn't need to re-release though, as this is only the template file.

@sophokles73
Copy link
Contributor

On the other side, we did promise support for Java 8 in Hono 0.8

The binaries can be run with a version 8 JVM. The problem is only with compiling.

But this would need to be done in the branch of 0.8.x.

Then by all means, create the branch 👍

ctron added a commit to ctron/hono that referenced this issue Nov 30, 2018
@Alfusainey
Copy link
Contributor

I would attribute this to the (growing) list of issues with OpenJDK 8

Just a side note: i was also facing the same issue compiling the sources with Oracle JDK 8. so probably the issue is not specific to OpenJDK

@ctron
Copy link
Contributor Author

ctron commented Dec 3, 2018

I agree, I think this is an issue with OpenJDK(-based) javac. The ECJ is more powerful, as least from what I experienced (javac developers might disagree). As the Oracle JDK is based on OpenJDK, it provides the some issues as OpenJDK 😁

Moving on to Java 11 might be the right thing to do here. But we should, to some degree, support users of Java 8, as said to support Hono 0.8 with that.

Anyway, I think the issue is solved for the S2I based deployment when #934 is merged.

@sophokles73
Copy link
Contributor

@ctron can we (you) close this issue?

@sophokles73 sophokles73 added this to the 0.9 milestone Dec 7, 2018
@ctron
Copy link
Contributor Author

ctron commented Dec 7, 2018

Well the issue is not solved in general … for OpenShift S2I, we have a workaround.

The question is do we really want to solve this, or simply go for Java 11 and ignore it … I would have no issues going for the latter.

@sophokles73
Copy link
Contributor

How could we resolve an issue with OpenJDK? FMPOV we have a workaround for Hono altogether, which is to use OpenJDK 11 for compiling ...

So +1 for going to Java 11, which we already have done

@ctron
Copy link
Contributor Author

ctron commented Dec 7, 2018

We could re-write that section to make it "compliant" with the OpenJDK 8 javac … but I would prefer not to do this.

It looks like fabric8io-images/s2i#203 is near completion … let's move on to Java 11 and don't look back. And if someone has a complaint, re-open the issue.

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

3 participants