-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Http Bridge Dependencies #378
Upgrade Http Bridge Dependencies #378
Conversation
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.http.wrappers</artifactId> | ||
<version>1.0.2</version> | ||
<version>1.0.6</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.1.8 is latest for wrappers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 1.1.8 would cause breaking changes from API perspective (build failure). Therefore, I sticked on 1.0.6, the latest compatible one.
Instead of moving the dependency to 6.1.0, wouldn't it suffice to add the version range in the import package?
|
The intention of the bridge is to run with both servlet 5 and servlet 6. However, servlet 5 needs wrappers 1.0.x and servlet 6 needs wrapper 1.1.x . |
The version range is not defined by the bridge, instead inherited from the wrappers. |
On my side wrappers 1.0.6 is enough and repairs the version range for my purpose. At the moment, the bridge cannot be used for servlet v6 because jakarta.servlet.descriptor limits it to v5, while jakarta.servlet and jakarta.servlet.http are open to v5 and v6. Tomcat 9 is still on javax. |
While it might work, still wrappers 1.0.x is for servlet 5 and 1.1.x is for servlet 6. |
If wrappers 1.0.x are for servlet 5 and 1.1.x is for servlet 6, does the bridge then only support servlet 5 at the moment, not 6? This would not be cool :-( |
As long as you don't use some of the new methods from servlet 6, the bridge will work with servlet 5. As soon as you try to use those methods it will fail if the wrappers are needed during a request. Which means if there is some code relying on javax.servlet. The combination of code using javax.servlet and at the same time using servlet 6 methods is very unlikely to happen, therefore you probably do not notice any problems. But still its possible to fail. |
Just identified that http.proxy is also limited to jakarta servlet 5. When upgrading to 6 only the ServletContextWrapper does not compile which is adapted fast. Summing up, looks like felix http does not support jakarta servlet 6 totally at the moment, only v5 is completely satisfied. 😞 |
@StefanFranzWeiser I updated http proxy and bridge to Jakarta Servlet 6 in 9899d3e . It would be great if you could give it a try |
The updated proxy and bridge works from dependency management. By the way, I saw that the ProxyListener was removed (also mentioned in Tutorials). Was this intended? I changed it to ProxyServletContextListener, hoping everything works as intended. |
Thanks for the feedback. Yes, ProxyListener has been replaced by ProxyServletContextListener |
Solved with new v6.0.0, thx to @cziegeler |
The bridge imports on jakarta.servlet.descriptor avoids to deploy the bridge on Tomcat 11 correctly because Tomcat 11 provides v6.1. All other jakarta dependencies are open to exlude v7, see:
Import-Package: jakarta.servlet;version="[5.0,7)",jakarta.servlet.http ;version="[5.0,7)",org.osgi.service.useradmin;resolution:=optional;ve rsion="[1.1,2)",sun.misc;resolution:=optional,sun.nio.ch;resolution:= optional,jakarta.servlet.descriptor;version="[5.0,6)",java.io,java.la ng,java.lang.invoke,java.lang.ref,java.lang.reflect,java.math,java.ne t,java.nio,java.nio.channels,java.nio.charset,java.nio.file,java.nio.
Upgrading the bridge dependencies fixes the problem. Root cause is the reference on the old wrapper version 1.0.2.