Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Issue in migrating from standalone Jetty 10.x to Jetty 12 using EE8

You are not using standalone correctly.

It seems you are instead creating a custom embedded Jetty setup.
Your command line ...
  • doesn't use the standalone core xml.
  • doesn't use the standalone core inis.
  • doesn't use the standalone core jars.
  • doesn't use the standalone configuration of environment jars (the ee8 classloader/classpath)
  • doesn't use the standalone configuration of environment xmls.
Don't just "port" Jetty 10 to Jetty 12, as-is.

Know that starting in Jetty 12, the server is split, core (with no Jakarta EE classes. eg: servlet).
And environments that provide Jakarta EE support (eg: ee8).
This is different from how it was in Jetty 10, where both core and servlet were intermingled.
Your command line would work fine in Jetty 10, but not in Jetty 12, as ee8 needs its own configuration (and classloader configuration).

Do this.
Forget about your overly complex command line. Ignore it for now.
Create a new (empty) jetty-base directory.
Properly configure it using the jetty-base/jetty-home configuration steps.
Enable a small subset, something like `ee8-deploy, ee8-webapp, ee8-annotations, http`
Then put your webapp into the `${jetty.base}/webapps/` directory.
Now, look at the `start.jar --list-config` output.
Next, look at the output of `start.jar --dry-run` (make sure to read the usage of --dry-run on `start.jar --help`)
Finally, look at how org.eclipse.jetty.util.component.Environment is built up from the command line during the normal standalone "main" class.
https://github.com/jetty/jetty.project/blob/jetty-12.1.0.alpha0/jetty-core/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java#L1913

From there, you should be able to see what you need to do to get your custom solution working properly.

Good luck,
- Joakim

On Mon, Dec 2, 2024 at 2:07 AM umesh kudale via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
I am currently migrating my application from standalone Jetty 10.x to Jetty 12.0.15. Since I am using Servlet 4.x, I have configured Jetty 12 with EE8 (for all the Jetty 10 modules I have been using so far, I have enabled corresponding EE8 modules). Here is the command I use to start Jetty:

C:\work\jdk/bin/java -javaagent:C:\work\eService\lib\ext\com.volkhart.memory\measurer.jar -Xms3584m -Xmx3584m -server -classpath C:\work\eService\lib\egpl_classpath_mf.jar -Xrs -XX:+UseStringDeduplication -Xss256K -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\work\eService\logs\ -Dcom.sun.identity.systemconfiguration=com.egain.platform.framework.federation.saml2.FedletConfigManager -XX:+DisableExplicitGC -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:MaxTenuringThreshold=2 -XX:SurvivorRatio=10 -XX:MaxNewSize=768m -XX:NewSize=768m --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.xml/javax.xml.datatype=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp.datatype=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xml.internal.serialize=ALL-UNNAMED --add-opens=java.sql/javax.sql=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED --add-opens=java.desktop/javax.imageio=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED --add-opens=java.rmi/java.rmi=ALL-UNNAMED --add-opens=java.management/java.lang.management=ALL-UNNAMED --add-opens=java.scripting/javax.script=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED -DINSTALL_DIR=C:\work\eService -DINSTALL_DIR_LOCAL=C:\work\eService -Djava.net.preferIPv4Stack=true -Djava.security.policy=C:\work\eService\bin\platform\windows\egpl_system.policy -Djava.rmi.activation.port=15099 -Deg.host.name=ussuhvin0135.egeng.info -Djava.library.path=C:\work\eService\lib\dlls -Deg.is.local.fs=false -Djdk.tls.trustNameService=true -Dorg.bouncycastle.rsa.allow_multi_use=true -Djavax.net.ssl.trustStoreProvider=BCFIPS -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword= -Djdk.tls.client.protocols=TLSv1.2 -Djdk.tls.server.protocols=TLSv1.2 -Dhttps.protocols=TLSv1.2 -Xlog:gc=info,phases=info,age=info,marking=info,ref=info:file=\"C:\work\eService\logs\eg_log_ussuhvin0135.egeng.info_printgc.log\":time,uptime:filecount=100,filesize=5m -Dderby.system.home=C:\work\eService -Dderby.stream.error.file=C:\work\eService\logs -Dapp.http.port=9001 -Dapp.https.port=9001 -Djetty.ssl.port=9001 -Djetty.sslContext.keyStorePath=../../../jks/ussuhvin0135.egeng.info.ks -Djetty.sslContext.trustStorePath=../../jdk/lib/security/cacerts -Djetty.sslContext.provider=BCJSSE -Djetty.sslContext.keyStoreProvider=BCFIPS -Djetty.sslContext.trustStoreProvider=BCFIPS -Dhazelcast.io.selectorMode="selectwithfix" -DSTOP.PORT=15095 -DSTOP.KEY=egain_jetty -Dsun.net.http.allowRestrictedHeaders=true -Djetty.requestlog.loglatency=true -Djetty.console-capture.dir=C:\work\jetty/logs/ -Djetty.requestlog.filePath=../../eService/logs/eg_log_ussuhvin0135.egeng.info_yyyy_mm_dd.request.log -Djetty.http.port=9001 -Djetty.base=C:\work\jetty\jettybase -Dorg.eclipse.jetty.server.Request.maxFormContentSize=2000000000 -Dorg.eclipse.jetty.server.Request.maxFormKeys=10000 -Djetty.httpConfig.forwardedPortAsAuthority=false -Degain.processname=ApplicationServer -Djetty.http.acceptors=8 -Djetty.http.selectors=8 -Djetty.http.acceptQueueSize=250 -Djetty.threadPool.minThreads=10 -Djetty.threadPool.maxThreads=750 -jar C:\work\jetty\start.jar --lib=C:\work\eService\lib\egpl_classpath_mf.jar --debug > out.txt 2>&1 

However, I am getting java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest. The DEBUG output of the above command is attached as out.txt. I can see in the DEBUG output that the jetty servlet api jar is being included as -cp in the command line i.e. -cp C:\work\jetty\lib\jetty-servlet-api-4.0.6.jar. Why is it still giving these exceptions?
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top