You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Svetlin Zarev <sv...@gmail.com> on 2017/06/05 09:37:21 UTC
Using non-default JsonProvider
Hi,
If the application brings its own JsonProvider, then
JsonProvider.provider() should return it instead of the default one.
Instead TomEE always returns the default one (Johnzon). The issue is that
JsonProvider.doLoadProvider() returns the first encountered one and does
not check if it's the default, which results in TomEE never loading the
application's JsonProvider
Do you think if this can be worked around ? I can provide PR for the
geronimo-json spec api, but I'm not sure if the project is active.
[1]
http://docs.oracle.com/javaee/7/api/javax/json/spi/JsonProvider.html#provider--
Kind regards,
Svetlin
Re: Using non-default JsonProvider
Posted by Romain Manni-Bucau <rm...@gmail.com>.
PS: pushed it https://issues.apache.org/jira/browse/TOMEE-2052
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>
2017-06-05 11:39 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
> Hi Svetlin,
>
> we can add jsonp in https://github.com/apache/tomee/blob/master/container/
> openejb-core/src/main/java/org/apache/openejb/util/classloader/
> URLClassLoaderFirst.java#L569 list to ensure the behavior you desire work
> (but note we respect the spec in our current behavior). Can be workedaround
> with a custom classloader but fixing this is probably saner.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
>
> 2017-06-05 11:37 GMT+02:00 Svetlin Zarev <sv...@gmail.com>
> :
>
>> Hi,
>>
>> If the application brings its own JsonProvider, then
>> JsonProvider.provider() should return it instead of the default one.
>> Instead TomEE always returns the default one (Johnzon). The issue is that
>> JsonProvider.doLoadProvider() returns the first encountered one and does
>> not check if it's the default, which results in TomEE never loading the
>> application's JsonProvider
>>
>>
>> Do you think if this can be worked around ? I can provide PR for the
>> geronimo-json spec api, but I'm not sure if the project is active.
>>
>> [1]
>> http://docs.oracle.com/javaee/7/api/javax/json/spi/JsonProvi
>> der.html#provider--
>>
>> Kind regards,
>> Svetlin
>>
>
>
Re: Using non-default JsonProvider
Posted by Romain Manni-Bucau <rm...@gmail.com>.
should be done (think our messages were "concurrently sent" :))
PS: if you want to hit johnzon list as well to share why you needed to
switch it can allow to avoid this need (theorically you shouldnt be able to
switch impls in a EE server and if johnzon has a real gap we need to tackle
it)
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>
2017-06-05 12:37 GMT+02:00 Svetlin Zarev <sv...@gmail.com>:
> Hi,
>
> I've tested it and it works like a charm ! may you add johnzon to the
> filter list ?
>
> Thanks and best regards,
> Svetlin
>
> 2017-06-05 12:39 GMT+03:00 Romain Manni-Bucau <rm...@gmail.com>:
>
> > Hi Svetlin,
> >
> > we can add jsonp in
> > https://github.com/apache/tomee/blob/master/container/
> > openejb-core/src/main/java/org/apache/openejb/util/classloader/
> > URLClassLoaderFirst.java#L569
> > list to ensure the behavior you desire work (but note we respect the spec
> > in our current behavior). Can be workedaround with a custom classloader
> but
> > fixing this is probably saner.
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > <https://blog-rmannibucau.rhcloud.com> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
> > <https://javaeefactory-rmannibucau.rhcloud.com>
> >
> > 2017-06-05 11:37 GMT+02:00 Svetlin Zarev <svetlin.angelov.zarev@gmail.
> com
> > >:
> >
> > > Hi,
> > >
> > > If the application brings its own JsonProvider, then
> > > JsonProvider.provider() should return it instead of the default one.
> > > Instead TomEE always returns the default one (Johnzon). The issue is
> that
> > > JsonProvider.doLoadProvider() returns the first encountered one and
> does
> > > not check if it's the default, which results in TomEE never loading
> the
> > > application's JsonProvider
> > >
> > >
> > > Do you think if this can be worked around ? I can provide PR for the
> > > geronimo-json spec api, but I'm not sure if the project is active.
> > >
> > > [1]
> > > http://docs.oracle.com/javaee/7/api/javax/json/spi/
> > > JsonProvider.html#provider--
> > >
> > > Kind regards,
> > > Svetlin
> > >
> >
>
Re: Using non-default JsonProvider
Posted by Svetlin Zarev <sv...@gmail.com>.
Hi,
I've tested it and it works like a charm ! may you add johnzon to the
filter list ?
Thanks and best regards,
Svetlin
2017-06-05 12:39 GMT+03:00 Romain Manni-Bucau <rm...@gmail.com>:
> Hi Svetlin,
>
> we can add jsonp in
> https://github.com/apache/tomee/blob/master/container/
> openejb-core/src/main/java/org/apache/openejb/util/classloader/
> URLClassLoaderFirst.java#L569
> list to ensure the behavior you desire work (but note we respect the spec
> in our current behavior). Can be workedaround with a custom classloader but
> fixing this is probably saner.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
>
> 2017-06-05 11:37 GMT+02:00 Svetlin Zarev <svetlin.angelov.zarev@gmail.com
> >:
>
> > Hi,
> >
> > If the application brings its own JsonProvider, then
> > JsonProvider.provider() should return it instead of the default one.
> > Instead TomEE always returns the default one (Johnzon). The issue is that
> > JsonProvider.doLoadProvider() returns the first encountered one and does
> > not check if it's the default, which results in TomEE never loading the
> > application's JsonProvider
> >
> >
> > Do you think if this can be worked around ? I can provide PR for the
> > geronimo-json spec api, but I'm not sure if the project is active.
> >
> > [1]
> > http://docs.oracle.com/javaee/7/api/javax/json/spi/
> > JsonProvider.html#provider--
> >
> > Kind regards,
> > Svetlin
> >
>
Re: Using non-default JsonProvider
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Svetlin,
we can add jsonp in
https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java#L569
list to ensure the behavior you desire work (but note we respect the spec
in our current behavior). Can be workedaround with a custom classloader but
fixing this is probably saner.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>
2017-06-05 11:37 GMT+02:00 Svetlin Zarev <sv...@gmail.com>:
> Hi,
>
> If the application brings its own JsonProvider, then
> JsonProvider.provider() should return it instead of the default one.
> Instead TomEE always returns the default one (Johnzon). The issue is that
> JsonProvider.doLoadProvider() returns the first encountered one and does
> not check if it's the default, which results in TomEE never loading the
> application's JsonProvider
>
>
> Do you think if this can be worked around ? I can provide PR for the
> geronimo-json spec api, but I'm not sure if the project is active.
>
> [1]
> http://docs.oracle.com/javaee/7/api/javax/json/spi/
> JsonProvider.html#provider--
>
> Kind regards,
> Svetlin
>