Skip to content

GUACAMOLE-1325: Migrate from javax to jakarta namespace.#972

Draft
necouchman wants to merge 2 commits intoapache:nextfrom
necouchman:jira/1325
Draft

GUACAMOLE-1325: Migrate from javax to jakarta namespace.#972
necouchman wants to merge 2 commits intoapache:nextfrom
necouchman:jira/1325

Conversation

@necouchman
Copy link
Contributor

Okay, well, here we go. This PR takes care of the migration from the javax.* namespaces to the new jakarta.* counterparts, updates dependencies, and updates the licenses. I've got it all in a single commit, now, because I couldn't find very clean places to break up the commit - dependency management at this level reminds me of the cat-in-bathtub gif.

The code does compile, I'm able to install it into Tomcat 10.1, and run it, log in (JDBC), and start Guacamole session. It's worth noting that this will be a big change in terms of compatibility:

  • Right now I'm compiling and running with Java 11.x. I have not gone back to test 8.x, yet - I will, here, soon - but there's a reasonable chance that 8.x will no longer work with some of the dependency updates.
  • There were a couple of dependencies that I could not fully update because they required Java 17, and I wasn't willing to push quite to that level of breakage.
  • This completely removes the Websocket support for Jetty8, Jetty9, and Tomcat 7, relying on the standard WebSocket support that should be built in to anything recent.
  • I have not tested with anything besides Tomcat 10.x, yet. I intend to try Tomcat 11, JBoss, and Wildfly, at least.
  • There is likely a decent amount of cleanup to be done, still, both in pom.xml files, and in the doc/licenses directory. I suspect I've left a lot of unused cruft around in getting things updated.
  • I have not tested all of the extensions, yet - just JDBC. I'll try to get to several of them, soon, but there will likely be some I cannot test.
  • I'm unsure about the future of the RADIUS module - I haven't even tried to compile that one, yet, and, given the age of the jRADIUS library, I'm not sure it can live on as it is. We'll can either find a different RADIUS library, write our own (ick, but not too difficult), drop RADIUS support altogether, or see if there are other options for maintaining compatibility with class loading and the deep magic of Java.

I'm going to put this in Draft mode for now - I welcome comments, requests for changes, and testing.

@necouchman
Copy link
Contributor Author

  • Right now I'm compiling and running with Java 11.x. I have not gone back to test 8.x, yet - I will, here, soon - but there's a reasonable chance that 8.x will no longer work with some of the dependency updates.

Well, turns out Tomcat 10 requires Java 11, so that's settled.

@z0rb
Copy link

z0rb commented May 14, 2024

Hi! Thanks a lot for starting this! I've been trying to find time to try it out.
I assume that the maven snapshots didn't land in a maven repository (yet). Should I fork this and build it separately/internally?
The build is failing, should I take anything into account while building?

@necouchman
Copy link
Contributor Author

@z0rb The code has not been merged, so there will be no artifacts or builds with this change, yet. Yes, you will need to clone/patch locally and build yourself to test it out.

@z0rb
Copy link

z0rb commented May 15, 2024

Looks good on Java 17 and Spring-Boot 3.2.5!
Had no problem with guacamole-common (only module I'm using), most migration effort was from Spring Security.

Thanks again! Hope this makes it into main once the open questions @necouchman mentioned are resolved.

@necouchman
Copy link
Contributor Author

Looks good on Java 17 and Spring-Boot 3.2.5! Had no problem with guacamole-common (only module I'm using), most migration effort was from Spring Security.

Thanks again! Hope this makes it into main once the open questions @necouchman mentioned are resolved.

Thank you for testing! It will not go into main, it will go into next, since it is targeted for a future major release (2.0 or something similar). 1.6.0 will be a feature release.

@kilaketia
Copy link

Thanks for the Tomcat10 patch, I've deployed it and the only issue I have is with the OpenID Connect extension that throw this error :

The "openid" authentication provider has been skipped due to an internal error. If this is unexpected or you are the developer of this authentication provider, you may wish to enable debug-level logging: jakarta.ws.rs.ext.RuntimeDelegate: org.glassfish.jersey.internal.RuntimeDelegateImpl not a subtype

Mind you, I've only used guacamole-history-recording-storage / guacamole-auth-sso-openid / guacamole-auth-totp / guacamole-auth-jdbc.

@cRoCx
Copy link

cRoCx commented Apr 15, 2025

I've deployed the Guacamole 1.6.0 from "next" branch as well, but my Tomcat 10 fails to start the guacamole.war.

15-Apr-2025 17:37:16.700 INFO [http-nio-8080-exec-7] org.apache.catalina.core.ApplicationContext.log HTMLManager: start: Starting web application '/guacamole'
15-Apr-2025 17:37:17.979 SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [org.apache.guacamole.GuacamoleServletContextListener]
        java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
                at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
                at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
                at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2350)
                at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2219)
                at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:813)
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1335)
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1183)
                at java.base/java.lang.ClassLoader.defineClass1(Native Method)
                at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
                at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
                at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2350)
                at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2219)
                at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:813)
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1335)
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1183)
                at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:491)
                at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:473)
                at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:143)
                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3935)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4436)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
                at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1283)
                at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:642)
                at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:188)
                at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
                at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
                at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:430)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
                at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
                at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:129)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:598)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
                at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:731)
                at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:663)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
                at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397)
                at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
                at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
                at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
                at java.base/java.lang.Thread.run(Thread.java:840)
        Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1374)
                at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1183)
                ... 56 more
