You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Arne Limburg (JIRA)" <ji...@apache.org> on 2011/03/24 19:13:06 UTC

[jira] [Created] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

Injection of javax.inject.Provider fails with OWBInjector
---------------------------------------------------------

                 Key: OWB-553
                 URL: https://issues.apache.org/jira/browse/OWB-553
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Injection and Lookup
    Affects Versions: 1.0.0
            Reporter: Arne Limburg
            Assignee: Gurkan Erdogdu
            Priority: Critical


When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Mark Struberg commented on OWB-553:
-----------------------------------

Hi Arne!

Those ThreadLocals get initialized in our WebBeansConfigurationListener and similar startup classes. Please check all our ServletRequestListeners.
The issue might be that you try to request information from the BeanManager _before_ those reqest listeners had any chance to initialize our RequestContext. 
You might check out our ContextsService and trace the call chain.

Please note that our internal Contexts are (due to historic reasons)  different than any Context registered via Extension. The spec pretty late defined that there is exactly 1 Context instance for a given ScopeType. But for our internal Contexts we have n of them. E.g. each Session gets it's own SessionContext, and the management is in our ContextFactory. At the end it doesn't make any difference, so don't get confused by this fact ;)

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Arne Limburg commented on OWB-553:
----------------------------------

Btw it is the injection that causes the NullPointerException not the provider.get()

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Mark Struberg commented on OWB-553:
-----------------------------------

Hi Arne!
Please try to test/patch against the new 1.1.0. We changed a LOT of things in this area :)

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: OWB-553.patch, provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Mark Struberg updated OWB-553:
------------------------------

    Fix Version/s: 1.2.0
         Assignee: Mark Struberg  (was: Gurkan Erdogdu)

There might be some initialisation missing in this case. We did something similar in webbeans-tomcat6 and 7. 
Will look at it in detail for 1.2.0

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Arne Limburg commented on OWB-553:
----------------------------------

Hi Mark,

the ThreadLocal InstanceBean.local seems to contain no value in that case. When you point me in the right direction, maybe I can provide a patch. Where should the local be filled?

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Arne Limburg resolved OWB-553.
------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.2.0)
                   1.1.0

Hi Mark,
seems that you have fixed this already with 1.1.0

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.1.0
>
>         Attachments: OWB-553.patch, provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Arne Limburg updated OWB-553:
-----------------------------

    Attachment: OWB-553.patch

Hi Mark,

I have a patch that works for me. it is against the 1.0.0-tag. And it needs some work to be done, since the methods isInstanceProviderInjection and isEventProviderInjection are copy-pasted from the AbstractInjectable class. They should be moved to somewhere central (WebBeansUtil?).

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Mark Struberg
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: OWB-553.patch, provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OWB-553) Injection of javax.inject.Provider fails with OWBInjector

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

Arne Limburg updated OWB-553:
-----------------------------

    Attachment: provider-bug.zip

Added a test-case (maven-project with JUnit) that demonstrates the problem

> Injection of javax.inject.Provider fails with OWBInjector
> ---------------------------------------------------------
>
>                 Key: OWB-553
>                 URL: https://issues.apache.org/jira/browse/OWB-553
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Arne Limburg
>            Assignee: Gurkan Erdogdu
>            Priority: Critical
>         Attachments: provider-bug.zip
>
>
> When a javax.inject.Provider is injected with the OWBInjector access to provider.get() results in a NullPointerException. The consequence is, that javax.inject.Providers cannot be injected into ServletListeners, Servlets and Filters (tested with Tomcat 6) and EJBs (guessed).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira