Hi

Yes it works but you must not start twice openwebbeans (1. meecrowave, 2.
in your web.xml
with org.apache.webbeans.servlet.WebBeansConfigurationListener). Also drop
OWB from your app and the API jars which are alsoready provided (should
never be in a container by spec even if we tolerate it.
You will also need to
declare org.apache.myfaces.webapp.StartupServletContextListener.

I don't know tobago enough to help more but it should enable you to get
started I hope.


Le 3 févr. 2018 20:16, "Dennis Kieselhorst" <d...@apache.org> a écrit :

Hi,

is it possible to run meecrowave with a JSF MyFaces application? I always
get a DuplicateDefinitionException.

[ERROR][           main][rBase.[Tomcat].[localhost].[/]] Exception sending
context initialized event to listener instance of class
[org.apache.webbeans.servlet.WebBeansConfigurationListener]
org.apache.webbeans.exception.DuplicateDefinitionException:
PassivationCapable bean id is not unique: SERVLET_CONTEXT#interface
javax.servlet.ServletContext#@javax.enterprise.inject.Defaul
t(),@javax.enterprise.inject.Any(), bean:ServletContext,
WebBeansType:SERVLET_CONTEXT, Name:null, API
Types:[java.lang.Object,javax.servlet.ServletContext],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]
        at 
org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:410)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at 
org.apache.webbeans.container.BeanManagerImpl.addInternalBean(BeanManagerImpl.java:364)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.star
tApplication(WebContainerLifecycle.java:90) ~[openwebbeans-web-2.0.3.jar:2
.0.3]
        at org.apache.webbeans.servlet.WebBeansConfigurationListener.co
ntextInitialized(WebBeansConfigurationListener.java:85)
~[openwebbeans-web-2.0.3.jar:2.0.3]

Reproducible with https://github.com/apache/myfa
ces-tobago/tree/master/tobago-example/tobago-example-demo by running mvn
clean package meecrowave:run -Djsf=myfaces-2.2

If I simplify the example and try it without Tobago with plain MyFaces it
results in:
Caused by: org.apache.webbeans.exception.DuplicateDefinitionException:
PassivationCapable bean id is not unique: PRODUCERMETHOD#class
javax.faces.flow.builder.FlowBuilder#@javax.faces.flow.builder.Flow
BuilderParameter(),@javax.enterprise.inject.Any(),#public
javax.faces.flow.builder.FlowBuilder org.apache.myfaces.flow.cdi.Fl
owBuilderFactoryBean.createFlowBuilderInstance() bean:FlowBuilder, WebBeansT
ype:PRODUCERMETHOD, Name:null, API Types:[javax.faces.flow.builde
r.FlowBuilder,java.lang.Object], Qualifiers:[javax.faces.flow.b
uilder.FlowBuilderParameter,javax.enterprise.inject.Any], Producer Method
: public javax.faces.flow.builder.FlowBuilder org.apache.myfaces.flow.cdi.Fl
owBuilderFactoryBean.createFlowBuilderInstance()
        at 
org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:410)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at 
org.apache.webbeans.container.BeanManagerImpl.addInternalBean(BeanManagerImpl.java:364)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at 
org.apache.webbeans.container.BeanManagerImpl.addBean(BeanManagerImpl.java:351)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at 
org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.java:2058)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotat
edType(BeansDeployer.java:1548) ~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at 
org.apache.webbeans.config.BeansDeployer.deployFromBeanAttributes(BeansDeployer.java:1504)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at 
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:313)
~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at org.apache.webbeans.lifecycle.AbstractLifeCycle.bootstrapApp
lication(AbstractLifeCycle.java:137) ~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplica
tion(AbstractLifeCycle.java:103) ~[openwebbeans-impl-2.0.3.jar:2.0.3]
        at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.star
tApplication(WebContainerLifecycle.java:98) ~[openwebbeans-web-2.0.3.jar:2
.0.3]
        at org.apache.webbeans.servlet.WebBeansConfigurationListener.co
ntextInitialized(WebBeansConfigurationListener.java:85)
~[openwebbeans-web-2.0.3.jar:2.0.3]
        at org.apache.meecrowave.openwebbeans.OWBAutoSetup$EagerBootLis
tener.doContextInitialized(OWBAutoSetup.java:80)
~[meecrowave-core-1.2.0.jar:1.2.0]

Any hint greatly appreciated...

Cheers
Dennis

Reply via email to