[comixed-dev] Re: Upgrading to Java12 for 0.7

  • From: "bareheiny" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "bareheiny" for DMARC)
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Thu, 18 Jun 2020 11:07:23 +1200

Last question on this - does 0.7 need a clean DB?

I’m getting errors trying to run it using a DB created with 0.6.

On 18/06/2020, at 08:06, Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:


Sure thing, I'll update that now.

On Wed, Jun 17, 2020 at 3:07 PM bareheiny <dmarc-noreply@xxxxxxxxxxxxx> 
wrote:
Ta.

Can that be made clear in the QuickStart guide - so folk like me don’t get 
the wrong thing and wonder why CX won’t work?

On 18/06/2020, at 01:48, Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:


Oracle no longer releases a JRE, after Java8. So the user's going to need 
to get JDK 12 as the minimum (we don't need 14, but 14 should be backwards 
compatible so it can be used) now.

On Tue, Jun 16, 2020 at 5:28 PM bareheiny <dmarc-noreply@xxxxxxxxxxxxx> 
wrote:
So just to make things confusing...Googling “java” takes one to 
java.com....where the latest release is 8 (update 251).

So does a user need the JKD version (which is now at 14.0.1), and is found 
at oracle.com?



On 17/06/2020, at 00:48, Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:


For 0.7/develop the minimum is Java12. 0.6 will still be released 
requiring Java8, though.

On Tue, Jun 16, 2020 at 5:36 AM Guy Incognito 
<dmarc-noreply@xxxxxxxxxxxxx> wrote:
Piggybacking on this thread, what version of Java is needed to run 0.7?

 

I’m getting a “this version of the Java Runtime only recognizes class 
file versions up to 52.0” error when running it with Java SE 1.8.0_251.

 

From: Darryl L. Pierce
Sent: Tuesday, 16 June 2020 12:58 PM
To: comixed-dev@xxxxxxxxxxxxx
Subject: [comixed-dev] Re: Upgrading to Java12 for 0.7

 

The 0.7 JARs have h2-1.4.200 in them, while the 0.6 JARs have h2-1.4.197.

 

On Mon, Jun 15, 2020 at 8:21 PM bareheiny <dmarc-noreply@xxxxxxxxxxxxx> 
wrote:

What version of H2 is being used for 0.7 onwards?




On 14/06/2020, at 11:18, bareheiny <bareheiny@xxxxxxxxx> wrote:



For sure there’s some change between the H2 driver that CX used, and 
later versions.

 

If you access H2 via an SQL client (I use workbench) you’ll likely need 
to grab the appropriate driver as well and update the connection.




On 14/06/2020, at 09:09, Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:



Yeah, I hate when upgrading causes things to break due to the 
dependencies being different. I upgraded our Spring Boot dependency to 
2.3.1.RELEASE which is what pushed us up to Mockito 3 since that's what 
they depend on.

 

Fortunately I was able to work around the need for PowerMockito by 
hiding those static method calls in the Utils class. So now the Java12 
migration works and I've merged it into develop. :D

 

A note of caution for everybody: you now won't be able to use the 0.6 
and 0.7 release interchangeably. Upgrading Spring upgraded H2 and that's 
going to cause your embedded database file to be migrated when you run 
0.7. And I don't believe 0.6 will be able to read them. I'd recommend 
using a MySQL server or something else standalone if possible: I use 
MySQL and it didn't have a problem switching between 0.6 and 0.7.

 

On Sat, Jun 13, 2020 at 4:19 PM Frédéric Fouret 
<fouretfrederic@xxxxxxxxx> wrote:

Hi,

I don't know why we have the error. But while searching I found several 
elements that could be interesting. 

First, it seems that PowerMock doesn't work with Mockito 3.x (see : 
https://github.com/powermock/powermock/issues/1055

Secondly, it seems that our version of PowerMock is a bit old. We are 
using version 2.0.0. It seems that the PowerMockAgent does not support 
java >=10 (see : https://github.com/powermock/powermock/issues/979). 
This is fixed in version 2.0.2. I don't really know if the 
PowerMockAgent is being used and if this could be the cause of the 
problem... but maybe an upgrade should be tested (and if the first point 
with Mockito version 3.x is not already blocking itself).

 

Le sam. 13 juin 2020 à 18:33, Darryl L. Pierce <mcpierce@xxxxxxxxx> a 
écrit :

I ended up removing the testing of static methods in the JUnit tests and 
wrapped the calls in our Utils class. That way I was able to just use 
Mockito directly in those tests. What a PITA.

 

On Sat, Jun 13, 2020 at 9:35 AM Darryl L. Pierce <mcpierce@xxxxxxxxx> 
wrote:

Correction: this appears to be an issue with PowerMockito rather than 
Mockito.

 

On Sat, Jun 13, 2020 at 9:16 AM Darryl L. Pierce <mcpierce@xxxxxxxxx> 
wrote:

I started working on this issue today since, by the time 0.7 will get 
released, Github is dropping support for building artifacts with Java8. 
So it's pretty import to get this done before we do any more coding in 
Java.

 

I'm hitting an issue, though, with Mockito 3.3.3 in the comixed-services 
module. Specifically I"m seeing, when running the JUnit test suite for 
LibraryService, the following runtime error:

 

java.lang.NoClassDefFoundError: Could not initialize class 
org.comixed.service.library.ReadingListService$MockitoMock$1837613629

at 
jdk.internal.reflect.GeneratedSerializationConstructorAccessor5.newInstance(Unknown
 Source)
at 
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at 
org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)

 

And I'm not sure exactly why it's doing this. The class is says it can't 
find (ReadingListService) is in the same package as the test class and 
the class being tested.

 

Has anybody else seen this issue? Do you know the fix for it?


--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - 
Gord Downie



--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - 
Gord Downie



--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - 
Gord Downie



--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - 
Gord Downie



--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - 
Gord Downie

 



-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - 
Gord Downie


-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord 
Downie


-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord 
Downie

Other related posts: