Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8894

ContextHandler - Unimplemented getRequestCharacterEncoding() - use org.eclipse.jetty.servlet.ServletContextHandler

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.6.3, 4.0.4
    • None
    • None
    • Unknown

    Description

      We are using cxf on embedded jetty and since 3.6.x we have seen a warning log coming:

      ContextHandler - Unimplemented getRequestCharacterEncoding() - use org.eclipse.jetty.servlet.ServletContextHandler 

      This comes from "ContextHandler.StaticContext" in jetty-server (10.x and 11.x)

      As the message suggest it needs to be ServletContexHandler (sitting in jetty-servlet).

      Took a look around in the code and found that the ContextHandler is created in: 
      JettyHTTPHandler#createContextHandler and I find no way to control what kind of context handler is created here. But maybe I missed something. Or something is wrong in our server setup.
       
      Server setup code (also tried a few permutations of this w/o success):

      public static void main(String[] args) {
          LogUtils.setLoggerClass(Slf4jLogger.class);
          Server s2 = startCxfServer(4712);
          System.out.println("Server started");
      }
      private static Server startCxfServer(int port) {
          JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
          sf.setResourceClasses(MyServiceApi.class);
          sf.setResourceProvider(MyServiceApi.class, new SingletonResourceProvider(new MyService()));
          sf.setAddress("http://0.0.0.0:"+port);
          return sf.create();
      } 

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              kkarlberg Karl-Johan Karlberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: