Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] servlet not reachable after upgrade to 9.2.4.v20141103

The URL I am using is: https://localhost:8180/Echo/

 

The SessionFilter is being used to capture session related information.  Even if I comment out the SessionFilter, I am not able to reach the “/Echo/” servlet.

 

I am in the process of migrating our use of jetty version 4.2.27 to the latest.  So a lot of this is reading some samples and then lots of trial-and-error.  Any suggestions on how to setup things properly is appreciated?  The interesting thing is that things seems to be working fine with 9.2.3; however, when I switched to 9.2.5 nothing does.

 

I will investigate switching to using the DefaultServlet for the static content.  If you have some sample code or URL that explains this in more detail that would be appreciated.

 

Thank you.

 

From: jetty-users-bounces@xxxxxxxxxxx [mailto:jetty-users-bounces@xxxxxxxxxxx] On Behalf Of Joakim Erdfelt
Sent: Friday, December 05, 2014 5:44 PM
To: JETTY user mailing list
Subject: Re: [jetty-users] servlet not reachable after upgrade to 9.2.4.v20141103

 

What URL are you using?  Be precise.

 

Is AppServlet or SessionFilter using any async processing or async I/O? (if so, you are missing DispatcherType.ASYNC, and also the asyncSupported flags)

 

What does SessionFilter do?

 

What happens if you exclude the Filter?

 

Also, why are you using a ContextHandler for static resources? (Use the DefaultServlet)

 


--

Joakim Erdfelt <joakim@xxxxxxxxxxx>

Expert advice, services and support from from the Jetty & CometD experts

 

On Fri, Dec 5, 2014 at 2:37 PM, Bryan Coleman <bryan.coleman@xxxxxxxx> wrote:

In short, I have an embedded jetty setup working with version 9.2.3.v20140905.  However, when I upgrade to version 9.2.4.v20141103 or 9.2.5.v20141112, the servlet is unreachable.

 

I am running on linux using jdk 1.7.0_71.

 

Here is my code:

 

          server = new Server();

 

            HttpConfiguration https = new HttpConfiguration();

            https.addCustomizer(new SecureRequestCustomizer());

 

            SslContextFactory ssl = new SslContextFactory();

            ssl.setKeyStorePath(getKeyStorePath());

            ssl.setKeyStoreType("JKS");

            ssl.setKeyStorePassword("");

            ssl.setKeyManagerPassword("");

 

            ServerConnector connector = new ServerConnector(server, new SslConnectionFactory(ssl, HttpVersion.HTTP_1_1.toString()), new HttpConnectionFactory(https));

            connector.setPort(port);

            connector.setIdleTimeout(300000);

 

            server.setConnectors(new Connector[]{connector});

 

            HashSessionManager session_manager = new HashSessionManager();

            session_manager.setMaxInactiveInterval(3600);

            session_manager.addEventListener(new HttpSessionListener() {

                public void sessionCreated(HttpSessionEvent event) {

                    // do something                }

 

                public void sessionDestroyed(HttpSessionEvent event) {

                  // do something

                }

            });

 

            SessionHandler session_handler = new SessionHandler(session_manager);

 

            ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);

            context.setHandler(session_handler);

            context.addFilter(new FilterHolder(SessionFilter.class), "/*", EnumSet.of(DispatcherType.INCLUDE, DispatcherType.REQUEST));

            context.setContextPath("/");

            context.addServlet(new ServletHolder(new AppServlet()), "/Test/");

 

            ContextHandler context_static = new ContextHandler();

            context_static.setContextPath("/static");

            context_static.setResourceBase(System.getProperty("user.dir") + File.separator + "static" + File.separator);

            context_static.setHandler(new ResourceHandler());

 

            ContextHandlerCollection contexts = new ContextHandlerCollection();

            contexts.setHandlers(new Handler[]{context, context_static});

            server.setHandler(contexts);

 

            server.start();

 

 

Any ideas?


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

 


Back to the top