Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OWB-1298: Exclude Mojarra 2.3 #33

Merged
merged 1 commit into from Sep 24, 2021
Merged

Conversation

melloware
Copy link
Contributor

@melloware melloware commented May 9, 2021

Using:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>jakarta.faces</artifactId>
    <version>2.3.16</version>
</dependency>

Prevents this issue:

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)

@@ -220,6 +220,7 @@ org.apache.webbeans.scanExclusionPaths=/jre/lib, \
/jsp-api, \
/myfaces-api, \
/myfaces-impl, \
/jakarta.faces, \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be jakarta as "javax" is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought these libs were there maven coordinates which is...

                <dependency>
                    <groupId>org.glassfish</groupId>
                    <artifactId>jakarta.faces</artifactId>
                    <version>2.3.16</version>
                </dependency>

So I thought my choice above was the safest exclude.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javax.faces exists too.

I'm fine you say it shouldnt be excluded but then javax token is wrong too.

Overall the point is javax and jakarta must be handled the same way as of today before we can merge it (think jakarta.faces does not need scanning so i would exclude it until it changed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure who added javax here but it seems wrong to me. and this problem with Mojarra only started with the GlassFish JARs when they got renamed to jakarta.faces. the old javax versions of these JARS do not expose the issue. I just know the above exclude definitely fixes the problem in OWB-1298.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my 2cts would be that any exclude is wong but generally works until a naming breaks it
afaik jakarta.faces does not need to be scanned so i wouldnt make it specific by itself but also because it would be a jakarta/javax change (guess we missed that exclusion when we made jakarta package integration for openwebbeans since we don't use mojarra in the core project)
it is kind of consistent with your mention, javax.faces was ok being excluded so jakarta.faces should be.

side note (not sure it is clear): excluded means not scanned by OWB but an extension can still add beans, it is not "fully ignore this jar", just "don't look for beans through its .class").

@tandraschko tandraschko merged commit 0cf6f33 into apache:master Sep 24, 2021
@melloware melloware deleted the patch-1 branch September 24, 2021 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants