Moqui 4.0 Initiative and PRs

Creating this topic to consolidate all my work on upgrading and overhauling moqui to prepare for version 4.0. The highlights are the following

  • I have forked and taken over development of the bitronix transaction manager. I created our first version v4.0.0-BETA1 with massive changees that modernize bitronix and makes it compatible with newer versions of Java (17+)
  • Upgraded moqui in terms of gradle and Java with lots of fixes to both the framework AND the community components. I have detailed the work in the release notes
  • Also deleted the bitronix jar and now depend on the github version (to publish later perhaps to mavenCentral)

I have documented in these links everything including remaining work. Feel free to review.

My pull request for all this work are as follows:

2 Likes

OH I forgot to mention. ElasticSearch must go! It’s incompatible with newer Java, and divergence is happening between elasticsearch and opensearch. It’s better to drop support completely and move to opensearch. I didn’t do any of the work pending discussions first.

1 Like

Let’s talk about this on the next Moqui call for sure.

1 Like

@taher I merged all the PRs into an upgrade branch.

Hi @michael

Thank you, I also created another Testing PR that covers the following:

  • First I enable unit tests, the task was not running due to gradle 9 changes
  • I created convenience methods testComponents (all components) and testAll (everything).
  • I fixed one failing test, however, 14 tests are still failing not to mention component test failures.

Overall I think we should take testing more seriously, fix all tests (some seem to be broken long ago) and we need to automate this to get more confidence out of the code base.

OK on a closer lookup, a significant number of the failing tests hover around caching. These tests start to succeed when I toggle caching. Did we change our cache architecture lately in a way that fails these tests? are the assumptions different? Some code examples that fixes some of the tests:

diff --git a/framework/src/test/groovy/EntityCrud.groovy b/framework/src/test/groovy/EntityCrud.groovy
index 86fc9ab7..da5299ae 100644
--- a/framework/src/test/groovy/EntityCrud.groovy
+++ b/framework/src/test/groovy/EntityCrud.groovy
@@ -122,7 +122,7 @@ class EntityCrud extends Specification {
         }
         EntityList enumsBetween = enumType.findRelatedFk(null)
         enumType.deleteWithCascade(null, null)
-        EntityValue enumTypeAfter = ec.entity.find("moqui.basic.EnumerationType").condition("enumTypeId", "TEST_DEL_ET").one()
+        EntityValue enumTypeAfter = ec.entity.find("moqui.basic.EnumerationType").condition("enumTypeId", "TEST_DEL_ET").useCache(false).one()
         EntityList enumsAfter = enumType.findRelatedFk(null)
 
         then:
