RestClient issue - different apps with same client

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RestClient issue - different apps with same client

ivanjunckes
Hey guys, there is a very annoying bug when using rest client from cxf
3.2.7 in TomEE M2. When 2 apps have the same client the server throws the
error below and shuts down?

Shouldn't we allow different apps in the same server use the same client?

*Error*
Caused by: org.apache.webbeans.exception.WebBeansException:
org.apache.webbeans.exception.DuplicateDefinitionException:
PassivationCapable bean id is not unique:
br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient
bean:SiemClassificacaoServiceClient, WebBeansType:THIRDPARTY,
Name:br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient,
API
Types:[br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient],
Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any],
existing: SiemClassificacaoServiceClient, WebBeansType:THIRDPARTY,
Name:br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient,
API
Types:[br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient],
Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any]
at
org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:371)
at
org.apache.webbeans.event.NotificationManager.invokeObserverMethod(NotificationManager.java:818)
at
org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:714)
... 42 more
Reply | Threaded
Open this post in threaded view
|

Re: RestClient issue - different apps with same client

Daniel Cunha-2
Hi Ivan,

Can you share a sample?

Em ter, 12 de mar de 2019 às 16:34, Ivan Junckes Filho <
[hidden email]> escreveu:

> Hey guys, there is a very annoying bug when using rest client from cxf
> 3.2.7 in TomEE M2. When 2 apps have the same client the server throws the
> error below and shuts down?
>
> Shouldn't we allow different apps in the same server use the same client?
>
> *Error*
> Caused by: org.apache.webbeans.exception.WebBeansException:
> org.apache.webbeans.exception.DuplicateDefinitionException:
> PassivationCapable bean id is not unique:
> br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient
> bean:SiemClassificacaoServiceClient, WebBeansType:THIRDPARTY,
>
> Name:br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient,
> API
>
> Types:[br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient],
>
> Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any],
> existing: SiemClassificacaoServiceClient, WebBeansType:THIRDPARTY,
>
> Name:br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient,
> API
>
> Types:[br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient],
>
> Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any]
> at
>
> org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:371)
> at
>
> org.apache.webbeans.event.NotificationManager.invokeObserverMethod(NotificationManager.java:818)
> at
>
> org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:714)
> ... 42 more
>


--
Daniel "soro" Cunha
https://twitter.com/dvlc_
Reply | Threaded
Open this post in threaded view
|

Re: RestClient issue - different apps with same client

Romain Manni-Bucau
Cxf rest cdi extension leaks beans, think i opened n issue last week or the
week before about it. Dropping the static from the extension fixes that.

Guess it was done as a workaround for ears but probably better to use
another mecanism like the one of deltaspike or just not do it.

Le mar. 12 mars 2019 à 20:46, Daniel Cunha <[hidden email]> a écrit :

> Hi Ivan,
>
> Can you share a sample?
>
> Em ter, 12 de mar de 2019 às 16:34, Ivan Junckes Filho <
> [hidden email]> escreveu:
>
> > Hey guys, there is a very annoying bug when using rest client from cxf
> > 3.2.7 in TomEE M2. When 2 apps have the same client the server throws the
> > error below and shuts down?
> >
> > Shouldn't we allow different apps in the same server use the same client?
> >
> > *Error*
> > Caused by: org.apache.webbeans.exception.WebBeansException:
> > org.apache.webbeans.exception.DuplicateDefinitionException:
> > PassivationCapable bean id is not unique:
> > br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient
> > bean:SiemClassificacaoServiceClient, WebBeansType:THIRDPARTY,
> >
> >
> Name:br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient,
> > API
> >
> >
> Types:[br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient],
> >
> >
> Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any],
> > existing: SiemClassificacaoServiceClient, WebBeansType:THIRDPARTY,
> >
> >
> Name:br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient,
> > API
> >
> >
> Types:[br.com.gbrsistemas.crvirtual.classificacao.SiemClassificacaoServiceClient],
> >
> >
> Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any]
> > at
> >
> >
> org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:371)
> > at
> >
> >
> org.apache.webbeans.event.NotificationManager.invokeObserverMethod(NotificationManager.java:818)
> > at
> >
> >
> org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:714)
> > ... 42 more
> >
>
>
> --
> Daniel "soro" Cunha
> https://twitter.com/dvlc_
>
Reply | Threaded
Open this post in threaded view
|

Re: RestClient issue - different apps with same client

j4fm
Reply | Threaded
Open this post in threaded view
|

Re: RestClient issue - different apps with same client

ivanjunckes
Thanks Romain, I will see if I can fix this.

On Tue, Mar 12, 2019 at 6:01 PM j4fm <[hidden email]> wrote:

> https://issues.apache.org/jira/browse/CXF-7980
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>