[jira] [Commented] (OWB-895) BeforeBeanDiscovery.addAnnotatedType() calls does not work as expected when owb jars are deployed outside WEB-INF/lib folder
[ https://issues.apache.org/jira/browse/OWB-895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13749360#comment-13749360 ] Romain Manni-Bucau commented on OWB-895: Hi Tomee filters jars and classes by app classloader. In all cases having a simple sample would help to dig into it (i guess you have it ;) BeforeBeanDiscovery.addAnnotatedType() calls does not work as expected when owb jars are deployed outside WEB-INF/lib folder Key: OWB-895 URL: https://issues.apache.org/jira/browse/OWB-895 Project: OpenWebBeans Issue Type: Bug Components: Context and Scopes, Injection and Lookup, Java EE Integration Affects Versions: 1.1.8 Environment: Apache Tomee 1.5.2, OpenWebBeans 1.1.8 Reporter: Leonardo Uribe I have been working on the CDI extension points of MyFaces Core 2.2.x, specially the part related to @ViewScoped and @FlowScoped annotations. The solution proposed and committed on the latest snapshot works with weld and openwebbeans. But on the way, I have found a problem when I tried to deploy a demo application in Tomee 1.5.2 MyFaces jars has internally some beans that needs to be registered in CDI: - org.apache.myfaces.flow.cdi.FlowBuilderFactoryBean (deals with @FlowBuilderParameter and @FlowDefinition) - org.apache.myfaces.flow.cdi.FlowScopeBeanHolder (session scope bean that store flow scope) - org.apache.myfaces.cdi.view.ViewScopeBeanHolder (session scope bean that store view scope) And in the classes implementing Extension you can find some code like this to register the beans: void beforeBeanDiscovery( @Observes final BeforeBeanDiscovery event, BeanManager beanManager) { // Register FlowBuilderFactoryBean as a bean with CDI annotations, so the system // can take it into account, and use it later when necessary. AnnotatedType flowDiscoveryHelper = beanManager.createAnnotatedType(FlowBuilderFactoryBean.class); event.addAnnotatedType(flowDiscoveryHelper); } It works well as long as owb jars are located in WEB-INF/lib folder, but in Tomee, MyFaces and OWB jars are located in tomee folder/lib . In theory the code should work but it doesn't. The effect is the application fails because these beans are not registered on CDI environment. Suggestions are welcome. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OWB-895) BeforeBeanDiscovery.addAnnotatedType() calls does not work as expected when owb jars are deployed outside WEB-INF/lib folder
[ https://issues.apache.org/jira/browse/OWB-895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13749461#comment-13749461 ] Romain Manni-Bucau commented on OWB-895: @Mark: scan.xml will not work here + we will not scan myfaces, bval, openjpa but integrate them for perf + avoid issues when using mojarra or hibernate* BeforeBeanDiscovery.addAnnotatedType() calls does not work as expected when owb jars are deployed outside WEB-INF/lib folder Key: OWB-895 URL: https://issues.apache.org/jira/browse/OWB-895 Project: OpenWebBeans Issue Type: Bug Components: Context and Scopes, Injection and Lookup, Java EE Integration Affects Versions: 1.1.8 Environment: Apache Tomee 1.5.2, OpenWebBeans 1.1.8 Reporter: Leonardo Uribe I have been working on the CDI extension points of MyFaces Core 2.2.x, specially the part related to @ViewScoped and @FlowScoped annotations. The solution proposed and committed on the latest snapshot works with weld and openwebbeans. But on the way, I have found a problem when I tried to deploy a demo application in Tomee 1.5.2 MyFaces jars has internally some beans that needs to be registered in CDI: - org.apache.myfaces.flow.cdi.FlowBuilderFactoryBean (deals with @FlowBuilderParameter and @FlowDefinition) - org.apache.myfaces.flow.cdi.FlowScopeBeanHolder (session scope bean that store flow scope) - org.apache.myfaces.cdi.view.ViewScopeBeanHolder (session scope bean that store view scope) And in the classes implementing Extension you can find some code like this to register the beans: void beforeBeanDiscovery( @Observes final BeforeBeanDiscovery event, BeanManager beanManager) { // Register FlowBuilderFactoryBean as a bean with CDI annotations, so the system // can take it into account, and use it later when necessary. AnnotatedType flowDiscoveryHelper = beanManager.createAnnotatedType(FlowBuilderFactoryBean.class); event.addAnnotatedType(flowDiscoveryHelper); } It works well as long as owb jars are located in WEB-INF/lib folder, but in Tomee, MyFaces and OWB jars are located in tomee folder/lib . In theory the code should work but it doesn't. The effect is the application fails because these beans are not registered on CDI environment. Suggestions are welcome. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira