You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2020/07/04 16:53:55 UTC

[GitHub] [myfaces] benkard opened a new pull request #110: Rely on BeanManager to determine whether @FlowScoped is passivating.

benkard opened a new pull request #110:
URL: https://github.com/apache/myfaces/pull/110


   Quarkus does not have passivation and its `BeanManager#isPassivatingScope` implementation therefore always returns `false`.  `FlowScopeBeanHolder` ignores this and assumes that `@FlowScoped` is always passivating (which is presumably true everywhere but Quarkus).  This makes attempts to use `@FlowScoped` beans fail with a `ClassCastException` during `ContextualStorage#getBeanKey`'s attempt to cast the passed bean to `javax.enterprise.inject.spi.PassivationCapable`.
   
   This PR changes `FlowScopeBeanHolder` to not assume that `@FlowScoped` is a passivating scope and to ask the `BeanManager` instead.
   
   This should not affect any CDI implementations other than Quarkus (since `BeanManager.isPassivatingScope(FlowScoped.class)` is expected to return `true` everywhere else), but I have not tested this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] benkard commented on pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
benkard commented on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653812475


   Updated.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] benkard edited a comment on pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
benkard edited a comment on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653800177


   Sure!  That was actually the first thing I did in my local copy and it worked fine, I just thought it’d be preferable to make a more conservative change instead given my unfamiliarity with the code base. :)  I’ll update the PR later. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] benkard commented on pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
benkard commented on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653800177


   Sure!  That was actually the first thing I did in my local copy and it worked fine, I just thought it’d be preferable to do a less intrusive thing instead. :)  I’ll update the PR later. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] tandraschko commented on pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
tandraschko commented on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653859287


   Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] benkard commented on pull request #110: Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
benkard commented on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653796907


   Regarding `@ViewScoped`:
   
   https://github.com/apache/myfaces/blob/02632b043881dac9de46a48ebd8319c1f3255df9/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java#L111
   
   `@ViewScoped` has an explicit `instanceof` check, which is another way of fixing the same problem.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] tandraschko commented on pull request #110: Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
tandraschko commented on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653793454


   AFAIR i fixed such a casting exception in the past, support passivating and non-passivating in the abstractcontext. Can you check this? ViewScoped should have the same problem and works fine.
   
   NOTE: we already need a JIRA ticket for tracking purpose


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] tandraschko merged pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
tandraschko merged pull request #110:
URL: https://github.com/apache/myfaces/pull/110


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] benkard closed pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
benkard closed pull request #110:
URL: https://github.com/apache/myfaces/pull/110


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [myfaces] tandraschko commented on pull request #110: MYFACES-7347 Rely on BeanManager to determine whether @FlowScoped is passivating.

Posted by GitBox <gi...@apache.org>.
tandraschko commented on pull request #110:
URL: https://github.com/apache/myfaces/pull/110#issuecomment-653799514


   OK
   Would be great you can fix it Like viewscoped


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org