You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andriy Redko (Jira)" <ji...@apache.org> on 2023/09/21 00:02:00 UTC
[jira] [Commented] (CXF-8894) ContextHandler - Unimplemented getRequestCharacterEncoding() - use org.eclipse.jetty.servlet.ServletContextHandler
[ https://issues.apache.org/jira/browse/CXF-8894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17767335#comment-17767335 ]
Andriy Redko commented on CXF-8894:
-----------------------------------
Thanks [~kkarlberg] , historically, the Jetty HTTP transport in CXF has never requited Jetty Servlet as a dependency. But to your point, I think we may hint the transport to use ServletContexHandler if Jetty Servlet is present on classpath but not require it.
> ContextHandler - Unimplemented getRequestCharacterEncoding() - use org.eclipse.jetty.servlet.ServletContextHandler
> ------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-8894
> URL: https://issues.apache.org/jira/browse/CXF-8894
> Project: CXF
> Issue Type: Bug
> Reporter: Karl-Johan Karlberg
> Priority: Major
>
> We are using cxf on embedded jetty and since 3.6.x we have seen a warning log coming:
> {noformat}
> ContextHandler - Unimplemented getRequestCharacterEncoding() - use org.eclipse.jetty.servlet.ServletContextHandler {noformat}
> 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):
> {code:java}
> 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();
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)