diff --git a/framework/src/test/groovy/EntityFindTests.groovy b/framework/src/test/groovy/EntityFindTests.groovy
index 113cdce3..cb479212 100644
--- a/framework/src/test/groovy/EntityFindTests.groovy
+++ b/framework/src/test/groovy/EntityFindTests.groovy
@@ -135,7 +135,7 @@ class EntityFindTests extends Specification {
         ec.entity.find("moqui.test.TestEntity").condition("testNumberInteger", 4321).useCache(true).list()
         ec.entity.makeValue("moqui.test.TestEntity").setAll([testId:"EXTST1", testMedium:"Test Name 2"]).update()
         EntityList testEntityList = ec.entity.find("moqui.test.TestEntity")
-                .condition("testNumberInteger", 4321).useCache(true).list()
+                .condition("testNumberInteger", 4321).useCache(false).list()
 
         then:
         testEntityList.size() == 1
@@ -248,7 +248,7 @@ class EntityFindTests extends Specification {
         EntityValue enumVal = ec.entity.find("moqui.basic.Enumeration").condition("enumId", "DST_PURCHASED_DATA").useCache(false).one()
         enumVal.enumCode = "TEST"
         enumVal.update()
-        long after = ec.entity.find("moqui.basic.Enumeration").condition("enumCode", "is-not-null", null).useCache(true).count()
+        long after = ec.entity.find("moqui.basic.Enumeration").condition("enumCode", "is-not-null", null).useCache(false).count()
 
         // set it back so data isn't funny after tests, and test clear after reset to null
         enumVal.enumCode = null

Another round of PRs that resolves warnings and issues. Still WIP but the project is getting closer to being warning / error free with reasonable overall behavior.

  • framework PR to remove deprecated finalize methods. Nothing needed to replace them, already things are cleaned up elsewhere with autoclosable and try with resources in a few places. I grepped through everything and couldn’t find improper usage, and anyway these finalize methods are unreliable and possibly never called by the garbage collector. Safe to remove IMO
  • mantle braintree PR copy dependencies syntax fix
  • moqui camel PR copy dependencies syntax fix
  • moqui fop PR copy dependencies syntax fix
  • moqui hazelcast PR copy dependencies syntax fix
  • moqui image PR copy dependencies syntax fix
  • moqui orientdb PR copy dependencies syntax fix
  • moqui poi PR copy dependencies syntax fix
  • moqui sftp PR copy dependencies syntax fix
  • moqui sso PR copy dependencies syntax fix
  • moqui wikitext PR copy dependencies syntax fix
  • start PR copy dependencies syntax and also remove java version comment, let framework control
2 Likes

This is the upcoming list of libraries to upgrade. For groovy we need to move away from codehaus to the latest version 5 on the apache domain

The following dependencies have later milestone versions:
 - com.braintreepayments.gateway:braintree-java [2.73.0 -> 3.47.0]
     https://www.braintreegateway.com
 - com.carrotsearch:hppc [0.8.1 -> 0.10.0]
     https://github.com/carrotsearch/hppc
 - com.fasterxml.jackson.core:jackson-databind [2.18.3 -> 2.20.1]
     https://github.com/FasterXML/jackson
 - com.h2database:h2 [2.3.232 -> 2.4.240]
     https://h2database.com
 - com.hazelcast:hazelcast-all [4.0.2 -> 4.2.8]
     http://www.hazelcast.com/
 - com.hierynomus:sshj [0.31.0 -> 0.40.0]
     https://github.com/hierynomus/sshj
 - com.orientechnologies:orientdb-client [3.0.26 -> 3.2.47]
     http://orientdb.dev
 - com.orientechnologies:orientdb-core [3.0.26 -> 3.2.47]
     http://orientdb.dev
 - com.orientechnologies:orientdb-graphdb [3.0.26 -> 3.2.47]
     http://orientdb.dev
 - com.orientechnologies:orientdb-server [3.0.26 -> 3.2.47]
     http://orientdb.dev
 - com.twelvemonkeys.imageio:imageio-batik [3.9.3 -> 3.12.0]
     https://github.com/haraldk/TwelveMonkeys/tree/master/imageio
 - com.twelvemonkeys.imageio:imageio-jpeg [3.9.3 -> 3.12.0]
     https://github.com/haraldk/TwelveMonkeys/tree/master/imageio
 - com.twelvemonkeys.imageio:imageio-tiff [3.9.3 -> 3.12.0]
     https://github.com/haraldk/TwelveMonkeys/tree/master/imageio
 - com.twelvemonkeys.imageio:imageio-webp [3.9.3 -> 3.12.0]
     https://github.com/haraldk/TwelveMonkeys/tree/master/imageio
 - commons-codec:commons-codec [1.18.0 -> 1.20.0]
     https://commons.apache.org/proper/commons-codec/
 - commons-collections:commons-collections [3.2.2 -> 20040616]
 - commons-fileupload:commons-fileupload [1.5 -> 1.6.0]
     https://commons.apache.org/proper/commons-fileupload/
 - commons-io:commons-io [2.18.0 -> 2.21.0]
     https://commons.apache.org/proper/commons-io/
 - commons-validator:commons-validator [1.9.0 -> 1.10.1]
     https://commons.apache.org/proper/commons-validator/
 - joda-time:joda-time [2.13.1 -> 2.14.0]
     https://www.joda.org/joda-time/
 - net.sf.cssbox:cssbox [4.17 -> 5.0.2]
     http://cssbox.sourceforge.net/
 - org.ajoberstar.grgit:org.ajoberstar.grgit.gradle.plugin [5.0.0 -> 5.3.3]
 - org.apache.camel:camel-core [2.22.5 -> 4.16.0]
     https://www.apache.org/
 - org.apache.camel:camel-csv [2.22.5 -> 4.16.0]
     https://www.apache.org/
 - org.apache.camel:camel-freemarker [2.22.5 -> 4.16.0]
     https://www.apache.org/
 - org.apache.camel:camel-groovy [2.22.5 -> 4.16.0]
     https://www.apache.org/
 - org.apache.commons:commons-csv [1.14.0 -> 1.14.1]
     https://commons.apache.org/proper/commons-csv/
 - org.apache.commons:commons-email [1.5 -> 1.6.0]
     https://commons.apache.org/proper/commons-email/
 - org.apache.commons:commons-lang3 [3.18.0 -> 3.20.0]
     https://commons.apache.org/proper/commons-lang/
 - org.apache.httpcomponents:httpclient [4.5.13 -> 4.5.14]
     http://hc.apache.org/httpcomponents-client-ga
 - org.apache.logging.log4j:log4j-api [2.24.3 -> 2.25.2]
     https://logging.apache.org/log4j/2.x/
 - org.apache.logging.log4j:log4j-core [2.24.3 -> 2.25.2]
     https://logging.apache.org/log4j/2.x/
 - org.apache.logging.log4j:log4j-jcl [2.24.3 -> 2.25.2]
     https://logging.apache.org/log4j/2.x/
 - org.apache.logging.log4j:log4j-slf4j2-impl [2.24.3 -> 2.25.2]
     https://logging.apache.org/log4j/2.x/
 - org.apache.pdfbox:pdfbox [3.0.0 -> 3.0.6]
     https://www.apache.org/
 - org.apache.poi:poi [5.2.3 -> 5.5.1]
     https://poi.apache.org/
 - org.apache.poi:poi-ooxml [5.2.3 -> 5.5.1]
     https://poi.apache.org/
 - org.apache.shiro:shiro-core [1.13.0 -> 2.0.6]
     https://shiro.apache.org/
 - org.apache.shiro:shiro-web [1.13.0 -> 2.0.6]
     https://shiro.apache.org/
 - org.apache.sshd:sshd-sftp [2.7.0 -> 2.16.0]
     https://www.apache.org/
 - org.apache.xmlgraphics:batik-constants [1.17 -> 1.19]
     http://xmlgraphics.apache.org/batik/
 - org.apache.xmlgraphics:batik-i18n [1.17 -> 1.19]
     http://xmlgraphics.apache.org/batik/
 - org.apache.xmlgraphics:batik-transcoder [1.17 -> 1.19]
     http://xmlgraphics.apache.org/batik/
 - org.apache.xmlgraphics:fop-core [2.9 -> 2.11]
     http://xmlgraphics.apache.org/fop/
 - org.apache.xmlgraphics:fop-events [2.9 -> 2.11]
     http://xmlgraphics.apache.org/fop/
 - org.apache.xmlgraphics:fop-util [2.9 -> 2.11]
     http://xmlgraphics.apache.org/fop/
 - org.bouncycastle:bcprov-jdk18on [1.75 -> 1.83]
     https://www.bouncycastle.org/download/bouncy-castle-java/
 - org.codehaus.groovy:groovy [3.0.19 -> 3.0.25]
     https://groovy-lang.org
 - org.codehaus.groovy:groovy-dateutil [3.0.19 -> 3.0.25]
     https://groovy-lang.org
 - org.codehaus.groovy:groovy-groovysh [3.0.19 -> 3.0.25]
     https://groovy-lang.org
 - org.codehaus.groovy:groovy-json [3.0.19 -> 3.0.25]
     https://groovy-lang.org
 - org.codehaus.groovy:groovy-templates [3.0.19 -> 3.0.25]
     https://groovy-lang.org
 - org.codehaus.groovy:groovy-xml [3.0.19 -> 3.0.25]
     https://groovy-lang.org
 - org.codehaus.jettison:jettison [1.4.0 -> 1.5.4]
     https://github.com/jettison-json/jettison
 - org.cups4j:cups4j [0.7.6 -> 0.7.9]
     http://cups4j.org
 - org.eclipse.jetty:jetty-client [10.0.25 -> 12.1.5]
     https://jetty.org
 - org.eclipse.jetty:jetty-jndi [10.0.25 -> 12.1.5]
     https://jetty.org
 - org.eclipse.jetty:jetty-proxy [10.0.25 -> 12.1.5]
     https://jetty.org
 - org.eclipse.jetty:jetty-server [10.0.25 -> 12.1.5]
     https://jetty.org
 - org.eclipse.jetty:jetty-webapp [10.0.25 -> 11.0.25]
     https://jetty.org
 - org.eclipse.jetty.websocket:websocket-javax-client [10.0.25 -> 10.0.26]
     https://jetty.org
 - org.eclipse.jetty.websocket:websocket-javax-server [10.0.25 -> 10.0.26]
     https://jetty.org
 - org.eclipse.jetty.websocket:websocket-jetty-server [10.0.25 -> 11.0.26]
     https://jetty.org
 - org.fusesource.jansi:jansi [1.18 -> 2.4.2]
     http://fusesource.github.io/jansi
 - org.gradle-webtools.minify:gradle-minify-plugin [1.3.1 -> 2.1.1]
 - org.gradlewebtools.minify:org.gradlewebtools.minify.gradle.plugin [1.3.2 -> 2.1.1]
 - org.hamcrest:hamcrest-core [2.2 -> 3.0]
     http://hamcrest.org/JavaHamcrest/
 - org.jsoup:jsoup [1.19.1 -> 1.21.2]
     https://jsoup.org/
 - org.junit.jupiter:junit-jupiter-api [5.12.1 -> 6.0.1]
     https://junit.org/
 - org.junit.platform:junit-platform-launcher [1.12.1 -> 6.0.1]
     https://junit.org/
 - org.junit.platform:junit-platform-suite [1.12.1 -> 6.0.1]
     https://junit.org/
 - org.pac4j:pac4j-core [5.7.1 -> 6.3.1]
     https://github.com/pac4j/pac4j
 - org.pac4j:pac4j-javaee [5.7.1 -> 6.3.1]
     https://github.com/pac4j/pac4j
 - org.pac4j:pac4j-oauth [5.7.1 -> 6.3.1]
     https://github.com/pac4j/pac4j
 - org.pac4j:pac4j-oidc [5.7.1 -> 6.3.1]
     https://github.com/pac4j/pac4j
 - org.pac4j:pac4j-saml [5.7.1 -> 6.3.1]
     https://github.com/pac4j/pac4j
 - org.spockframework:spock-bom [2.1-groovy-3.0 -> 2.4-groovy-5.0]
     https://spockframework.org
 - org.spockframework:spock-core [2.1-groovy-3.0 -> 2.4-groovy-5.0]
     https://spockframework.org
 - org.spockframework:spock-junit4 [2.1-groovy-3.0 -> 2.4-groovy-5.0]
     https://spockframework.org
 - org.springframework:spring-core [5.3.29 -> 7.0.2]
     https://github.com/spring-projects/spring-framework
 - org.yaml:snakeyaml [2.4 -> 2.5]
     https://bitbucket.org/snakeyaml/snakeyaml
1 Like

This is merged.

I have a little bit of annoying news. Upgrading to groovy 4 is fine, but groovy 4 is effectively EOL as they started releasing groovy 5. This is is a breaking change everywhere! It sucks, but I think we have to do it, and preferably do it now! Perhaps food for thought in community discussions.

OK here comes a big one:

  • framework PR: Upgraded all libraries with LOTS of work mentioned in the PR including gradle, more java, warnings, cleanups, etc …
  • runtime PR: Centralize dependencyUpdates and adopt newer plugins block format
  • braintree PR Centralize dependencyUpdates and bump braintree-java version
  • camel PR: bump camel to 4.16.0, update APIs and centralize dependencyUpdates #7
  • cups PR: upgrade libraries, cleanup and centralize dependencyUpdates
  • fop PR: This was expceptionally painful, the build.gradle was a maze due to old libraries and problematic dependencies. Anyway it was cleaned up significantly and now a little easier to maintain. All libraries upgraded to latest versions and got many issues solved. Printouts seem to be working good with all stuff like barcodes and whatnot
  • hazelcast PR: bump hazelcast, centralize dependencyUpdates
  • image PR: bump dependencies, centralize dependencyUpdates
  • orientdb PR: bump dependencies, centralize dependencyUpdates
  • poi PR: centralize dependencyUpdates
  • sftp PR: bump libraries and centralize dependencyUpdates
  • sso PR: bump dependencies and fix APIs, centralize dependencyUpdates
  • wikitext PR: centralize dependencyUpdates
  • PopRestStore PR: upgrade minify plugin
  • start PR: centralize dependencyUpdates

Nearly everything upgraded in every corner. The two BIG PAINS are: Groovy & Jetty. Those are going to be more explosive for sure. I upgraded to groovy 4, but the BIG battle is groovy 5

1 Like

can confirm: Apache Groovy | endoflife.date

Wow that sucks

Extremely happy to report that I was able to upgrade to groovy 5! I will submit my PR after processing existing ones. I had nasty bugs that forced me to debug the bytecode using javap. It turns out that @CompileStatic is more strict, and we had code that generated illegal bytecode and it was difficult to debug, but once identified the solution is easy. Take a look at the below to see how cryptic the error was

10:20:00.163  INFO         main .moqui.i.c.ExecutionContextFactoryImpl Running on Java 21.0.2 VM 21.0.2+13-58 Runtime 21.0.2+13-58
Error loading or running Moqui.loadData with args [{load=, types=all}]: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at MoquiStart.main(MoquiStart.java:153)
Caused by: java.util.ServiceConfigurationError: org.moqui.context.ExecutionContextFactory: Provider org.moqui.impl.context.ExecutionContextFactoryImpl could not be instantiated
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
        at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
        at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
        at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
        at org.moqui.Moqui.loadData(Moqui.java:122)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 2 more
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/moqui/impl/context/ExecutionContextFactoryImpl$ComponentInfo.init(Ljava/lang/String;Lorg/moqui/util/MNode;)V @256: invokevirtual
  Reason:
    Type 'org/moqui/impl/context/ExecutionContextFactoryImpl$ComponentInfo' (current frame, stack[0]) is not assignable to 'groovy/lang/Closure'
  Current Frame:
    bci: @256
    flags: { }
    locals: { 'org/moqui/impl/context/ExecutionContextFactoryImpl$ComponentInfo', 'java/lang/String', 'org/moqui/util/MNode', top, 'org/moqui/resource/ResourceReference', 'java/lang/String', 'org/moqui/resource/ResourceReference', 'java/lang/String', 'java/io/File', 'java/lang/String' }
    stack: { 'org/moqui/impl/context/ExecutionContextFactoryImpl$ComponentInfo' }
  Bytecode:
    0000000: 2b59 ba00 4300 0099 0006 a700 1457 2c59
    0000010: 4ec6 000c 2d12 4cb6 0052 a700 0401 2a5f
    0000020: b500 612a b400 6159 c700 0857 03a7 0008
    0000030: ba00 4300 009a 0007 04a7 0004 0399 0010
    0000040: bb00 6359 1265 b700 68c0 006a bf2a b400
    0000050: 6112 6cb6 006f 9901 8b2a b400 61b8 0073
    0000060: 3a04 1904 b600 799a 0007 04a7 0004 0399
    0000070: 0033 bb00 6359 bb00 7b59 04bd 0004 5903
    0000080: 2ab4 0061 5305 bd00 5e59 0312 7d53 5904
    0000090: 127f 53b7 0082 ba00 8500 00b7 0068 c000
    00000a0: 6abf 2ab4 0061 032a b400 61b6 0089 0764
    00000b0: b600 8db8 0090 3a05 1905 b800 733a 0619
    00000c0: 04b6 0093 9900 1719 06b6 0093 9a00 0704
    00000d0: a700 0403 9900 0704 a700 0403 9900 fe19
    00000e0: 04b6 0097 b600 9d08 b600 a03a 07bb 00a2
    00000f0: 5919 07b7 00a3 3a08 1908 b600 a63a 092a
    0000100: b600 acc0 0009 b600 b0ba 00b3 0000 bb00
    0000110: 7b59 05bd 0004 5903 1904 b600 b653 5904
    0000120: 1909 5306 bd00 5e59 0312 b853 5904 12ba
    0000130: 5359 0512 bc53 b700 82ba 0085 0000 b900
    0000140: c102 00bb 00c3 5919 04b6 00c7 b700 ca3a
    0000150: 0a19 0ab6 00ce 3a0b 190b c600 0704 a700
    0000160: 0403 9900 6319 0912 45b8 004b 190b b600
    0000170: d3b8 004b b800 733a 0c19 0cb6 0097 b600
    0000180: 9d08 b600 a03a 0d19 0bb6 00d6 9900 17bb
    0000190: 00a2 5919 0db7 00a3 3a0e 190e b600 d957
    00001a0: a700 16bb 00db 5919 0db7 00dc 3a0f 190a
    00001b0: 190f b800 e257 190a b600 e519 0ab6 00ce
    00001c0: 3a0b a7ff 96a7 0003 190a b600 e8a7 000d
    00001d0: 3a10 190a b600 e819 10bf 1905 2a5f b500
    00001e0: 612a b400 6112 45b6 006f 9900 192a b400
    00001f0: 6103 2ab4 0061 b600 8904 64b6 008d 2a5f
    0000200: b500 612a b400 6112 45b6 00ec 3611 1511
    0000210: 03a2 0007 04a7 0004 0399 0026 2ab4 0040
    0000220: b600 ef12 45b8 004b 2ab4 0061 b800 4b2a
    0000230: 5fb5 0061 2ab4 0061 1245 b600 ec36 112a
    0000240: b400 6115 1104 60b6 00a0 2a5f b500 f112
    0000250: f32a 5fb5 00f5 2ab4 0061 b800 732a 5fb5
    0000260: 00f7 2ab4 00f7 b600 799a 0007 04a7 0004
    0000270: 0399 0033 bb00 6359 bb00 7b59 04bd 0004
    0000280: 5903 2ab4 0061 5305 bd00 5e59 0312 7d53
    0000290: 5904 127f 53b7 0082 ba00 8500 00b7 0068
    00002a0: c000 6abf 2ab4 00f7 b600 939a 0007 04a7
    00002b0: 0004 0399 0033 bb00 6359 bb00 7b59 04bd
    00002c0: 0004 5903 2ab4 0061 5305 bd00 5e59 0312
    00002d0: f953 5904 12bc 53b7 0082 ba00 8500 00b7
    00002e0: 0068 c000 6abf 2ab4 00f7 b600 fa9a 0007
    00002f0: 04a7 0004 0399 0033 bb00 6359 bb00 7b59
    0000300: 04bd 0004 5903 2ab4 0061 5305 bd00 5e59
    0000310: 0312 fc53 5904 12bc 53b7 0082 ba00 8500
    0000320: 00b7 0068 c000 6abf 2ab4 00f7 12fe b601
    0000330: 013a 1219 12b6 0093 9900 0b19 12b8 0105
    0000340: a700 042c 3a13 1913 c600 0704 a700 0403
    0000350: 9900 a719 1313 0106 b600 523a 1419 1459
    0000360: c700 0857 03a7 0008 ba00 4300 0099 000a
    0000370: 1914 2a5f b500 f119 1313 0107 b600 523a
    0000380: 1519 1559 c700 0857 03a7 0008 ba00 4300
    0000390: 0099 000d 1915 b801 0c2a 5fb5 00f5 1913
    00003a0: 1301 0eb6 0111 9900 5119 1313 010e b601
    00003b0: 1559 3a16 c600 0b19 16b6 011b a700 0401
    00003c0: 013a 173a 1819 18c6 0030 1918 b901 2001
    00003d0: 0099 0026 1918 b901 2301 00ba 0126 0000
    00003e0: 3a17 2ab4 0038 1917 1301 06b6 0052 b901
    00003f0: 2c02 0057 a7ff d62a b400 f713 012e b601
    0000400: 013a 1919 19b6 0093 9900 6abb 0130 59b7
    0000410: 0131 1919 b601 34b6 0138 ba00 3100 002a
    0000420: 5fb5 0033 a700 463a 1a2a b600 acc0 0009
    0000430: b600 b0ba 00b3 0000 bb00 7b59 04bd 0004
    0000440: 5903 1919 b601 3b53 05bd 005e 5903 1301
    0000450: 3d53 5904 12bc 53b7 0082 ba00 8500 0019
    0000460: 1ab9 0141 0300 00a7 0003 a700 083a 1b19
    0000470: 1bbf b1
  Exception Handler Table:
    bci [337, 456] => handler: 464
    bci [1035, 1063] => handler: 1063
    bci [1035, 1063] => handler: 1133
    bci [1063, 1127] => handler: 1133
  Stackmap Table:
    same_locals_1_stack_item_frame(@13,Object[#94])
    append_frame(@29,Object[#78])
    full_frame(@30,{Object[#2],Object[#94],Object[#78]},{Object[#94]})
    same_locals_1_stack_item_frame(@48,Object[#94])
    same_locals_1_stack_item_frame(@53,Integer)
    same_frame(@60)
    same_locals_1_stack_item_frame(@61,Integer)
    same_frame(@77)
    append_frame(@110,Top,Object[#117])
    same_locals_1_stack_item_frame(@111,Integer)
    same_frame(@162)
    append_frame(@211,Object[#94],Object[#117])
    same_locals_1_stack_item_frame(@212,Integer)
    same_frame(@219)
    same_locals_1_stack_item_frame(@220,Integer)
    full_frame(@344,{Object[#2],Object[#94],Object[#78],Top,Object[#117],Object[#94],Object[#117],Object[#94],Object[#162],Object[#94],Object[#195],Object[#208]},{})
    same_frame(@353)
    same_locals_1_stack_item_frame(@354,Integer)
    append_frame(@419,Object[#117],Object[#94])
    same_frame(@438)
    chop_frame(@453,2)
    same_frame(@456)
    full_frame(@464,{Object[#2],Object[#94],Object[#78],Top,Object[#117],Object[#94],Object[#117],Object[#94],Object[#162],Object[#94],Object[#195]},{Object[#106]})
    full_frame(@474,{Object[#2],Object[#94],Object[#78],Top,Object[#117],Object[#94],Object[#117]},{})
    full_frame(@481,{Object[#2],Object[#94],Object[#78]},{})
    same_frame(@515)
    full_frame(@536,{Object[#2],Object[#94],Object[#78],Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Integer},{})
    same_locals_1_stack_item_frame(@537,Integer)
    same_frame(@575)
    same_frame(@624)
    same_locals_1_stack_item_frame(@625,Integer)
    same_frame(@676)
    same_frame(@690)
    same_locals_1_stack_item_frame(@691,Integer)
    same_frame(@742)
    same_frame(@756)
    same_locals_1_stack_item_frame(@757,Integer)
    same_frame(@808)
    append_frame(@835,Object[#117])
    same_locals_1_stack_item_frame(@836,Object[#78])
    append_frame(@847,Object[#78])
    same_locals_1_stack_item_frame(@848,Integer)
    full_frame(@872,{Object[#2],Object[#94],Object[#78],Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Integer,Object[#117],Object[#78],Object[#94]},{Object[#94]})
    same_locals_1_stack_item_frame(@877,Integer)
    same_frame(@887)
    full_frame(@908,{Object[#2],Object[#94],Object[#78],Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Integer,Object[#117],Object[#78],Object[#94],Object[#94]},{Object[#94]})
    same_locals_1_stack_item_frame(@913,Integer)
    same_frame(@926)
    append_frame(@959,Object[#279])
    same_locals_1_stack_item_frame(@960,Object[#285])
    append_frame(@970,Object[#78],Object[#285])
    full_frame(@1015,{Object[#2],Object[#94],Object[#78],Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Integer,Object[#117],Object[#78]},{})
    full_frame(@1063,{Object[#2],Object[#94],Object[#78],Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Top,Integer,Object[#117],Object[#78],Top,Top,Top,Top,Top,Object[#117]},{Object[#323]})
    same_frame_extended(@1130)
    same_locals_1_stack_item_frame(@1133,Object[#106])
    same_frame(@1138)

        at org.moqui.impl.context.ExecutionContextFactoryImpl.addComponentDir(ExecutionContextFactoryImpl.groovy:1280)
        at org.moqui.impl.context.ExecutionContextFactoryImpl.initComponents(ExecutionContextFactoryImpl.groovy:371)
        at org.moqui.impl.context.ExecutionContextFactoryImpl.<init>(ExecutionContextFactoryImpl.groovy:211)
        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
        at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
        ... 6 more
2 Likes

OK next round of updates is for groovy 5

framework PR: Fix all bugs fixed, especially around illegal bytecode, and also rewrite groovy shell endpoint as Groovysh was removed in groovy 5.
runtime PR: Update build.gradle syntax, and also since the backend has completely changed for groovy shell, the front-end was also rewritten to both upgrade xterm.js to the latest version AND the frrontend now takes on more responsibility in terms of processing and buffering the text, and only sends full payload when hitting enter.

My expectation was that groovy is going to be the hardest thing. I was so wrong. The biggest pain I’m going through right now is actually upgrading jetty and switching to jakarta. This is the biggest change coming, it is very painful, and it hits many core APIs of moqui.

1 Like

I am very happy to report that I was also able to upgrade Jetty and Jakarta, marking the ā€œlastā€ thing to upgrade and get moqui fully modernized. I had nasty bug around class loaders due to some confusing APIs from jetty that made me go after a wild goose chase. But I was able to pin it down, and we have a working system. There are still fine-tunings and tests to do. But I think this marks the last major milestone.

3 Likes

We just fixed moqui-fop to work with the javax/jakarta upgrade

Ok then, this is by far the biggest PR, hitting many of the core APIs. However, I tested many aspects of the system, classloading, web stack, emails, rest client, etc … and all seem to be working correctly. I also tried to minimize code changes to highlight the differences clearly. The code base is significantly cleaner, many dead weights removed where not needed. Everything is leaner, and nothing was kept beyond what is necessary (by testing). So here goes:

framework PR: This is thousands of lines, many changes, but surprisingly doing very little change beyond upgrading. The big differences are limited to the class loader (mostly MClassLoader) to climb up the hierarchy until it can rearch StartClassLoader. The other significant change is updating all the APIs that switched to modern jakarta versions.

The changes made were tested against both jetty stand-alone, and also jetty as a servlet container, and the system ran fine without problems in either mode, so both deployments were thoroughly tested.

runtime PR minor refactor to switch to jakarta for one class.

example PR minor refactor to switch to jakarta namespace

mantle USL: refactor for fileupload2 which is jakarta based, for the commonly used ā€œFileItemā€

moqui FOP: minor rename to jakarta

WeCreate: Create a build.gradle for this compoennt so that it can carry its own dependency (maybe migrate later) of joda.time given that java now provides an equivalent with java.time. So as part of the cleanup we removed joda.time from framework and the only component requiring it is this one.

After processing these PRs, I will have one more round of upgrades for infrastructure (postgres, mysql, docker, elastic, etc …) and then it’s just a matter of fixing labels, versions, etc and we’ll be ready to launch moqui 4.0

Ah I noticed a PR by @doogie (thank you) equivalent to my PR, so I suggest to take his fix into the code base.

1 Like

Thanks @taher, we were trying to run that MCP bit on these series of changes, and that was just the one small thing that we needed to adjust. Everything else went super smooth.

1 Like

The last and final PR from my side. With this PR, we upgrade all the infrastructure like elasticsearch, postgres, etc into their latest versions.

With this final upgrade, and given enough testing, I would declare us ready for Moqui V4.0

framework PR

I hope everyone in the community can help with testing and thumbs up to give us enough confidence in accelerating the release. Please reply to this thread with your feedback and I will address anything ASAP.

1 Like