You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "David Jencks (JIRA)" <ji...@apache.org> on 2010/10/22 02:23:17 UTC

[jira] Created: (OWB-481) WebBeansConfigurationListener implementing ServletContextListener is not likely to work

WebBeansConfigurationListener implementing ServletContextListener is not likely to work
---------------------------------------------------------------------------------------

                 Key: OWB-481
                 URL: https://issues.apache.org/jira/browse/OWB-481
             Project: OpenWebBeans
          Issue Type: Bug
            Reporter: David Jencks
            Assignee: Gurkan Erdogdu


Currently WebBeansConfigurationListener implements ServletContextListener and uses the contextInitialized method to initialize OWB for the web app.  Given an application containing a ServletContextListener that is a web bean, this requires that

1. the OWB  WebBeansConfigurationListener ServletContextListener get installed before the app's ServletContextListeners

2. the OWB WebBeansConfigurationListener have it's contextInitialized called before the servlet container instantiates the apps ServletContextListeners that are web beans.

There's no way to guarantee this will happen in a compliant servlet container.  (Neither happens in the geronimo tomcat integration; we could force the first to happen, but not the second).

It might be possible to do the initialization in a ServletContainerInitializer since I think these get called before any application classes start getting instantiated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OWB-481) WebBeansConfigurationListener implementing ServletContextListener is not likely to work

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923960#action_12923960 ] 

David Jencks commented on OWB-481:
----------------------------------

I'd like to suggest that the WebBeansConfigurationListener at least be separated into an almost-certain-to-not-work ServletContextListener and an everything-else-listener that will work.  Currently geronimo has to do this so the WebBeansConfigurationListener doesn't try to re-initialize everything when the ServletContextListener method is called (too late).

> WebBeansConfigurationListener implementing ServletContextListener is not likely to work
> ---------------------------------------------------------------------------------------
>
>                 Key: OWB-481
>                 URL: https://issues.apache.org/jira/browse/OWB-481
>             Project: OpenWebBeans
>          Issue Type: Bug
>            Reporter: David Jencks
>            Assignee: Gurkan Erdogdu
>
> Currently WebBeansConfigurationListener implements ServletContextListener and uses the contextInitialized method to initialize OWB for the web app.  Given an application containing a ServletContextListener that is a web bean, this requires that
> 1. the OWB  WebBeansConfigurationListener ServletContextListener get installed before the app's ServletContextListeners
> 2. the OWB WebBeansConfigurationListener have it's contextInitialized called before the servlet container instantiates the apps ServletContextListeners that are web beans.
> There's no way to guarantee this will happen in a compliant servlet container.  (Neither happens in the geronimo tomcat integration; we could force the first to happen, but not the second).
> It might be possible to do the initialization in a ServletContainerInitializer since I think these get called before any application classes start getting instantiated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OWB-481) WebBeansConfigurationListener implementing ServletContextListener is not likely to work

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gurkan Erdogdu closed OWB-481.
------------------------------

    Resolution: Won't Fix

OWB provides default initializtion process using listener approach. Other container can implement its own solutions. 

> WebBeansConfigurationListener implementing ServletContextListener is not likely to work
> ---------------------------------------------------------------------------------------
>
>                 Key: OWB-481
>                 URL: https://issues.apache.org/jira/browse/OWB-481
>             Project: OpenWebBeans
>          Issue Type: Bug
>            Reporter: David Jencks
>            Assignee: Gurkan Erdogdu
>
> Currently WebBeansConfigurationListener implements ServletContextListener and uses the contextInitialized method to initialize OWB for the web app.  Given an application containing a ServletContextListener that is a web bean, this requires that
> 1. the OWB  WebBeansConfigurationListener ServletContextListener get installed before the app's ServletContextListeners
> 2. the OWB WebBeansConfigurationListener have it's contextInitialized called before the servlet container instantiates the apps ServletContextListeners that are web beans.
> There's no way to guarantee this will happen in a compliant servlet container.  (Neither happens in the geronimo tomcat integration; we could force the first to happen, but not the second).
> It might be possible to do the initialization in a ServletContainerInitializer since I think these get called before any application classes start getting instantiated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OWB-481) WebBeansConfigurationListener implementing ServletContextListener is not likely to work

Posted by "Jakob Korherr (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923803#action_12923803 ] 

Jakob Korherr commented on OWB-481:
-----------------------------------

Note that the ServletContainerInitializer is only available for Servlet 3.0 environments, there is no such thing for Servlet 2.5. In addition you're just moving this problem from the ServletContextListener to the ServletContainerInitializer.

Furthermore I think this is not an OWB problem, but rather a user problem. If the user wants to use OWB in his ServletContextListener(s), he has to make sure that OWB will be initialized at this point of time. We do the same in MyFaces for this problem.

For the Geronimo integration I think it should be possible to call the OWB-initialization code from the Geronimo deployer before any ServletContainerInitializer or ServletContextListener is called in order to circumvent this problem.

> WebBeansConfigurationListener implementing ServletContextListener is not likely to work
> ---------------------------------------------------------------------------------------
>
>                 Key: OWB-481
>                 URL: https://issues.apache.org/jira/browse/OWB-481
>             Project: OpenWebBeans
>          Issue Type: Bug
>            Reporter: David Jencks
>            Assignee: Gurkan Erdogdu
>
> Currently WebBeansConfigurationListener implements ServletContextListener and uses the contextInitialized method to initialize OWB for the web app.  Given an application containing a ServletContextListener that is a web bean, this requires that
> 1. the OWB  WebBeansConfigurationListener ServletContextListener get installed before the app's ServletContextListeners
> 2. the OWB WebBeansConfigurationListener have it's contextInitialized called before the servlet container instantiates the apps ServletContextListeners that are web beans.
> There's no way to guarantee this will happen in a compliant servlet container.  (Neither happens in the geronimo tomcat integration; we could force the first to happen, but not the second).
> It might be possible to do the initialization in a ServletContainerInitializer since I think these get called before any application classes start getting instantiated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.