It is a server side error, the client is my browser on localhost.

Unfortunately this is not on any form of GIT. Only the (Scala) code is in an SVN repo. I left everything mostly as it as in the Jetty11 code.

This is the code that sets up the SSL connector:

        val sslContextFactory = new SslContextFactory.Server
        sslContextFactory.setRenegotiationAllowed(false)
sslContextFactory.setEndpointIdentificationAlgorithm("HTTPS")
        sslContextFactory.setKeyStorePath(keyStore)
        sslContextFactory.setKeyStorePassword(keyPassword)
        sslContextFactory.setKeyManagerPassword(keyPassword)
        sslContextFactory.setKeyStoreType(keyStoreType)
        sslContextFactory.setEnableOCSP(true)
        sslContextFactory.setSessionCachingEnabled(true)
        sslContextFactory.setSniRequired(true)
        val httpsConfig = new HttpConfiguration
        httpsConfig.setSecureScheme("https")
        httpsConfig.setSecurePort(port)
        httpsConfig.setSendXPoweredBy(false)
        httpsConfig.setSendServerVersion(false)
        httpsConfig.setOutputBufferSize(32768)
        httpsConfig.addCustomizer(new HostHeaderCustomizer)
        httpsConfig.addCustomizer(new SecureRequestCustomizer)
        val http1 = new HttpConnectionFactory(httpsConfig)
        val http2 = new HTTP2ServerConnectionFactory(httpsConfig)
        val alpn = new ALPNServerConnectionFactory
        alpn.setDefaultProtocol(http1.getProtocol)
        val ssl = new SslConnectionFactory(sslContextFactory,alpn.getProtocol)         val http2Connector = new ServerConnector(server,ssl,alpn,http2,http1)
        if (address != null) http2Connector.setHost(address)
        http2Connector.setPort(port)
        http2Connector.setIdleTimeout(1000L * idleTimeout)
        server.addConnector(http2Connector)

This sets up the servlet context:

        val ctx = new ServletContextHandler
        ctx.setContextPath(contextPath)
        val sh = new SessionHandler
        sh.setUsingCookies(false)
sh.setSessionIdPathParameterName(ServletContainer.sessionIdName)
        sh.setMaxInactiveInterval(sessionTimeout)
        ctx.setSessionHandler(sh)
        val holder = new ServletHolder(servletClass)
        val mc = new MultipartConfigElement(System.getProperty("java.io.tmpdir"),uploadLimit,uploadLimit,fileSizeThreshold)
        holder.getRegistration.setMultipartConfig(mc)
        ctx.addServlet(holder,servletPath)

And finally the server:

        val ctxHandler = new ContextHandlerCollection
        ctxHandler.setHandlers(ctx)
        server.setHandler(ctxHandler)

        server.start

My build.sbt (Scala build script that refers to the Maven repo's) contains:

libraryDependencies += "org.eclipse.jetty" % "jetty-core" % "12.0.0"
libraryDependencies += "org.eclipse.jetty" % "jetty-io" % "12.0.0"
libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "12.0.0"
libraryDependencies += "org.eclipse.jetty" % "jetty-alpn-server" % "12.0.0"
libraryDependencies += "org.eclipse.jetty" % "jetty-session" % "12.0.0"
libraryDependencies += "org.eclipse.jetty" % "jetty-rewrite" % "12.0.0"
libraryDependencies += "org.eclipse.jetty.ee10" % "jetty-ee10-servlet" % "12.0.0" libraryDependencies += "org.eclipse.jetty.ee10.websocket" % "jetty-ee10-websocket-jetty-api" % "12.0.0.beta0" libraryDependencies += "org.eclipse.jetty.ee10.websocket" % "jetty-ee10-websocket-jetty-server" % "12.0.0" libraryDependencies += "org.eclipse.jetty.http2" % "jetty-http2-server" % "12.0.0" libraryDependencies += "org.eclipse.jetty.http3" % "jetty-http3-server" % "12.0.0"

(Note the beta0 on the websocket API, there is no released version available yet).

Any suggestions would be greatly appreciated.

Cheers,

Silvio


On 10-08-2023 14:57, Joakim Erdfelt wrote:
Not enough information.

Is that a Client side error? or a Server side error?
How did you initialize either?
Eg: jetty-io should be a server level component if this error is from the Server. Linking to a reproduction project on github would go a long way with our ability to help.

Joakim Erdfelt / joa...@webtide.com


On Thu, Aug 10, 2023 at 7:54 AM Silvio Bierman <sbier...@jambo-software.com> wrote:

    Thanks Joakim,

    This helped a lot. After some tweaking I got the code that sets up
    an embedded server to compile. It even runs and starts a server,
    logs some messages and loads/logs my certificates. But when I send
    a request I get

    2023-08-10 14:47:15.917:WARN
    :oeji.ManagedSelector:qtp1582071873-42: Could not accept
    java.nio.channels.SocketChannel[closed]:
    java.lang.NoClassDefFoundError:
    org/eclipse/jetty/io/ssl/SslConnection$DecryptedEndPoint

    I must be missing some runtime dependency. The class
    org.eclipse.jetty.io.ssl.SslConnection is found during compile
    time (after adding jetty-io). Any suggestions?

    Thanks,

    Silvio


    On 10-08-2023 13:22, Joakim Erdfelt wrote:
    There are 3 jetty-servlet replacements.

    org.eclipse.jetty.ee10:jetty-ee10-servlet - Jakarta EE10 -
    Servlet 6 (jakarta.servlet namespace)
    org.eclipse.jetty.ee9:jetty-ee9-servlet - Jakarta EE9 - Servlet 5
    (jakarta.servlet namespace)
    org.eclipse.jetty.ee8:jetty-ee8-servlet - Jakarta EE8 - Servlet 4
    (javax.servlet namespace)

    Pick the ee# that best suits the needs of your project.

    Joakim Erdfelt / joa...@webtide.com


    On Thu, Aug 10, 2023 at 5:06 AM Silvio Bierman via jetty-users
    <jetty-users@eclipse.org> wrote:

        According to the docs there should be a


        
<dependency><groupId>org.eclipse.jetty</groupId><artifactId>jetty-servlet</artifactId><version>12.0.0</version></dependency>

        but I can not find it anywhere.

        Is that an error in the docs or is the artifact missing from
        the repo?

        Kind regards,

        Silvio



        On 07-08-2023 22:38, Joakim Erdfelt via jetty-users wrote:
        Hello!

        The Jetty team is happy to announce the immediate
        availability of Eclipse Jetty 12.0.0

        This release includes a major change to the structure of Jetty.

          * *Jetty Core*
            This Jetty Server / Jetty Client core, and is now 100%
            free from any specific Jakarta EE technology (such as
            Jakarta Servlet)
            You can use this layer independent of any specific EE
            environment.

          * *Jetty EE Environments *
            We ship with support for 3 environments initially.
            EE10 - Jakarta EE 10 (jakarta.*) - Servlet 6 - JSP 3.1 -
            JSTL 3.0 - WebSocket 2.1
            EE9  - Jakarta EE 9  (jakarta.*) - Servlet 5 - JSP 3.0 -
            JSTL 2.0 - WebSocket 2.0
            EE8  - Jakarta EE 8  (javax.*)   - Servlet 4 - JSP 2.3 -
            JSTL 1.1 - WebSocket 1.1

          * *Jetty Integrations* - where the integration with
            external projects is housed
            NoSql
            Memcached
            Infinispan
            Hazelcast


        The changelog for all releases can be found on
        https://github.com/eclipse/jetty.project/releases

          * https://github.com/eclipse/jetty.project/releases/tag/jetty-12.0.0

        This release is available on the Eclipse Jetty project
        download page or from the Maven Central repository:

          * Eclipse: https://eclipse.dev/jetty/download/
          * Maven Central:
            https://repo1.maven.org/maven2/org/eclipse/jetty/

        Documentation for this release can be found on the Eclipse
        Jetty project site:

          * https://eclipse.dev/jetty/documentation/

        If you find any issues with this release, or if you want to
        suggest future enhancements, please file an issue on the
        Jetty GitHub page

          * https://github.com/eclipse/jetty.project/issues/new

        Commercial production and development support for Jetty is
        offered through Webtide (webtide.com <http://webtide.com>).
        Please contact us for more information or email
        je...@webtide.com to discuss your specific needs.

        Best Regards,
        The Jetty Development Team

        Eclipse Jetty 12.0.0

        _______________________________________________
        jetty-users mailing list
        jetty-users@eclipse.org
        To unsubscribe from this list, 
visithttps://www.eclipse.org/mailman/listinfo/jetty-users

        _______________________________________________
        jetty-users mailing list
        jetty-users@eclipse.org
        To unsubscribe from this list, visit
        https://www.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to