Issue Deploying Mojarra 2.2.13.SP1 as secondary JSF configuration on Wildfly18
afd0174 Feb 11, 2020 10:01 PMHi,
I'm migrating from Wildfly10 to Wildfly18. My JSF enterprise (*.ear) application has been running on Wildfly10 with the built-in Mojarra version 2.2.13.SP1. For Wildfly18, I've observed that the following bug within the default JSF version Mojarra 2.3.9.SP04 is a show-stopper for my application:
This bug appears to still exist in the most recent version of the Mojarra 2.3 project. My workaround is then to deploy my app running the Wildfly10 version of JSF - i.e. Mojarra 2.2.13.SP1. I have followed the instructions for configuring this within Wildfly18 here:
https://docs.wildfly.org/18/Admin_Guide.html#JSF
From the server log messaging, it appears that the mojarra-2.2.13 implementation is being successfully recognized:
02:00:19,676 INFO [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final
02:00:22,213 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
02:00:22,227 INFO [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
02:00:22,473 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) starting
...
02:00:29,900 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 47) WFLYJSF0007: Activated the following JSF Implementations: [mojarra-2.2.13, main]
...
Also per the instructions, my application's web.xml file specifies the use of the alternative mojarra-2.2.13 JSF slot:
<context-param>
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>mojarra-2.2.13</param-value>
</context-param>
Unfortunately, my application then fails to deploy with the following error message:
02:00:54,224 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit.”MyApp.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyApp.ear".WeldStartService: Failed to start service
The entire log is included below, but the key exceptions appear to be:
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions: Exception 0 : javax.enterprise.event.ObserverException
...
Caused by: java.util.ServiceConfigurationError: com.sun.faces.util.cdi11.CDIUtil: com.sun.faces.util.cdi11.CDIUtilImpl not a subtype
...
at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.view.ViewScopeExtension.afterBeanDiscovery(ViewScopeExtension.java:99)
...
The thing that I find interesting is that the ServiceConfigurationError appears to be occurring within the com.sun.jsf-impl@2.3.9.SP04 default JSF 2.3 implementation, when I'm specifying that my app should use the mojarra-2.2.13 slot. As a test, if I omit the web.xml fragment, my application deploys normally (albeit broken, per the bug above) using the default Mojarra 2.3.9.SP04, so it seems that I'm getting the correct "use JSF 2.2.13" behavior via the web.xml configuration option.
If anyone has any ideas about what I might be doing wrong and/or what else I could investigate, that would be great.
Thanks,
-Andy
***
02:00:54,224 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit.”MyApp.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyApp.ear".WeldStartService: Failed to start service
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:103)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:187)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:123)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
at javax.enterprise.api//javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:177)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:171)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:44)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:75)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:462)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:86)
at org.jboss.as.weld@18.0.1.Final//org.jboss.as.weld.WeldStartService.start(WeldStartService.java:97)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.ServiceConfigurationError: com.sun.faces.util.cdi11.CDIUtil: com.sun.faces.util.cdi11.CDIUtilImpl not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.view.ViewScopeExtension.afterBeanDiscovery(ViewScopeExtension.java:99)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
... 25 more