iotaledger / iri

IOTA Reference Implementation
Other
1.15k stars 370 forks source link

Exception in Neighbor Router after upgrade vfrom 1.7.1 to 1.8.0 #1508

Open tardar opened 5 years ago

tardar commented 5 years ago

All neighbors after upügrade are shown as "connected: false" I think that has to do with this error. With 1.7.1 all worked fine and i only replaced iri.

Bug description

Exception in 1.8.0 after uügrade from 1.7.1

IRI version

1.8.0

Steps To Reproduce

  1. upgrade to 1.8.0 from 1.7.1
  2. start node

Errors

07/10 19:40:58.174 [Neighbor Router] INFO NeighborRouter:336 - established connection to neighbor ***, now performing handshake... 07/10 19:40:58.176 [Neighbor Router] INFO NeighborRouter:262 - neighbor router stopped Exception in thread "Neighbor Router" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; at com.iota.iri.network.protocol.Handshake.createHandshakePacket(Handshake.java:48) at com.iota.iri.network.NeighborRouter.handleConnect(NeighborRouter.java:341) at com.iota.iri.network.NeighborRouter.route(NeighborRouter.java:228) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

kwek20 commented 5 years ago

What version of java are you on? This is a Java 9 change. A quick fix is to update to 9 as well.

We can make this runnable on 8 by casting before flipping like so: ((Buffer)byteBuffer).flip()

GalRogozinski commented 5 years ago

@kwek20 We only officially support java 8. It definitely works for me on java 8, and we compiled our jar with java 8...

Not sure why this error happens... @tardar did you compile yourself?

kwek20 commented 5 years ago

@GalRogozinski According to this guy; we couldve still compiled it to a java 9 feature. I didnt test it myself, but lots of people seem to agree: https://github.com/plasma-umass/doppio/issues/497#issuecomment-334740243

GalRogozinski commented 5 years ago

@kwek20 This means he compiled it himself with java 9... He should compile it with java 8.

kwek20 commented 5 years ago

@GalRogozinski Ah i figured maybe you had a higher java, but set compile target as 1.8. Either way, the fix is easy to implement. I think we should!

GalRogozinski commented 5 years ago

I think we should take some time when we feel like it to go over all the changes we need to do so it works on java 11 (or even 9), and do them. Then we should officially compile on that version. In the meanwhile people can use java 8.

Otherwise we are fixing one thing for java 9/10/11 and then a commit later we will be breaking another thing.