You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Thiago Veronezi <th...@veronezi.org> on 2018/07/16 15:03:01 UTC

TOMEE-2201 NPE when injecting Application

Hi guys,

This is the cleaner version of the bug I mentioned last week.
https://github.com/apache/tomee/pull/135

Can you guys help me finding a way to create a unit test for it?

Thanks,
Thiago.

Re: TOMEE-2201 NPE when injecting Application

Posted by Thiago Veronezi <th...@veronezi.org>.
All good. Waiting for the build to pass (or not). Tx Romain.
[]s,
Thiago.

On Mon, Jul 16, 2018 at 1:37 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> https://git-wip-us.apache.org/repos/asf?p=tomee.git;a=blob;
> f=server/openejb-cxf-rs/src/main/java/org/apache/openejb/
> server/cxf/rs/Contexts.java;h=e1a54115070e660581d8e198ee6b7a
> ea20ce64ce;hb=HEAD
>
>
> Ps: please also fix it on branch 8 if not already done
>
>
> Le lun. 16 juil. 2018 19:08, Thiago Veronezi <th...@veronezi.org> a
> écrit :
>
> > "contexts.find"? What do you mean?
> >
> > I was thinking on custom context providers, but that goes to the "
> > ThreadLocalContextManager.PROVIDERS" option.
> > I'm wondering the "ThreadLocalContextManager.OTHERS" is ever (supposed
> to
> > be) used.
> >
> > []s,
> > Thiago.
> >
> >
> >
> > On Mon, Jul 16, 2018 at 12:30 PM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > wrote:
> >
> > > guess the contexts.find in cxf-rs module?
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > > rmannibucau> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <https://www.packtpub.com/application-development/java-
> > > ee-8-high-performance>
> > >
> > >
> > > Le lun. 16 juil. 2018 à 18:11, Thiago Veronezi <th...@veronezi.org> a
> > > écrit :
> > >
> > > > Oh yeah. Tx Romain!
> > > >
> > > > Added a test case for the Application injection. Now I'm trying to
> add
> > > > another case for new the thing being injected is not in the main if
> > chain
> > > > here...
> > > >
> > > >
> > > >                 if (Request.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.REQUEST);
> > > >                 } else if (HttpServletRequest.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_REQUEST);
> > > >                 } else if (ServletRequest.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.SERVLET_REQUEST);
> > > >                 } else if (UriInfo.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.URI_INFO);
> > > >                 } else if (HttpHeaders.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
> > > >                 } else if (SecurityContext.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
> > > >                 } else if (ContextResolver.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
> > > >                 } else if (Providers.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.PROVIDERS);
> > > >                 } else if (ServletConfig.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.SERVLET_CONFIG);
> > > >                 } else if (ServletContext.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.SERVLET_CONTEXT);
> > > >                 } else if (HttpServletResponse.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_RESPONSE);
> > > >                 } else if
> > > > (javax.ws.rs.container.ResourceInfo.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.RESOURCE_INFO);
> > > >                 } else if (ResourceContext.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.RESOURCE_CONTEXT);
> > > >                 } else if (Configuration.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.CONFIGURATION);
> > > >                 } else if (Application.class.equals(type)) {
> > > >                     reference = new
> > > > ObjectReference(ThreadLocalContextManager.APPLICATION);
> > > >                 } else {
> > > >                     reference = new
> > > > MapObjectReference(ThreadLocalContextManager.OTHERS,
> > > > referenceInfo.referenceType);
> > > >                 }
> > > >
> > > > Do you known whats missing there so I can get to the "
> > > > ThreadLocalContextManager.OTHERS" case?
> > > >
> > > > []s,
> > > > Thiago.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Mon, Jul 16, 2018 at 11:33 AM, Romain Manni-Bucau <
> > > > rmannibucau@gmail.com>
> > > > wrote:
> > > >
> > > > > Hi Thiago,
> > > > >
> > > > > you can surely start from
> > > > > https://github.com/apache/tomee/blob/master/server/
> > > > > openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/
> > > > > rs/JSonStreamingOutputTest.java
> > > > > and adapt the endpoint to match you use case?
> > > > >
> > > > > Romain Manni-Bucau
> > > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > > > > rmannibucau> |
> > > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > > <https://www.packtpub.com/application-development/java-
> > > > > ee-8-high-performance>
> > > > >
> > > > >
> > > > > Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <
> thiago@veronezi.org>
> > a
> > > > > écrit :
> > > > >
> > > > > > Hi guys,
> > > > > >
> > > > > > This is the cleaner version of the bug I mentioned last week.
> > > > > > https://github.com/apache/tomee/pull/135
> > > > > >
> > > > > > Can you guys help me finding a way to create a unit test for it?
> > > > > >
> > > > > > Thanks,
> > > > > > Thiago.
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: TOMEE-2201 NPE when injecting Application

Posted by Romain Manni-Bucau <rm...@gmail.com>.
https://git-wip-us.apache.org/repos/asf?p=tomee.git;a=blob;f=server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/Contexts.java;h=e1a54115070e660581d8e198ee6b7aea20ce64ce;hb=HEAD


Ps: please also fix it on branch 8 if not already done


Le lun. 16 juil. 2018 19:08, Thiago Veronezi <th...@veronezi.org> a écrit :

> "contexts.find"? What do you mean?
>
> I was thinking on custom context providers, but that goes to the "
> ThreadLocalContextManager.PROVIDERS" option.
> I'm wondering the "ThreadLocalContextManager.OTHERS" is ever (supposed to
> be) used.
>
> []s,
> Thiago.
>
>
>
> On Mon, Jul 16, 2018 at 12:30 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> wrote:
>
> > guess the contexts.find in cxf-rs module?
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <https://www.packtpub.com/application-development/java-
> > ee-8-high-performance>
> >
> >
> > Le lun. 16 juil. 2018 à 18:11, Thiago Veronezi <th...@veronezi.org> a
> > écrit :
> >
> > > Oh yeah. Tx Romain!
> > >
> > > Added a test case for the Application injection. Now I'm trying to add
> > > another case for new the thing being injected is not in the main if
> chain
> > > here...
> > >
> > >
> > >                 if (Request.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.REQUEST);
> > >                 } else if (HttpServletRequest.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_REQUEST);
> > >                 } else if (ServletRequest.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.SERVLET_REQUEST);
> > >                 } else if (UriInfo.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.URI_INFO);
> > >                 } else if (HttpHeaders.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
> > >                 } else if (SecurityContext.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
> > >                 } else if (ContextResolver.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
> > >                 } else if (Providers.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.PROVIDERS);
> > >                 } else if (ServletConfig.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.SERVLET_CONFIG);
> > >                 } else if (ServletContext.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.SERVLET_CONTEXT);
> > >                 } else if (HttpServletResponse.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_RESPONSE);
> > >                 } else if
> > > (javax.ws.rs.container.ResourceInfo.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.RESOURCE_INFO);
> > >                 } else if (ResourceContext.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.RESOURCE_CONTEXT);
> > >                 } else if (Configuration.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.CONFIGURATION);
> > >                 } else if (Application.class.equals(type)) {
> > >                     reference = new
> > > ObjectReference(ThreadLocalContextManager.APPLICATION);
> > >                 } else {
> > >                     reference = new
> > > MapObjectReference(ThreadLocalContextManager.OTHERS,
> > > referenceInfo.referenceType);
> > >                 }
> > >
> > > Do you known whats missing there so I can get to the "
> > > ThreadLocalContextManager.OTHERS" case?
> > >
> > > []s,
> > > Thiago.
> > >
> > >
> > >
> > >
> > >
> > > On Mon, Jul 16, 2018 at 11:33 AM, Romain Manni-Bucau <
> > > rmannibucau@gmail.com>
> > > wrote:
> > >
> > > > Hi Thiago,
> > > >
> > > > you can surely start from
> > > > https://github.com/apache/tomee/blob/master/server/
> > > > openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/
> > > > rs/JSonStreamingOutputTest.java
> > > > and adapt the endpoint to match you use case?
> > > >
> > > > Romain Manni-Bucau
> > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > > > rmannibucau> |
> > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > <https://www.packtpub.com/application-development/java-
> > > > ee-8-high-performance>
> > > >
> > > >
> > > > Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <th...@veronezi.org>
> a
> > > > écrit :
> > > >
> > > > > Hi guys,
> > > > >
> > > > > This is the cleaner version of the bug I mentioned last week.
> > > > > https://github.com/apache/tomee/pull/135
> > > > >
> > > > > Can you guys help me finding a way to create a unit test for it?
> > > > >
> > > > > Thanks,
> > > > > Thiago.
> > > > >
> > > >
> > >
> >
>

