Can a Grails 3 Server be deployed on Tomcat 10? - grails3

I am able to deploy my Grails 3 Server on Tomcat 8.5.x and Tomcat 9 (running Java8).
I can't seem to get it working on Tomcat 10. I'm wondering if it's even possible.
Is there a version matrix with Grails, Tomcat, and Java that someone can point me to?

There is no easy answer to your question.
Grails compatibility with Tomcat depends on Tomcat and Java compatibility, and Grails compatibility with Java in turns depends on Groovy compatibility with Java and also on Spring/SpringBoot compatibility with Java.
Unfortunately, details about this matter tends to be scant, if any, in Grails official documentation.
So let's start putting the pieces together...
Grails - Groovy
To even find out which version of Groovy comes with which version of Grails, sometimes you will have to inspect the Grails package, because that information is not always present in Grails Documentation for every version.
The lib folder in every Grails package includes the Groovy version it depends on. This is from my computer (I have installed 8 different versions of Grails for different projects):
grails/2.2.0/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.0.5.jar
grails/2.3.2/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.1.9.jar
grails/2.3.6/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.1.9.jar
grails/2.4.3/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.3.6.jar
grails/2.5.6/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.4.10.jar
grails/3.3.14/lib/org.codehaus.groovy/groovy/jars/groovy-2.4.21.jar
grails/4.0.12/lib/org.codehaus.groovy/groovy/jars/groovy-2.5.14.jar
grails/4.1.0.M5/lib/org.codehaus.groovy/groovy/jars/groovy-3.0.7.jar
Someone even went to the trouble of compiling and sharing data about the specific version of Groovy included in every version of Grails.
And this is my own summary:
GRAILS Groovy
version version
------- -------
2.0.x 1.8.x
2.1.x 1.8.x
2.2.x 2.0.x
2.3.x 2.1.x
2.4.x 2.3.x
2.5.x 2.4.x
3.x.x 2.4.x
4.0.x 2.5.x
4.1.x 3.0.x
Please note that Grails has been very conservative about its Groovy version transitions. Also note that, as for today (2021-09-28), only beta versions of Grails (namely Grails 4.1.x) supports Groovy 3.x.
Grails - Spring/Spring Boot
Grails dependency on Spring and Spring Boot versions is available in Grails Documentation.
For example, Grails 3.3.14 uses Spring Framework 4.3.9 and Spring Boot 1.5.4. Both of them, Spring 4.3.9 Documentation and Spring Boot 1.5.4 Documentation, recommend Java 8, but also are backward compatible with Java 6 and Java 7.
Again, the lib folder in every Grails package includes the Spring / Spring Boot version it depends on. This is from my computer:
grails/2.2.0/lib/org.springframework/spring-core/jars/spring-core-3.1.2.RELEASE.jar
grails/2.3.2/lib/org.springframework/spring-core/jars/spring-core-3.2.4.RELEASE.jar
grails/2.3.6/lib/org.springframework/spring-core/jars/spring-core-3.2.7.RELEASE.jar
grails/2.4.3/lib/org.springframework/spring-core/jars/spring-core-4.0.6.RELEASE.jar
grails/2.5.6/lib/org.springframework/spring-core/jars/spring-core-4.1.9.RELEASE.jar
grails/3.3.14/lib/org.springframework/spring-core/jars/spring-core-4.3.25.RELEASE.jar
grails/3.3.14/lib/org.springframework.boot/spring-boot/jars/spring-boot-1.5.22.RELEASE.jar
grails/4.0.12/lib/org.springframework/spring-core/jars/spring-core-5.2.3.RELEASE.jar
grails/4.0.12/lib/org.springframework/spring-core/jars/spring-core-5.1.19.RELEASE.jar
grails/4.0.12/lib/org.springframework.boot/spring-boot/jars/spring-boot-2.1.18.RELEASE.jar
grails/4.1.0.M5/lib/org.springframework/spring-core/jars/spring-core-5.3.2.jar
grails/4.1.0.M5/lib/org.springframework.boot/spring-boot/jars/spring-boot-2.4.1.jar
Fortunately, support of Spring and Spring Boot for Java is well documented for every release.
This is my summary:
Spring Spring Supported
GRAILS Framework Boot Java version
------- --------- ------- -------------
2.2.x 3.1.x N/A up to 6
2.3.x 3.2.x N/A up to 7
2.4.x 4.0.x N/A up to 8
2.5.x 4.1.x N/A up to 8
3.0.x 4.1.x 1.2.x up to 8
3.1.x 4.2.x 1.3.x up to 8
3.2.x 4.3.x 1.4.x up to 8
3.3.x 4.3.x 1.5.x up to 8
4.0.x 5.1.x 2.1.x up to 11
4.1.x 5.3.x 2.4.x up to 11
Tomcat - Java
Tomcat has its own compatibility matrix with different Java versions. There you can see that starting 10.1.x Tomcat supports Java 11 and later, but version 10.0.x still supports Java 8.
Groovy - Java
Regarding Groovy compatibility with Java, you will find specific information in the Groovy's Release Notes files. For instance, according to the release notes, Groovy has official support for running on JDK 8 staring Groovy 2.3.
Also according the release notes, apparently Groovy 2.5.x works also with JDK 9/10 and JDK 11, although it has some caveats and instructions for each one; and better support for Java >= 9 were introduced in Groovy 3.0.
This is my summary:
Supported
GRAILS Groovy Java version(*)
------- --------- -------------
2.0.x 1.8.x up to 6
2.1.x 1.8.x up to 6
2.2.x 2.0.x up to 6
2.3.x 2.1.x up to 7
2.4.x 2.3.x up to 8
2.5.x 2.4.x up to 8
3.x.x 2.4.x up to 8
4.0.x 2.5.x up to 9/10/11(**)
4.1.x 3.0.x up to 11+
(*) Supported Java versions is based just on
my understanding of the release notes
(**) There are some caviats in the release notes
Solving the puzzle
Now we have the pieces to solve this puzzle for any specific Grails and Tomcat versions combination.
For example:
Grails 2.4.0 bundles Groovy 2.3 and Spring 4.0
Groovy >= 2.3 has official support for JDK 8
Spring 4.0.x supports up to Java 8
Hence Grails 2.4.0 supports Java 8
Tomcat 9.0.x and 10.0.x supports Java 8 and later
Therefore you can run Grails 2.4.0 on Tomcat 9.0.x and 10.0.x
In your particular case, lets say that you have the latest version of Grails 3.x series: Grails 3.3.14:
Grails 3.3.14 bundles Groovy 2.4.21 and Spring 4.3.25
Groovy 2.4.x supports Java 8, but still lacks enough support for newer Java versions
Spring 4.3.25 supports up to Java 8
Hence Grails 3.3.14 supports Java 8, and probably won't work on Java 11
Tomcat 9.0.x and 10.0.x supports Java 8 and later
Therefore you can run Grails 3.3.14 on Tomcat 9.0.x and 10.0.x, but not on Tomcat >= 10.1.x which requires Java 11 or later
Summary Chart
+---------+---------+-----------+---------+----------------+-------------+
| | Bundled with GRAILS | Max version of | |
| +---------+-----------+---------+ Java supported | Max version |
| | | Spring | Spring | by GRAILS with | of Tomcat |
| GRAILS | Groovy | Framework | Boot | bundled Spring | compatible |
| version | version | version | version | and Groovy (*) | with GRAILS |
+---------+---------+-----------+---------+----------------+-------------+
| 2.0.x | 1.8.x | 3.1.x | N/A | | |
| 2.1.x | 1.8.x | 3.1.x | N/A | up to 6 | 7.0.x |
| 2.2.x | 2.0.x | 3.1.x | N/A | | |
+---------+---------+-----------+---------+----------------+-------------+
| 2.3.x | 2.1.x | 3.2.x | N/A | up to 7 | 8.5.x |
+---------+---------+-----------+---------+----------------+-------------+
| 2.4.x | 2.3.x | 4.0.x | N/A | | |
| 2.5.x | 2.4.x | 4.1.x | N/A | | 9.0.x |
| 3.0.x | 2.4.x | 4.1.x | 1.2.x | up to 8 | and |
| 3.1.x | 2.4.x | 4.2.x | 1.3.x | | 10.0.x |
| 3.2.x | 2.4.x | 4.3.x | 1.4.x | | |
| 3.3.x | 2.4.x | 4.3.x | 1.5.x | | |
+---------+---------+-----------+---------+----------------+-------------+
| 4.0.x | 2.5.x | 5.1.x | 2.1.x | up to 11 (**) | 10.1.x |
+---------+---------+-----------+---------+----------------+-------------+
| 4.1.x | 3.0.x | 5.3.x | 2.4.x | up to 11+ | 10.1.x |
+---------+---------+-----------+---------+----------------+-------------+
Last Updated: 2021-09-29
(*) Supported Java versions is based just on my own understanding
of Groovy and Spring release notes
(**) There are some caviats for JDK 9/10/11 in the release notes
of Groovy 2.5.x

