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

Use JRE11 #441

Closed
wants to merge 292 commits into from
Closed

Use JRE11 #441

wants to merge 292 commits into from

Conversation

Naramsim
Copy link
Member

@Naramsim Naramsim commented Sep 28, 2020

A couple of days ago I came to know that one can compile a JAR using the JDK8 and run it on the JRE11. Apparently, this was a feature of Java since the early days. So this PR enables the usage of the JRE11 which is an LTS version (supported till 2024). To use the JRE11 I had to switch from Alpine to Debian-Slim.

The new JRE offers more stability and I also think performance improvements (new GC G1GC). Maybe all those problems of the GC continuously using the CPU and recycling objects will be gone.


The Docker Compose test here in Travis passed successfully, but still if you want to introduce these new changes I suggest to try and perform some scans before merging.

Ah, I also updated the compose manifest version from 2.0 to 2.4, I don't know why we were using the 2.0. Please check that it does not break anything.


TODOs

  • Tests
  • Documentation

@Naramsim Naramsim added the docker Docker related label Sep 28, 2020
@henrikplate
Copy link
Contributor

I am a little surprised that rest-backend and rest-lib-utils work with JRE11 without the Multi-Release being set. The lack of this manifest file entry caused some trouble recently, cf. #437 and #429

@Naramsim
Copy link
Member Author

Yeah Henrik, I don't really know the issue there with log4j and the multi-release jARs. The other day I also saw that you upgraded to log4j2, maybe that did the trick, I don't know.

I just suggest you try this PR out or try to update your internal images to use the JRE11. If everything works, we are happy, otherwise you can just discard this PR.

@sumeetpatil
Copy link
Contributor

rest-lib-utils fails with the error -

Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
	at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:576) ~[log4j-api-2.13.3.jar!/:2.13.3]
	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:601) ~[log4j-api-2.13.3.jar!/:2.13.3]
	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:588) ~[log4j-api-2.13.3.jar!/:2.13.3]
	at org.eclipse.steady.java.sign.gson.ASTConstructBodySignatureDeserializer.<clinit>(ASTConstructBodySignatureDeserializer.java:45) ~[lang-java-3.1.15-SNAPSHOT.jar!/:na]
	... 126 common frames omitted

I changed the root pom.xml to add the manifest entries but still does not work. The manifest entry for rest-lib-utils has not yet changed. We do not have a Multi-Release entry in the MANIFEST file. We need to check on this.

@sumeetpatil sumeetpatil self-requested a review September 29, 2020 22:06
@sumeetpatil
Copy link
Contributor

rest-backend fails too -

org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:545) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.postgresql.Driver.makeConnection(Driver.java:458) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.postgresql.Driver.connect(Driver.java:260) ~[postgresql-42.2.14.jar!/:42.2.14]
	at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:736) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:668) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:483) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:154) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) ~[tomcat-jdbc-8.5.43.jar!/:na]
	at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51) ~[flyway-core-5.0.7.jar!/:na]
	at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:67) ~[flyway-core-5.0.7.jar!/:na]

I am not sure why this fails. We also get these warnings during startup -

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/vulas/rest-backend.jar!/BOOT-INF/lib/spring-core-4.3.25.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-09-29 22:31:55.786  INFO 8 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$87678a35] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

Found some related issues -

  1. on JDK 11 - WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/.../spring-core/4.3.22.RELEASE/spring-core-4.3.22.RELEASE.jar) spring-projects/spring-framework#22674
  2. https://stackoverflow.com/questions/46671472/illegal-reflective-access-by-org-springframework-cglib-core-reflectutils1

We need more investigation in upgrading the java version to 11 for rest-lib-utils and rest-backend.

@henrikplate
Copy link
Contributor

Alright, thank you @sumeetpatil for checking. I propose to put this on hold for the next few days and look at possible fixes once we finished some other works.

serenaponta and others added 26 commits June 16, 2021 15:35
Update rest-backend and rest-lib-utils to SpringBoot 2.5.1
Updated Jenkins pipeline and underlying Docker image
Updated maven-gpg-plugin and added condition on tag name to trigger deployments on Maven Central
Added timeout to rest_template for Maven Central
Signed-off-by: Alessandro Pezze' <igougi.ui@gmail.com>
Signed-off-by: Alessandro Pezze' <igougi.ui@gmail.com>
@henrikplate
Copy link
Contributor

Hi @Naramsim We will continue with the suggested update to openjdk:11-jre-slim in #484, on the basis of a more recent version of master. Thank you again for your support!

@henrikplate henrikplate deleted the jre11 branch June 22, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Docker related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants