MP RestClient issue DuplicateDefinitionException

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MP RestClient issue DuplicateDefinitionException

Ivan Junckes Filho
Hey guys,  I need help with rest client in TomEE.

I am deploying in the same server 2 apps. 

app1 -> Has the client interfaces, but I exclude from the war.
app2 -> Has the client interfaces from app1 in a jar.

I deploy app1 and app2 in the same server and I get the DuplicateDefinitionException.

Any suggestions on what could be?

tomee               | 07-Feb-2019 12:50:09.512 INFO [main] org.apache.webbeans.plugins.PluginLoader.startUp Adding OpenWebBeansPlugin : [CdiPlugin]
tomee               | 07-Feb-2019 12:50:09.839 INFO [main] org.apache.openejb.cdi.CdiScanner.handleBda Using annotated mode for jar:file:/usr/local/tomee/lib/geronimo-config-impl-1.2.1.jar!/META-INF/beans.xml looking all classes to find CDI beans, maybe think to add a beans.xml if not there or add the jar to exclusions.list
tomee               | 07-Feb-2019 12:50:09.847 INFO [main] org.apache.openejb.cdi.CdiScanner.handleBda Using annotated mode for file:/usr/local/tomee/lib/microprofile-rest-client-api-1.1.jar looking all classes to find CDI beans, maybe think to add a beans.xml if not there or add the jar to exclusions.list
tomee               | 07-Feb-2019 12:50:09.977 INFO [main] org.apache.geronimo.config.configsource.PropertyFileConfigSourceProvider.<init> Custom config found by GeronimoConfig. Name: 'META-INF/microprofile-config.properties', URL: 'file:/usr/local/tomee/webapps/crvirtualsiem/WEB-INF/classes/META-INF/microprofile-config.properties'
tomee               | 07-Feb-2019 12:50:10.978 SEVERE [main] org.apache.openejb.cdi.OpenEJBLifecycle.startApplication CDI Beans module deployment failed
tomee               |  org.apache.webbeans.exception.WebBeansConfigurationException: Error while sending SystemEvent to a CDI Extension! org.apache.webbeans.portable.events.discovery.AfterBeanDiscoveryImpl@578dbfa0
tomee               | at org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:735)
tomee               | at org.apache.webbeans.container.BeanManagerImpl.fireEvent(BeanManagerImpl.java:495)
tomee               | at org.apache.webbeans.container.BeanManagerImpl.fireLifecycleEvent(BeanManagerImpl.java:490)
tomee               | at org.apache.webbeans.config.BeansDeployer.fireAfterBeanDiscoveryEvent(BeansDeployer.java:806)
tomee               | at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:320)
tomee               | at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
tomee               | at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:229)
tomee               | at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41)
tomee               | at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:963)
tomee               | at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:756)
tomee               | at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1308)
tomee               | at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1130)
tomee               | at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:134)
tomee               | at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
tomee               | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5007)
tomee               | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
tomee               | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
tomee               | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
tomee               | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
tomee               | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
tomee               | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
tomee               | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
tomee               | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
tomee               | at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
tomee               | at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
tomee               | at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
tomee               | at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
tomee               | at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
tomee               | at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
tomee               | at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
tomee               | at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
tomee               | at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
tomee               | at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
tomee               | at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
tomee               | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
tomee               | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
tomee               | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
tomee               | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
tomee               | at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
tomee               | at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
tomee               | at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
tomee               | at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
tomee               | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
tomee               | at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
tomee               | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
tomee               | at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
tomee               | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
tomee               | at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
tomee               | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
tomee               | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
tomee               | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
tomee               | at java.lang.reflect.Method.invoke(Method.java:498)
tomee               | at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
tomee               | at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
tomee               | Caused by: org.apache.webbeans.exception.WebBeansException: org.apache.webbeans.exception.DuplicateDefinitionException: PassivationCapable bean id is not unique: br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient bean:SiemPessoaJuridicaServiceClient, WebBeansType:THIRDPARTY, Name:br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient, API Types:[br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient], Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any], existing: SiemPessoaJuridicaServiceClient, WebBeansType:THIRDPARTY, Name:br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient, API Types:[br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient], Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any]
tomee               | at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:371)
tomee               | at org.apache.webbeans.event.NotificationManager.invokeObserverMethod(NotificationManager.java:818)
tomee               | at org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:714)
tomee               | ... 53 more
tomee               | Caused by: org.apache.webbeans.exception.DuplicateDefinitionException: PassivationCapable bean id is not unique: br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient bean:SiemPessoaJuridicaServiceClient, WebBeansType:THIRDPARTY, Name:br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient, API Types:[br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient], Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any], existing: SiemPessoaJuridicaServiceClient, WebBeansType:THIRDPARTY, Name:br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient, API Types:[br.com.gbrsistemas.crvirtual.pessoajuridica.SiemPessoaJuridicaServiceClient], Qualifiers:[javax.enterprise.inject.Default,org.eclipse.microprofile.rest.client.inject.RestClient,javax.enterprise.inject.Any]
tomee               | at org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:410)
tomee               | at org.apache.webbeans.container.BeanManagerImpl.addInternalBean(BeanManagerImpl.java:378)
tomee               | at org.apache.webbeans.container.BeanManagerImpl.addBean(BeanManagerImpl.java:351)
tomee               | at org.apache.webbeans.portable.events.discovery.AfterBeanDiscoveryImpl.addBean(AfterBeanDiscoveryImpl.java:203)
tomee               | at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
tomee               | at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
tomee               | at java.util.Iterator.forEachRemaining(Iterator.java:116)
tomee               | at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
tomee               | at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
tomee               | at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
tomee               | at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
tomee               | at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
tomee               | at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
tomee               | at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
tomee               | at org.apache.cxf.microprofile.client.cdi.RestClientExtension.registerClientBeans(RestClientExtension.java:49)
tomee               | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
tomee               | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
tomee               | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
tomee               | at java.lang.reflect.Method.invoke(Method.java:498)
tomee               | at org.apache.webbeans.event.ObserverMethodImpl.invoke(ObserverMethodImpl.java:404)
tomee               | at org.apache.webbeans.event.ContainerEventObserverMethodImpl.invoke(ContainerEventObserverMethodImpl.java:85)
tomee               | at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:365)