Related

TomEE 8 JDK level

I am trying to find out what is the latest JDK level supported by TomEE 8 or 9. Specifically if JDK 15 will work. The install documentation says only Java 6 or 7 are supported. That seems a bit too old.
The JDK compatibility and support of TomEE is not well documented. The "java compatibility" note in the official documentation is outdated. The Java versions mentioned in the install documentation are an obsolete minimum requirement - propably a copy & paste thingy.
Here is what is known:
TomEE 8.0.9 definitely supports JDK 8, JDK 11, JDK 17
From a short stackoverflow research, for some users JDK 14 or JDK 15 also worked
TomEE 9.x does only support the Jakarta namespace (Jakarta EE 8, Jakarta EE 9.x)
Watch the Release Notes for updates.
According to this documentation page only JDK 8 is supported by TomEE 8.

Is jboss 4.2.2 GA compatible with java 11?

We have a product that is running fine with JBoss 4.2.2/java 7.
We are now moving to JDK 11. simply added java 11 in the classpath and tried starting the server.
Encountered below error
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
-Djava.endorsed.dirs=C:\PathBuilder\GE\EMEA\vp\jboss\lib\endorsed is not supported. Endorsed standards and standalone APIs in modular form
will be supported via the concept of upgradeable modules.
removed below configurations from run.bat and started the server again
-XX:MaxPermSize=128m
"-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%"
now getting below error and which is
interrupting the ear deployment Caused by:
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.omg.CORBA.Object
Is Java 4.2.2 compatible with JDK 11 or we need to update JBoss to 7.2 or latest versions?
can someone help with this or provide related links?
JBoss 4.2 is a very old and outdated version and it only tested with JDK 1.5 and 1.6 version. If you are upgrading your JDK to 11 then you should update the JBoss to 7.3 version which is the latest available GA release from Red Hat.
You can download the jdk files of older versions like jdk6 and then replace JAVA path in the jboss run file from "set JAVA=%JAVA_HOME%\bin\java" to
"set JAVA=C:\Users\jdk1.6.0_45\bin\java"
Of course it's better to upgrade to a higher JBoss version... But in case that's not possible, you can avoid the ClassNotFoundException for org.omg.CORBA.Object by placing rt.jar from Java 8 in your JBoss-libs folder.
With this configuration you can run older JBoss versions with Java 11.

On what version of Java must I run Glassfish 4.1.2?

My understanding is that Java EE 7 runs on Glassfish 4. What version of Java must I use to run Glassfish?
GlassFish 4.x requires Java 7 or Java 8. Java 7 is no longer supported, so Java 8 is recommended.
Page 1-3 of the GlassFish 4 release notes specifies the following:
GlassFish Server Open Source Edition Release 4.1 requires Oracle JDK 7
Update 65 or later, or Oracle JDK 8 Update 20 or later.
https://javaee.github.io/glassfish/doc/4.0/release-notes.pdf

How do I create a SASI Cassandra instance in a Datastax Cluster

Following the SASI creation docs on Datastax (here) for DSE v5.0.4, produces the error:
cqlsh:sandbox> SHOW VERSION
[cqlsh 5.0.1 | Cassandra 3.0.10.1443 | DSE 5.0.4 | CQL spec 3.4.0 | Native protocol v4]
cqlsh:sandbox> CREATE CUSTOM INDEX "sandboxTestIdx" on test (bop) USING 'org.apache.cassandra.index.sasi.SASIIndex';
ConfigurationException: Unable to find custom indexer class 'org.apache.cassandra.index.sasi.SASIIndex'
Digging into SASI shows that it's only available 'out of the box' for Cassandra versions past 3.4, so my question is, how can I add SASI support to the latest version of DSE (v5.0.4)?
I don't think you can unless datastax releases a new version which uses cassandra 3.4 or later.
Or you can use the download the latest version of cassandra which support SASI but then you dont get the DSE features.

JBoss AS 7 is also compatible with JavaEE5?

JBoss AS 7 is also compatible with JavaEE5 ? or I must use JavaEE 6?
I cann't find the document about the compatibiliy.
Yes, for most practical reasons it is compatible. It does not mean that JBoss especially built support for older version, but Java EE 6 itself is more like superset of Java EE 5. As result you can deploy application that uses only features that were available in Java EE 5 to the application server that supports Java EE 6 features.