payara / Payara

Payara Server is an open source middleware platform that supports reliable and secure deployments of Java EE (Jakarta EE) and MicroProfile applications in any environment: on premise, in the cloud or hybrid.
http://www.payara.fish
Other
879 stars 301 forks source link

Bug Report: Payara 6: useBundledJsf not working (WELD-001414: Bean name is ambiguous. Name requestScope resolves to beans) / FISH-7043 #6163

Open FeanorOfValinor opened 1 year ago

FeanorOfValinor commented 1 year ago

Brief Summary

I want to use MyFaces instead of Mojarra as my JSF implementation. I've previously used useBundledJsf to get this working.

useBundledJsf worked fine with Payara 5 (5.2022.5) but with Payara 6 (6.2023.1) I get the following exception:

org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001414: Bean name is ambiguous. Name requestScope resolves to beans: [com.sun.faces.cdi.RequestMapProducer@63bb68ea, Producer Method [Map<String, Object>] with qualifiers [@RequestMap @Any @Named] declared as [[UnbackedAnnotatedMethod] @Produces @RequestMap @Named @FacesScoped public org.apache.myfaces.cdi.FacesArtifactProducer.getRequestMap()]] -- WELD-001414: Bean name is ambiguous. Name requestScope resolves to beans: [com.sun.faces.cdi.RequestMapProducer@63bb68ea, Producer Method [Map<String, Object>] with qualifiers [@RequestMap @Any @Named] declared as [[UnbackedAnnotatedMethod] @Produces @RequestMap @Named @FacesScoped public org.apache.myfaces.cdi.FacesArtifactProducer.getRequestMap()]] at org.jboss.weld.bootstrap.Validator.validateBeanName(Validator.java:642) at org.jboss.weld.bootstrap.Validator.validateBeanNames(Validator.java:634) at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:484) at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:492) at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:94) at org.glassfish.weld.WeldDeployer.processApplicationLoaded(WeldDeployer.java:582) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:437) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:344) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:577) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:612) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:556) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:552) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/javax.security.auth.Subject.doAs(Subject.java:376) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:551) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:582) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:574) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/javax.security.auth.Subject.doAs(Subject.java:376) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:573) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1497) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1869) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1755) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:604) at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:256) at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:150) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:174) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:153) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:196) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:88) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:246) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:178) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:118) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:96) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:51) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:510) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:82) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515) at java.base/java.lang.Thread.run(Thread.java:833)

Expected Outcome

No exception. The Mojarra beans should not be loaded at all.

Current Outcome

CDI tries to initialize two requestScope beans, one from Mojarra and one from MyFaces and thus throws an exception.

Reproducer

I created two simple Maven web projects, one targeting payara 5 (ee8 javax) and one targeting payara 6 (ee10 jakarta). Open in Netbeans, build the project and deploy. TestPayara5 deployed on 5.2022.5 loads fine. TestPayara6 deployed on 6.2023.1 throws the exception.

TestPayara5.zip TestPayara6.zip

Operating System

Windows 11

JDK Version

jbrsdk_jcef-17.0.4-x64-b469

Payara Distribution

Payara Server Full Profile

Elifzeynepedman commented 1 year ago

Hi @FeanorOfValinor,

I have been able to reproduce this issue and I have escalated this to the platform development team as FISH-7043

Best Regards, Elif

FeanorOfValinor commented 1 year ago

Thank you Elif!

On Wed, Feb 1, 2023, 12:50 AM Elifzeynepedman @.***> wrote:

Hi @FeanorOfValinor https://github.com/FeanorOfValinor,

I have been able to reproduce this issue and I have escalated this to the platform development team as FISH-7043

Best Regards, Elif

— Reply to this email directly, view it on GitHub https://github.com/payara/Payara/issues/6163#issuecomment-1411503024, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWTGVYQYXWHYTA7TGKNF7QTWVH2SFANCNFSM6AAAAAAUERWLXQ . You are receiving this because you were mentioned.Message ID: @.***>

san3k1990 commented 7 months ago

Is there any information on how to fix the error?

edumartinsrib commented 6 months ago

I'm the same problem, any solution? pls.

FeanorOfValinor commented 6 months ago

This is still an issue. I was forced to move from MyFaces to Mojarra.

hberton commented 5 months ago

I have the same problem