Then the very first thing to do is stop using the embedded Jetty of GWT 
DevMode as application server. The embedded Jetty in GWT DevMode does some 
ClassLoader hacks and it often causes issues for people using the embedded 
Jetty as application server. That is the reason why GWT 2.11 has deprecated 
the use of embedded Jetty except for demo purposes. If you search for 
"jetty-web.xml" or "jetty-env.xml" on Github GWT issues then you will 
already find some issues with the above stack trace.

So you should find a solution to run a dedicated servlet container (jetty, 
tomcat, etc) that fits your workflow. 

GWT has updated its Getting Started instructions 
(https://www.gwtproject.org/gettingstarted-v2.html) to use the recommended 
project layout and a dedicated servlet container via Maven plugin. The core 
essence is to split the legacy project layout into three projects (client, 
shared, server) with dedicated classpaths and use a build tool to build a 
*.war file (or an exploded war folder) and then deploy this file/folder to 
a dedicated servlet container of your choice. The dedicated servlet 
container can then be configured as you like, usually as closely to your 
production server as possible.

Personally I don't like launching a servlet container via a build tool so I 
use a jetty docker container and a shell script to deploy the webapp.

-- J.

Wejden Mrabti schrieb am Mittwoch, 1. Mai 2024 um 17:09:57 UTC+2:

>
> thank  you @jens for your answer 
>
> I started by  upgrading gwt Only  from version 2.8.2 To 2.10.0 and I kept 
> java 8 .
> I my jetty-env.xml file  i had  org.eclipse.jetty.webapp.WebAppContext as 
> a configurationClass, so It cause fd ollowing error when launching 
> java.lang.ClassNotFoundException: 
> org.eclipse.jetty.webapp.WebAppContext
> at java.lang.ClassLoader.findClass(ClassLoader.java:523)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
> at 
> org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:487)
> at 
> com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.loadClass(JettyLauncher.java:458)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
> at org.eclipse.jetty.util.Loader.loadClass(Loader.java:64)
> at 
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:477)
> at 
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
> at 
> org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:364)
> at 
> org.eclipse.jetty.plus.webapp.EnvConfiguration.lambda$configure$0(EnvConfiguration.java:120)
> at 
> org.eclipse.jetty.webapp.WebAppClassLoader.runWithServerClassAccess(WebAppClassLoader.java:138)
> at 
> org.eclipse.jetty.plus.webapp.EnvConfiguration.configure(EnvConfiguration.java:118)
> at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:498)
> at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409)
> at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:910)
> at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
> at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
> at 
> com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:568)
> at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
> at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
> at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
> at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
> at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
> at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
> at org.eclipse.jetty.server.Server.start(Server.java:423)
> at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
> at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
> at org.eclipse.jetty.server.Server.doStart(Server.java:387)
> at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
> at 
> com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:776)
> at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
> at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:898)
> at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:705)
> at com.google.gwt.dev.DevMode.main(DevMode.java:432)
> Suppressed: java.lang.ClassNotFoundException: 
> org.eclipse.jetty.webapp.WebAppContext
> at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
> at 
> org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:629)
> at 
> org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:511)
> ... 31 more
>
> Le mardi 30 avril 2024 à 10:37:22 UTC+2, Jens a écrit :
>
>> I would first focus on upgrading Java, GWT and possibly GXT if it is 
>> incompatible with newest GWT. The DataSource error will go away once you 
>> upgrade GWT because newer GWT versions use a newer Jetty. Keep in mind that 
>> in newest GWT the use of embedded Jetty as appliction server during 
>> development has been deprecated. It is preferred to use a local jetty 
>> installation, a docker container or launching jetty via a build tool plugin 
>> (maven / gradle).
>>
>> Once you have upgraded to latest GWT you have the possibility to use GWT 
>> 2.11-jakarta if you need to switch to Jakarta.
>>
>> GWT itself only supports Hibernate 4 validation. So if the application 
>> uses Hibernate validation in GWT as well, then you likely need to use 
>> https://gitlab.com/ManfredTremmel/gwt-bean-validators
>>
>> -- J.
>>
>> Wejden Mrabti schrieb am Donnerstag, 25. April 2024 um 15:59:45 UTC+2:
>>
>>> Hello GWT Community,
>>>
>>> I'm currently working on a large legacy application stack, using Java 8, 
>>> Hibernate version 5.3.20.Final, and Hibernate Search 5.11.5.Final. Our 
>>> frontend technology stack includes GWT version 2.8.2 and GXT version 
>>> 2.3.1a-gwt22. Fontend and backend arent well de-coupled.
>>>
>>> In my initial approach to modernize the application, I began by 
>>> migrating Hibernate to version 6.2, assuming it would be the easiest step. 
>>> However, I encountered an issue where Hibernate 6.2 requires transitioning 
>>> to Jakarta Persistence. When attempting to compile parts of my codebase, I 
>>> received the following error:
>>>
>>> java.lang.UnsupportedClassVersionError: jakarta/persistence/Transient 
>>> has been compiled by a more recent version of the Java Runtime (class file 
>>> version 55.0), this version of the Java Runtime only recognizes class file 
>>> versions up to 52.0
>>>
>>> This suggests that I need to execute my code with JDK 11. However, when 
>>> attempting to do so, I encountered the following issue:
>>>
>>> [ERROR] Found resouce but unrecognized URL format: 
>>> 'jrt:/java.sql/javax/sql/DataSource.class' java.lang.NoClassDefFoundError: 
>>> javax/sql/DataSource
>>>
>>> After reviewing your discussions in the GWT contributors group, I'm 
>>> questioning whether starting with the Hibernate migration is the right 
>>> approach. Should I instead prioritize migrating Java or perhaps GWT? I 
>>> would greatly appreciate your insights and advice based on your experiences.
>>>
>>> Thank you,
>>>
>>> WM
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/4998d8f8-67cd-47a5-827c-58a007964a81n%40googlegroups.com.

Reply via email to