Skip to content

Conversation

@pythys
Copy link
Contributor

@pythys pythys commented Jan 7, 2026

Full migration to jetty 12.1, and EE 11, and all javax to jakarta migrations everywhere. The code and comments and release notes are self explanatory.

Only one bug remains:

Failed startup of context
oeje10w.WebAppContext@2f9a01c1{ROOT,/,b=file:///home/taher/Desktop/active/repositories/fork/moqui-framework/execwartmp/ROOT/webapp/,a=STOPPED,h=oeje10s.SessionHandler@2611b9a3{STOPPED}}{file:/home/taher/Desktop/active/repositories/fork/moqui-framework/moqui.war}
java.lang.IllegalArgumentException: URI is not hierarchical

So we need to find a solution for web.xml being inside the war file
also reintroduce servlet listener that was removed with proper updated
version
In MoquiStart.java, I have this very specific very clear instruction:

webappClass.getMethod("setClassLoader", ClassLoader.class).invoke(webapp, moquiStartLoader);

Yet, in MClassLoader, I added these three lines to debug:

System.out.println("=== MClassLoader constructor ===");
System.out.println("MCL = " + this);
System.out.println("MCL parent = " + parent);

AND, look at the outcome:

=== MClassLoader constructor ===
MCL = org.moqui.util.MClassLoader@77f991c
MCL parent = oejew.WebAppClassLoader{Moqui Root Webapp}@6bea52d4
Starting MClassLoader with parent org.eclipse.jetty.ee.webapp.WebAppClassLoader

Jetty is injecting its WebAppClassLoader even though there is a clear
instruction for it to disregard that class loader. Their API is
confusing at best!

This solution solved classpath problems properly by making MClassLoader
a child of StartClassLoader as intended.
With this fix, moqui runs properly on both embedded mode AND when
deployed on a servlet container. Need to add documentation on how to
test in a servlet container.
Copy link
Member

@acetousk acetousk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall!

Mostly just want to ensure backwards compatibility where possible.

@Override boolean isRequestedSessionIdValid() { return true }
@Override boolean isRequestedSessionIdFromCookie() { return false }
@Override boolean isRequestedSessionIdFromURL() { return false }
@Override boolean isRequestedSessionIdFromUrl() { return false }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there's a bunch of unnecessary function deletions around here:

  • getRealPath etc

Might as well keep them unless there's a good reason to delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever is removed is because it no longer exists. The stub is simply complying with the new signature. You can try to add it and observe the error.

}
@Override void sendError(int i) throws IOException { status = i }
@Override void sendRedirect(String s) throws IOException { logger.info("HttpServletResponseStub sendRedirect to: ${s}") }
@Override void sendRedirect(String s, int i, boolean b) { logger.info("HttpServletResponseStub sendRedirect to: ${s}") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we should keep the old version and call the new with defaults here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a stub simply used for our testing! no one is using it to keep backward compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

framework/src/main/groovy/org/moqui/impl/screen/ScreenTestImpl.groovy:            // create the WebFacadeStub
framework/src/main/groovy/org/moqui/impl/screen/ScreenTestImpl.groovy:            WebFacadeStub wfs = new WebFacadeStub(sti.ecfi, stri.parameters, sti.sessionAttributes, stri.requestMethod)
framework/src/main/groovy/org/moqui/impl/screen/ScreenTestImpl.groovy:                // get the response text from the WebFacadeStub

This is the only place where it's used. And the tests seem to be passing

@Override void recipient(String recipient) throws RejectException { recipientList.add(recipient) }
@Override
void data(InputStream data) throws RejectException, TooMuchDataException, IOException {
String data(InputStream data) throws RejectException, TooMuchDataException, IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems odd to change from void to string just to return null. Is this needed?

Copy link
Contributor Author

@pythys pythys Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change in API signature. I am simply following. We don't "need" to return anything for the mail system to work. But if you have a suggestion then by all means.

MoquiUsernamePasswordValidator(ExecutionContextFactoryImpl ecf) { this.ecf = ecf }
@Override
void login(String username, String password) throws LoginFailedException {
void login(String username, String password, MessageContext messageContext) throws LoginFailedException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add convenience overload here probs.

Copy link
Contributor Author

@pythys pythys Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not calling this? We are complying with subetha new signature. When we upgraded subethasmtp we changed the parent of MoquiUsernamePasswordValidator to be the new org.subethamail.smtp.auth.UsernamePasswordValidator which now requires the context. This is being called externally by the consumer, not by us. This is not internal moqui API, but rather just satisfying an external signature.

@acetousk acetousk merged commit 1991611 into moqui:upgrade Jan 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants