[ 
https://issues.apache.org/jira/browse/OWB-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16944787#comment-16944787
 ] 

Arjan Tijms commented on OWB-1298:
----------------------------------

> I wonder where the duplicate beans come from? There is no beans.xml and the 
> bean is only added once in the extension?!

Indeed, Mojarra contains no {{beans.xml}} file, but does contain an extension. 
Hence, according to CDI 12.1 the Mojarra jar is not a bean archive:


{quote}An archive which:

 * contains a beans.xml file with the bean-discovery-mode of none, or,
 * contains an extension and no beans.xml file

is not a bean archive.{quote}

Above however there is talk about the Mojarra jar being scanned:

{quote}the issue comes from the fact the API jar adds annotated type with an id 
different from the id scanned for the same bean so it ends up with 2 
conflicting beans.{quote}

If "scanned" is not a wrong usage of the word here, then this seems not 
correct. The Mojarra jar effectively declares that it should not be scanned for 
beans or types. They are solely added via the extension.


> WebsocketUserManager ambigious resolution Jakarta Faces
> -------------------------------------------------------
>
>                 Key: OWB-1298
>                 URL: https://issues.apache.org/jira/browse/OWB-1298
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>         Environment: Jetty 9.4
>            Reporter: Melloware
>            Priority: Major
>             Fix For: 2.0.12
>
>         Attachments: owb-test.zip
>
>
> Originally Reported: https://github.com/primefaces/primefaces-test/issues/15
> Attached is a test case you can run with "*mvn clean jetty:run-exploded 
> -Pmojarra23*".
> Trying to use the latest Jakarta Faces with OWB 2.0.11 results in ambigious 
> resolution of the WebocketUserManager.
> {code:xml}
> <dependency>
>     <groupId>org.glassfish</groupId>
>     <artifactId>jakarta.faces</artifactId>
>     <version>2.3.13</version>
> </dependency>
> {code}
> The resulting stack trace:
> {code}
> org.apache.webbeans.exception.WebBeansDeploymentException: 
> javax.enterprise.inject.AmbiguousResolutionException: There is more than one 
> Bean with type com.sun.faces.push.WebsocketSessionManager Qualifiers: 
> [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name :  socketSessions, Bean 
> Owner : [WebsocketPushContextProducer, WebBeansType:MANAGED, Name:null, API 
> Types:[com.sun.faces.cdi.WebsocketPushContextProducer,java.lang.Object], 
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
> found beans:
> WebsocketSessionManager, WebBeansType:MANAGED, Name:null, API 
> Types:[com.sun.faces.push.WebsocketSessionManager,java.lang.Object], 
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any] from 
> jar:file:/C:/dev/primefaces/primefaces-test/target/primefaces-test-1.0-SNAPSHOT/WEB-INF/lib/jakarta.faces-2.3.13.jar!/com/sun/faces/push/WebsocketSessionManager.class
> WebsocketSessionManager, WebBeansType:MANAGED, Name:null, API 
> Types:[com.sun.faces.push.WebsocketSessionManager,java.lang.Object], 
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any] from 
> jar:file:/C:/dev/primefaces/primefaces-test/target/primefaces-test-1.0-SNAPSHOT/WEB-INF/lib/jakarta.faces-2.3.13.jar!/com/sun/faces/push/WebsocketSessionManager.class
>     at org.apache.webbeans.config.BeansDeployer.deploy 
> (BeansDeployer.java:360)
>     at org.apache.webbeans.lifecycle.AbstractLifeCycle.bootstrapApplication 
> (AbstractLifeCycle.java:137)
>     at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication 
> (AbstractLifeCycle.java:103)
>     at 
> org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication 
> (WebContainerLifecycle.java:98)
>     at 
> org.apache.webbeans.servlet.WebBeansConfigurationListener.contextInitialized 
> (WebBeansConfigurationListener.java:85)
>     at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized 
> (ContextHandler.java:921)
>     at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized 
> (ServletContextHandler.java:554)
>     at org.eclipse.jetty.server.handler.ContextHandler.startContext 
> (ContextHandler.java:888)
>     at org.eclipse.jetty.servlet.ServletContextHandler.startContext 
> (ServletContextHandler.java:357)
>     at org.eclipse.jetty.webapp.WebAppContext.startWebapp 
> (WebAppContext.java:1443)
>     at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp 
> (JettyWebAppContext.java:328)
>     at org.eclipse.jetty.webapp.WebAppContext.startContext 
> (WebAppContext.java:1407)
>     at org.eclipse.jetty.server.handler.ContextHandler.doStart 
> (ContextHandler.java:821)
>     at org.eclipse.jetty.servlet.ServletContextHandler.doStart 
> (ServletContextHandler.java:276)
>     at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:524)
>     at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart 
> (JettyWebAppContext.java:397)
>     at org.eclipse.jetty.util.component.AbstractLifeCycle.start 
> (AbstractLifeCycle.java:72)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.start 
> (ContainerLifeCycle.java:169)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart 
> (ContainerLifeCycle.java:117)
>     at org.eclipse.jetty.server.handler.AbstractHandler.doStart 
> (AbstractHandler.java:106)
>     at org.eclipse.jetty.util.component.AbstractLifeCycle.start 
> (AbstractLifeCycle.java:72)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.start 
> (ContainerLifeCycle.java:169)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart 
> (ContainerLifeCycle.java:117)
>     at org.eclipse.jetty.server.handler.AbstractHandler.doStart 
> (AbstractHandler.java:106)
>     at org.eclipse.jetty.util.component.AbstractLifeCycle.start 
> (AbstractLifeCycle.java:72)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.start 
> (ContainerLifeCycle.java:169)
>     at org.eclipse.jetty.server.Server.start (Server.java:407)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart 
> (ContainerLifeCycle.java:110)
>     at org.eclipse.jetty.server.handler.AbstractHandler.doStart 
> (AbstractHandler.java:106)
>     at org.eclipse.jetty.server.Server.doStart (Server.java:371)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to