15-Apr-2025 17:37:17.980 SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.StandardContext.listenerStart Skipped installing application listeners due to previous error(s)
15-Apr-2025 17:37:17.985 INFO [http-nio-8080-exec-7] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost'

@necouchman
Copy link
Contributor Author

I've deployed the Guacamole 1.6.0 from "next" branch as well, but my Tomcat 10 fails to start the guacamole.war.

This is fully expected:

  • The 1.6.0 version will not support Tomcat 10 (Jakarta EE).
  • This pull request is still in progress and has not been merged into any of the upstream branches, including the next branch.

@cRoCx
Copy link

cRoCx commented Apr 15, 2025

I read your initial statement ...
I'm able to install it into Tomcat 10.1, and run it, log in (JDBC), and start Guacamole session
... it made me give it a try with Tomcat 10. I was hoping this PR would be the only missing piece to get it up and running on Raspberry Pi OS Bookworm, since all the other containers/install manuals out there for Raspberry Pi OS Bookworm fail / are outdated.

But anyway, I guess I misinterpreted the red "Closed" labels as "Merged" labels, a few posts above. My bad.

@necouchman
Copy link
Contributor Author

I read your initial statement ... I'm able to install it into Tomcat 10.1, and run it, log in (JDBC), and start Guacamole session ... it made me give it a try with Tomcat 10. I was hoping this PR would be the only missing piece to get it up and running on Raspberry Pi OS Bookworm, since all the other containers/install manuals out there for Raspberry Pi OS Bookworm fail / are outdated.

Yes, I was referring to the code from this pull request, not from the main or next branches.

But anyway, I guess I misinterpreted the red "Closed" labels as "Merged" labels, a few posts above. My bad.

That was simply Github letting you know that someone else has mentioned this PR in a request that has been closed. The overall status of this pull request is still Draft and none of this code has been merged, yet. Additionally, it has some conflicts, and so it's going to take some work to get it back to being able to be merged onto the current next branch.

@Kasherpete
Copy link

Hello, I've arrived here as a result of trying to install Guacamole unaware of the Tomcat 10.x incompatibility. I see the pull request aiming to fix this is a few hundred commits behind? Normally I wouldn't mind, but I am wondering if this would be a potential security issue if I wanted to compile it myself, or if there's anything I should be aware of before deploying it for personal use. Thank you!

@necouchman
Copy link
Contributor Author

Hello, I've arrived here as a result of trying to install Guacamole unaware of the Tomcat 10.x incompatibility. I see the pull request aiming to fix this is a few hundred commits behind? Normally I wouldn't mind, but I am wondering if this would be a potential security issue if I wanted to compile it myself, or if there's anything I should be aware of before deploying it for personal use. Thank you!

Yes - this is very much a draft, and a lot of changes were made for the 1.6.0 version that is underway. This will likely not make it into a Guacamole version prior to 2.0.0 because of the incompatible nature of the changes being made (once we merge this, Guacamole will not work with Tomcat versions prior to 10.x).

I wouldn't suggest deploying this in any production or public context.

@cfasnacht
Copy link

cfasnacht commented Jun 5, 2025

@necouchman Thanks for the update, what is your estimate when this PR will be merged? Or 2.0.0 will be released?
At the moment there is no proper way to install guacamole on the latest ubuntu LTS release (24.04)

@necouchman
Copy link
Contributor Author

@necouchman Thanks for the update, what is your estimate when this PR will be merged? Or 2.0.0 will be released? At the moment there is no proper way to install guacamole on the latest ubuntu LTS release (24.04)

There is no time-frame for that release. We're still trying to get 1.6.0 out the door. There will likely be a 1.7.0 feature release in there, and 2.0.0 will involve some fairly significant changes, like this and migration from AngularJS to Angular for the front-end.

@z0rb
Copy link

z0rb commented Jul 13, 2025

FYI I have managed to quick and dirty merge 1.6.0 into this branch and it seems to work well.

@necouchman
Copy link
Contributor Author

Thanks, @z0rb. At some point, soon, I'll try to get this re-based on the current next branch and fix the conflicts. Appreciate the confirmation.

@flyn-org
Copy link

flyn-org commented Jan 9, 2026

For reference, Fedora 43 migrated from Tomcat 9 to 10 (https://fedoraproject.org/wiki/Changes/Tomcat10ChangeProposal). I submitted a bug report to Fedora, which references this pull request (https://bugzilla.redhat.com/show_bug.cgi?id=2428278). The work around is to downgrade to the Fedora 42 Tomcat packages, but I thought it was worth noting this change here.

@necouchman
Copy link
Contributor Author

Hello, all, I have re-based this against the current apache/next branch and validated that it builds successfully. I welcome any testing and feedback on this - I know there are many interested in getting Guacamole working in Tomcat 10.x and higher! I have not loaded it, yet, to test it out, will try to get to that, soon.

@IT-Experte
Copy link
Contributor

I have tested your branch jira/1325 with Tomcat 10.1.52 and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants