ocpsoft / rewrite

OCPsoft URL-Rewriting Framework
http://ocpsoft.org/rewrite/
Apache License 2.0
189 stars 86 forks source link

EE10 Compatible Release #345

Closed poikilotherm closed 1 year ago

poikilotherm commented 2 years ago

This is a follow up to #304 and related to IQSS/dataverse#8305

Trying to get this rolling with Jakarta EE 10 snapshots, I experienced the following problems:

poikilotherm commented 2 years ago

FWIW: @pdurbin made me create a reproducer things fall over with EE 10: https://github.com/poikilotherm/reproducer-payara6-ee10-jsf

lincolnthree commented 2 years ago

Version 6.0.0.Alpha1 with EE10 support has been released and should be in Maven Central soon. Please test and post results!

poikilotherm commented 1 year ago

BTW it looks like 6.0.0 is working for Dataverse as an EE 10 app. Needs more testing, though!

pdurbin commented 1 year ago

@lincolnthree we are testing away! Thanks! Also, I assume you saw that Payara 6 final is out: https://github.com/payara/Payara/releases/tag/payara-server-6.2022.1

poikilotherm commented 1 year ago

@pdurbin I just created https://github.com/ocpsoft/rewrite/pull/359 to update the EE10 branch :smile:

lincolnthree commented 1 year ago

@lincolnthree we are testing away! Thanks! Also, I assume you saw that Payara 6 final is out: https://github.com/payara/Payara/releases/tag/payara-server-6.2022.1

Nice! Congratulations on the release! That's a huge milestone and it looks like you beat WildFly? :D

lincolnthree commented 1 year ago

Also, I think we should consider updating the Rewrite versioning to mirror EE releases going forward.

E.g. EE8 --> Rewrite 8.0.0.Final EE9 --> Rewrite 9.0.0.Final EE10 --> Rewrite 10.0.0.Final

Thoughts?

poikilotherm commented 1 year ago

We could do that if you like it. Dunno if it causes confusion when people see the other releases like 5.0, 6.0 etc on Maven Central. It's your project :smile:

At least we should have a nice little table in the README telling everybody about the compatibility matrix.

rafaelstelles commented 1 year ago

Hi, I started testing version 6.0.0.Alpha1 with Jakarta EE 10, but I used scope "ClientWindowScoped" I received exception below. If used "RequestScope", work normaly. I need configuration some additional ?

Link to my testing: https://github.com/rafaelstelles/jakartaee-faces-sample

11:40:30,634 FATAL [jakarta.enterprise.resource.webcontainer.faces.context] (default task-1) JSF1072: com.ocpsoft.pretty.PrettyException caught during afterPhase() processing of RESTORE_VIEW 1 : UIComponent-ClientId=, Message=PrettyFaces: Exception occurred while processing <rewrite-ample:#{rewriteAction.name}> for URL </rewrite/index.xhtml>
11:40:30,634 FATAL [jakarta.enterprise.resource.webcontainer.faces.context] (default task-1) PrettyFaces: Exception occurred while processing <rewrite-ample:#{rewriteAction.name}> for URL </rewrite/index.xhtml>: com.ocpsoft.pretty.PrettyException: PrettyFaces: Exception occurred while processing <rewrite-ample:#{rewriteAction.name}> for URL </rewrite/index.xhtml>
        at deployment.jakartaee-faces-sample.war//com.ocpsoft.pretty.faces.beans.ParameterInjector.injectPathParams(ParameterInjector.java:96)
        at deployment.jakartaee-faces-sample.war//com.ocpsoft.pretty.faces.beans.ParameterInjector.injectParameters(ParameterInjector.java:54)
        at deployment.jakartaee-faces-sample.war//com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(PrettyPhaseListener.java:102)
        at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:148)
        at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.lifecycle.Phase.doPhase(Phase.java:78)
        at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:95)
        at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:159)
        at jakarta.faces.api//jakarta.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:691)
        at jakarta.faces.api//jakarta.faces.webapp.FacesServlet.service(FacesServlet.java:449)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
        at io.undertow.websocket@2.3.0.Final//io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:172)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.smallrye.opentracing-contrib//io.smallrye.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:69)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at deployment.jakartaee-faces-sample.war//org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at org.wildfly.security.elytron-web.undertow-server@3.0.0.Final//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68)
        at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103)
        at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161)
        at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73)
        at org.wildfly.security.elytron-web.undertow-server@3.0.0.Final//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        at io.undertow.core@2.3.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.core@2.3.0.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
        at io.undertow.core@2.3.0.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        at org.wildfly.security.elytron-web.undertow-server-servlet@3.0.0.Final//org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38)
        at io.undertow.core@2.3.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
        at io.undertow.core@2.3.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
        at io.undertow.core@2.3.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
        at org.wildfly.extension.undertow@27.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
        at io.undertow.servlet@2.3.0.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)
        at io.undertow.core@2.3.0.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:391)
        at io.undertow.core@2.3.0.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at org.jboss.xnio@3.8.8.Final//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: jakarta.el.PropertyNotFoundException: Target Unreachable, identifier 'rewriteAction' resolved to null
        at org.glassfish.expressly@5.0.0//org.glassfish.expressly.parser.AstValue.getTarget(AstValue.java:338)
        at org.glassfish.expressly@5.0.0//org.glassfish.expressly.parser.AstValue.getType(AstValue.java:112)
        at org.glassfish.expressly@5.0.0//org.glassfish.expressly.ValueExpressionImpl.getType(ValueExpressionImpl.java:124)
        at org.jboss.weld.core@5.1.0.Final//org.jboss.weld.module.web.el.WeldValueExpression.getType(WeldValueExpression.java:93)
        at deployment.jakartaee-faces-sample.war//com.ocpsoft.pretty.faces.util.FacesElUtils.getExpectedType(FacesElUtils.java:50)
        at deployment.jakartaee-faces-sample.war//com.ocpsoft.pretty.faces.beans.ParameterInjector.injectPathParams(ParameterInjector.java:79)
        ... 62 more