Re: TOMEE-2201 NPE when injecting Application

Posted by Thiago Veronezi <th...@veronezi.org>.
"contexts.find"? What do you mean?

I was thinking on custom context providers, but that goes to the "
ThreadLocalContextManager.PROVIDERS" option.
I'm wondering the "ThreadLocalContextManager.OTHERS" is ever (supposed to
be) used.

[]s,
Thiago.



On Mon, Jul 16, 2018 at 12:30 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> guess the contexts.find in cxf-rs module?
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-
> ee-8-high-performance>
>
>
> Le lun. 16 juil. 2018 à 18:11, Thiago Veronezi <th...@veronezi.org> a
> écrit :
>
> > Oh yeah. Tx Romain!
> >
> > Added a test case for the Application injection. Now I'm trying to add
> > another case for new the thing being injected is not in the main if chain
> > here...
> >
> >
> >                 if (Request.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.REQUEST);
> >                 } else if (HttpServletRequest.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_REQUEST);
> >                 } else if (ServletRequest.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.SERVLET_REQUEST);
> >                 } else if (UriInfo.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.URI_INFO);
> >                 } else if (HttpHeaders.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
> >                 } else if (SecurityContext.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
> >                 } else if (ContextResolver.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
> >                 } else if (Providers.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.PROVIDERS);
> >                 } else if (ServletConfig.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.SERVLET_CONFIG);
> >                 } else if (ServletContext.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.SERVLET_CONTEXT);
> >                 } else if (HttpServletResponse.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_RESPONSE);
> >                 } else if
> > (javax.ws.rs.container.ResourceInfo.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.RESOURCE_INFO);
> >                 } else if (ResourceContext.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.RESOURCE_CONTEXT);
> >                 } else if (Configuration.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.CONFIGURATION);
> >                 } else if (Application.class.equals(type)) {
> >                     reference = new
> > ObjectReference(ThreadLocalContextManager.APPLICATION);
> >                 } else {
> >                     reference = new
> > MapObjectReference(ThreadLocalContextManager.OTHERS,
> > referenceInfo.referenceType);
> >                 }
> >
> > Do you known whats missing there so I can get to the "
> > ThreadLocalContextManager.OTHERS" case?
> >
> > []s,
> > Thiago.
> >
> >
> >
> >
> >
> > On Mon, Jul 16, 2018 at 11:33 AM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > wrote:
> >
> > > Hi Thiago,
> > >
> > > you can surely start from
> > > https://github.com/apache/tomee/blob/master/server/
> > > openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/
> > > rs/JSonStreamingOutputTest.java
> > > and adapt the endpoint to match you use case?
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > > rmannibucau> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <https://www.packtpub.com/application-development/java-
> > > ee-8-high-performance>
> > >
> > >
> > > Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <th...@veronezi.org> a
> > > écrit :
> > >
> > > > Hi guys,
> > > >
> > > > This is the cleaner version of the bug I mentioned last week.
> > > > https://github.com/apache/tomee/pull/135
> > > >
> > > > Can you guys help me finding a way to create a unit test for it?
> > > >
> > > > Thanks,
> > > > Thiago.
> > > >
> > >
> >
>

Re: TOMEE-2201 NPE when injecting Application

Posted by Romain Manni-Bucau <rm...@gmail.com>.
guess the contexts.find in cxf-rs module?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 16 juil. 2018 à 18:11, Thiago Veronezi <th...@veronezi.org> a
écrit :

