Wildfly 14: MyFaces 2.3.2 initialization error (WELD-001456: Argument bean must not be null)
stevekk Nov 26, 2018 4:27 AMHello,
i'm facing a problem during MyFaces Initalization on Wildfly 14.
Im using:
Wildfly 14.0.0.FINAL
MyFaces 2.3.2
The error occurs not on every startup, somtimes it works, sometimes it crashes... So i think maybe its an ordering problem?
This is the Error:
An error occured while initializing MyFaces: WELD-001456: Argument bean must not be null
This is the Method which procudes the error (JAR: weld-core-impl-3.0.5.Final.jar, Class: org.jboss.weld.manager.BeanManagerImpl)
When it happens the requestedType is always: "org.apache.myfaces.flow.cdi.FlowBuilderFactoryBean".
@Override
public Object getReference(Bean<?> bean, Type requestedType, CreationalContext<?> creationalContext) {
Preconditions.checkArgumentNotNull(bean, "bean"); // This line produces the error because bean is null
Preconditions.checkArgumentNotNull(requestedType, "requestedType");
Preconditions.checkArgumentNotNull(creationalContext, CREATIONAL_CONTEXT);
if (!BeanTypeAssignabilityRules.instance().matches(requestedType, bean.getTypes())) {
throw BeanManagerLogger.LOG.specifiedTypeNotBeanType(requestedType, bean);
}
// Ensure that there is no injection point associated
final ThreadLocalStackReference<InjectionPoint> stack = currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE);
try {
return getReference(bean, requestedType, creationalContext, false);
} finally {
stack.pop();
}
}
I'm searchin for a few days now but didn't find a solution.
What could cause this problem? Should i try MyFaces 2.2 or maybe Wildfly 13?
It's my first application with jsf 2.3 and wildfly, so i have no working project to compare with.
Here is the StackTrace:
08:49:17,623 INFO [org.jboss.weld.Event] (MSC service thread 1-7) WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.cdi.JsfArtifactProducerExtension.processAnnotatedType(@Observes ProcessAnnotatedType<T>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
08:49:17,638 INFO [org.jboss.weld.Event] (MSC service thread 1-7) WELD-000411: Observer method [BackedAnnotatedMethod] org.apache.myfaces.config.annotation.CdiAnnotationProviderExtension.processAnnotatedType(@Observes ProcessAnnotatedType<T>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
08:49:18,855 INFO [org.apache.myfaces.ee.MyFacesContainerInitializer] (ServerService Thread Pool -- 161) Using org.apache.myfaces.ee.MyFacesContainerInitializer
08:49:18,855 INFO [org.apache.myfaces.ee.MyFacesContainerInitializer] (ServerService Thread Pool -- 161) Using org.apache.myfaces.ee.MyFacesContainerInitializer
08:49:18,871 WARN [io.jaegertracing.internal.senders.SenderResolver] (ServerService Thread Pool -- 161) No suitable sender found. Using NoopSender, meaning that data will not be sent anywhere!
08:49:18,871 INFO [io.jaegertracing.Configuration] (ServerService Thread Pool -- 161) Initialized tracer=JaegerTracer(version=Java-0.30.6, serviceName=guidanceEar-0.0.1-SNAPSHOT.ear!guidance.war, reporter=RemoteReporter(sender=NoopSender(), closeEnqueueTimeout=1000), sampler=RemoteControlledSampler(maxOperations=2000, manager=HttpSamplingManager(hostPort=localhost:5778), sampler=ProbabilisticSampler(tags={sampler.type=probabilistic, sampler.param=0.001})), tags={hostname=L1ITO009, jaeger.version=Java-0.30.6, ip=172.24.25.224}, zipkinSharedRpcSpan=false, expandExceptionLogs=false)
08:49:19,038 INFO [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 161) Reading standard config META-INF/standard-faces-config.xml
08:49:19,256 INFO [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 161) Reading config /WEB-INF/faces-config.xml
08:49:21,737 INFO [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 161) Reading config : jar:file:/C:/java/wildfly/modules/org/jboss/as/jsf-injection/myfaces-2.3.2/wildfly-jsf-injection-14.0.1.Final.jar!/META-INF/faces-config.xml
08:49:21,737 INFO [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 161) Reading config : vfs:/C:/java/wildfly/standalone/deployments/guidanceEar-0.0.1-SNAPSHOT.ear/guidance.war/WEB-INF/lib/babylon-layout-2.0.0.jar/META-INF/faces-config.xml
08:49:21,737 INFO [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 161) Reading config : vfs:/C:/java/wildfly/standalone/deployments/guidanceEar-0.0.1-SNAPSHOT.ear/guidance.war/WEB-INF/lib/primefaces-6.2.jar/META-INF/faces-config.xml
08:49:21,769 INFO [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 161) Reading config : vfs:/C:/java/wildfly/standalone/deployments/guidanceEar-0.0.1-SNAPSHOT.ear/kathrein-jboss-common.jar/META-INF/faces-config.xml
08:49:24,000 INFO [org.apache.myfaces.config.LogMetaInfUtils] (ServerService Thread Pool -- 161) Artifact 'myfaces-impl' was found in version '2.3.2' from path 'file:/C:/java/wildfly/modules/com/sun/jsf-impl/myfaces-2.3.2/myfaces-impl-2.3.2.jar'
08:49:24,093 INFO [org.apache.myfaces.config.FacesConfigurator] (ServerService Thread Pool -- 161) Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
08:49:24,093 SEVERE [org.apache.myfaces.webapp.AbstractFacesInitializer] (ServerService Thread Pool -- 161) An error occured while initializing MyFaces: WELD-001456: Argument bean must not be null: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456: Argument bean must not be null
at org.jboss.weld.util.Preconditions.checkArgumentNotNull(Preconditions.java:40)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.apache.myfaces.cdi.util.CDIUtils.resolveInstance(CDIUtils.java:65)
at org.apache.myfaces.cdi.util.CDIUtils.lookup(CDIUtils.java:52)
at org.apache.myfaces.flow.cdi.DefaultCDIFacesFlowProvider.getAnnotatedFlows(DefaultCDIFacesFlowProvider.java:52)
at org.apache.myfaces.flow.impl.AnnotatedFlowConfigurator.configureAnnotatedFlows(AnnotatedFlowConfigurator.java:42)
at org.apache.myfaces.config.FacesConfigurator.configureFlowHandler(FacesConfigurator.java:1713)
at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:619)
at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:465)
at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:70)
at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:189)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:103)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
08:49:24,117 INFO [org.apache.myfaces.webapp.StartupServletContextListener] (ServerService Thread Pool -- 161) MyFaces Core has started, it took [5246] ms.
08:49:24,148 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 161) WFLYUT0021: Registered web context: '/guidance' for server 'default-server'
08:49:24,242 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0010: Deployed "guidanceEar-0.0.1-SNAPSHOT.ear" (runtime-name : "guidanceEar-0.0.1-SNAPSHOT.ear")
Thank you very much for your help!
And please tell me if you need more Information.
Steve