lincolnthree commented 1 year ago

Hi @rafaelstelles - Thanks for testing the new version, and for providing a sample application that I can debug. I'll look into this and see what I can find out. It's possible that window scoping may have some issues to be worked out.

lincolnthree commented 1 year ago

@rafaelstelles I'm still going to look into this, but could you do me a favor and open a bug/issue for this? Thanks.

rafaelstelles commented 1 year ago

@lincolnthree Of course, I just created issue.

pdurbin commented 1 year ago

@lincolnthree hi! Any plans to put out a non-snapshot release?

We (Dataverse) are currently using these versions:

    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
        <artifactId>rewrite-servlet</artifactId>
        <version>6.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
        <artifactId>rewrite-config-prettyfaces</artifactId>
        <version>6.0.0-SNAPSHOT</version>
    </dependency>

A non-snapshot release is desirable so that it's fixed and final.

We do have a couple bugs that might be related to Rewrite/PrettyFaces. I'm happy to open separate issues if you like!

Overall, we're very happy with the snapshot release and would have been dead in the water without it. THANK YOU! ❤️

lincolnthree commented 1 year ago

Hey @pdurbin Yes! I think we should cut releases now. I will try to do that this week. Thanks for letting me know that the snapshots have been working. I've been a little hesitant to put them out because (a. I'm super busy), but b. I am running a little blind on the new EE versions. Haven't been able to work in EE for a bit sadly :(

lincolnthree commented 1 year ago

Thanks for your support :) And reminders.

pdurbin commented 1 year ago

@lincolnthree that's fine. We're happy to be your guinea pigs. 🐹

We'll probably release soon, I'd say tomorrow at soonest but these things are hard to predict. 😅

We'll take the non-SNAPSHOT whenever you put it out. Thanks!

pdurbin commented 1 year ago

We just released Dataverse 6.0: https://github.com/IQSS/dataverse/releases/tag/v6.0

We're still using the Rewrite SNAPSHOT, of course. @lincolnthree please let us know when when the non-SNAPSHOT is out and we'll switch to it. Thanks and have a great weekend!

rafaelstelles commented 1 year ago

Hi @lincolnthree , any news about the publication of the final version ?

FeanorOfValinor commented 1 year ago

I also wanted to add I've been testing 6.0.0-SNAPSHOT with CDI 4 and Faces 4 on Payara 6.2023.9 and it's working great. I'm also looking forward to a final release. Thank you for your hard work on this!

lincolnthree commented 1 year ago

Working on this right now. Thanks for all of your help & patience!

lincolnthree commented 1 year ago

Update. This has been released as Rewrite version 10.0.0.Final to move in line with the EE spec versioning. I expect it should be in central once the Sonatype sync is run! (Should be tomorrow at latest.)

lincolnthree commented 1 year ago

Actually I think it's live NOW! image

lincolnthree commented 1 year ago

Thanks everyone for their patience and encouragement. This has been a momentous and multi-year effort. Thanks to @pdurbin @codylerum @larsgrefer @poikilotherm and everyone else.

Closing this as COMPLETED!