> Oh yeah. Tx Romain!
>
> Added a test case for the Application injection. Now I'm trying to add
> another case for new the thing being injected is not in the main if chain
> here...
>
>
>                 if (Request.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.REQUEST);
>                 } else if (HttpServletRequest.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_REQUEST);
>                 } else if (ServletRequest.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.SERVLET_REQUEST);
>                 } else if (UriInfo.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.URI_INFO);
>                 } else if (HttpHeaders.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
>                 } else if (SecurityContext.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
>                 } else if (ContextResolver.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
>                 } else if (Providers.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.PROVIDERS);
>                 } else if (ServletConfig.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.SERVLET_CONFIG);
>                 } else if (ServletContext.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.SERVLET_CONTEXT);
>                 } else if (HttpServletResponse.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_RESPONSE);
>                 } else if
> (javax.ws.rs.container.ResourceInfo.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.RESOURCE_INFO);
>                 } else if (ResourceContext.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.RESOURCE_CONTEXT);
>                 } else if (Configuration.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.CONFIGURATION);
>                 } else if (Application.class.equals(type)) {
>                     reference = new
> ObjectReference(ThreadLocalContextManager.APPLICATION);
>                 } else {
>                     reference = new
> MapObjectReference(ThreadLocalContextManager.OTHERS,
> referenceInfo.referenceType);
>                 }
>
> Do you known whats missing there so I can get to the "
> ThreadLocalContextManager.OTHERS" case?
>
> []s,
> Thiago.
>
>
>
>
>
> On Mon, Jul 16, 2018 at 11:33 AM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> wrote:
>
> > Hi Thiago,
> >
> > you can surely start from
> > https://github.com/apache/tomee/blob/master/server/
> > openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/
> > rs/JSonStreamingOutputTest.java
> > and adapt the endpoint to match you use case?
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <https://www.packtpub.com/application-development/java-
> > ee-8-high-performance>
> >
> >
> > Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <th...@veronezi.org> a
> > écrit :
> >
> > > Hi guys,
> > >
> > > This is the cleaner version of the bug I mentioned last week.
> > > https://github.com/apache/tomee/pull/135
> > >
> > > Can you guys help me finding a way to create a unit test for it?
> > >
> > > Thanks,
> > > Thiago.
> > >
> >
>

Re: TOMEE-2201 NPE when injecting Application

Posted by Thiago Veronezi <th...@veronezi.org>.
Oh yeah. Tx Romain!

Added a test case for the Application injection. Now I'm trying to add
another case for new the thing being injected is not in the main if chain
here...


                if (Request.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.REQUEST);
                } else if (HttpServletRequest.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_REQUEST);
                } else if (ServletRequest.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.SERVLET_REQUEST);
                } else if (UriInfo.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.URI_INFO);
                } else if (HttpHeaders.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.HTTP_HEADERS);
                } else if (SecurityContext.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.SECURITY_CONTEXT);
                } else if (ContextResolver.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.CONTEXT_RESOLVER);
                } else if (Providers.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.PROVIDERS);
                } else if (ServletConfig.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.SERVLET_CONFIG);
                } else if (ServletContext.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.SERVLET_CONTEXT);
                } else if (HttpServletResponse.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.HTTP_SERVLET_RESPONSE);
                } else if
(javax.ws.rs.container.ResourceInfo.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.RESOURCE_INFO);
                } else if (ResourceContext.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.RESOURCE_CONTEXT);
                } else if (Configuration.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.CONFIGURATION);
                } else if (Application.class.equals(type)) {
                    reference = new
ObjectReference(ThreadLocalContextManager.APPLICATION);
                } else {
                    reference = new
MapObjectReference(ThreadLocalContextManager.OTHERS,
referenceInfo.referenceType);
                }

Do you known whats missing there so I can get to the "
ThreadLocalContextManager.OTHERS" case?

[]s,
Thiago.





On Mon, Jul 16, 2018 at 11:33 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi Thiago,
>
> you can surely start from
> https://github.com/apache/tomee/blob/master/server/
> openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/
> rs/JSonStreamingOutputTest.java
> and adapt the endpoint to match you use case?
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-
> ee-8-high-performance>
>
>
> Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <th...@veronezi.org> a
> écrit :
>
> > Hi guys,
> >
> > This is the cleaner version of the bug I mentioned last week.
> > https://github.com/apache/tomee/pull/135
> >
> > Can you guys help me finding a way to create a unit test for it?
> >
> > Thanks,
> > Thiago.
> >
>

Re: TOMEE-2201 NPE when injecting Application

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Thiago,

you can surely start from
https://github.com/apache/tomee/blob/master/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/JSonStreamingOutputTest.java
and adapt the endpoint to match you use case?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 16 juil. 2018 à 17:03, Thiago Veronezi <th...@veronezi.org> a
écrit :

> Hi guys,
>
> This is the cleaner version of the bug I mentioned last week.
> https://github.com/apache/tomee/pull/135
>
> Can you guys help me finding a way to create a unit test for it?
>
> Thanks,
> Thiago.
>