What to do when it becomes Unable to find CDI BeanManager.

--Environment - CentOS Linux release 7.8.2003 (Core) - Eclipse IDE for Enterprise Java Developers. Version: 2020-03 (4.15.0) - openjdk version "11.0.7" - Payara Server 5.194

Event: An error log was displayed when starting Payara for a JSF project.

Error log message


cannot Deploy tryJsf
deploy is failing=Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager. Please see server.log for more details.]

server.log


[2020-07-20T21:13:22.486+0900] [Payara 5.194] [Serious] [] [javax.enterprise.resource.webcontainer.jsf.config] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202486] [levelValue: 1000] [[
  Critical error during deployment: 
javax.faces.FacesException: Unable to find CDI BeanManager
    at com.sun.faces.el.ELUtils.tryAddCDIELResolver(ELUtils.java:288)
    at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:218)
    at com.sun.faces.application.ApplicationAssociate.initializeELResolverChains(ApplicationAssociate.java:467)
...abridgement...
]]

[2020-07-20T21:13:22.490+0900] [Payara 5.194] [Serious] [AS-WEB-CORE-00174] [javax.enterprise.web.core] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202490] [levelValue: 1000] [[
  Startup of context /tryJsf failed due to previous errors]]

[2020-07-20T21:13:22.492+0900] [Payara 5.194] [Serious] [AS-WEB-CORE-00175] [javax.enterprise.web.core] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202492] [levelValue: 1000] [[
  Exception during cleanup after start failed
org.apache.catalina.LifecycleException: Manager has not yet been started
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:868)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5940)
    at com.sun.enterprise.web.WebModule.stop(WebModule.java:648)
...abridgement...
]]

[2020-07-20T21:13:22.493+0900] [Payara 5.194] [Serious] [AS-WEB-CORE-00108] [javax.enterprise.web.core] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202493] [levelValue: 1000] [[
  ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5760)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:619)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:956)
...abridgement...
Caused by: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:283)
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5165)
...abridgement...
Caused by: javax.faces.FacesException: Unable to find CDI BeanManager
    at com.sun.faces.el.ELUtils.tryAddCDIELResolver(ELUtils.java:288)
    at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:218)
...abridgement...
]]

[2020-07-20T21:13:22.495+0900] [Payara 5.194] [warning] [] [javax.enterprise.web] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202495] [levelValue: 900] [[
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:960)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
...abridgement...
]]

[2020-07-20T21:13:22.504+0900] [Payara 5.194] [Serious] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202504] [levelValue: 1000] [[
  Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:136)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
...abridgement...
]]

[2020-07-20T21:13:22.505+0900] [Payara 5.194] [Serious] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=49 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1595247202505] [levelValue: 1000] [[
  Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.faces.FacesException: Unable to find CDI BeanManager
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:136)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
...abridgement...
]]

Cause: You didn't specify the JSF library

I specified "2.3" in [Java Server Faces] for the project, but I didn't specify any library ...

Reference: [Java EE Challenge for New Graduate SE 2 (JSF Edition) | Iterative Co., Ltd.](https://www.iterative.co.jp/blog/javaee2-%EF%BD%8A%EF%BD%93%EF % BD% 86 /)

pom.xml didn't do anything in the initial state


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.ponsuke</groupId>
  <artifactId>tryJsf</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
</project>

Action: Put the JSF library in pom.xml

  1. Copy the definition of any version from Maven Repository: org.glassfish »javax.faces
  2. Add to pom.xml
  3. Clean Payara> Clean Project> Run As> Run Os Server in the project

pom.xml


...abridgement...
  <dependencies>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.faces</artifactId>
      <version>2.3.9</version>
    </dependency>
  </dependencies>
</project>

Recommended Posts

What to do when it becomes Unable to find CDI BeanManager.
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
What to do when javax.batch.operations.JobStartException occurs
What to do when a javax.el.PropertyNotWritableException occurs
What to do when undefined method ʻuser_signed_in?'
What to do when debugging "Source not found"
What do you use when converting to String?
What to do when IllegalStateException occurs in PlayFramework
<f: ajax> Unable to attach <f: ajax> to non-ClientBehaviorHolder What to do when you become a parent
What to do when the value becomes null in the second getSubmittedValue () in JSF Validator
What to do when is invalid because it does not start with a'-'
When I tried to start GlassFish, I got an internal error while "Publishing to GlassFish 4.0 on localhost ...". What to do when it becomes
What to do when The SSL certificate has expired
What to do when JSF tags do not become HTML
What to do if ClassNotFoundException occurs when starting Tomcat
ParseException: What to do when Unparseable date is reached
What to do when Method not found in f: ajax
Bluemix Infrastructure VPN does not connect because it does not support NPAPI! What to do when [Mac]
What to do when Cannot apply expression operators to method binding
[Programming beginner] What to do when rails s becomes an error in the local development environment
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
What to do when the changes in the Servlet are not reflected
[Rails] What to do when rails s does not respond or does not stop
java.security.InvalidKeyException: What to do when Illegal key size or default parameters
What to do when you become a Problem During Content Assist
What to do when you run into a docker-compose node_modules problem
[IOS] What to do when the image is filled with one color
What to do when CentOS cannot be started with VirtualBox on Catalina
What to do when "npm ERR! Code ENOSELF" is displayed after npm install
What to do when Blocked Host: "host name" appears in Ruby on Rails
What to do if an error occurs when nokogiri enters when bundle install
Notes on what to do when EC2 is set up with t2.micro
What to do if tomcat process remains when tomcat is stopped in eclipse
What to do when "call'Hoge.connection' to establish a connection" appears on rails c
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What to do after updating Dockerfile, docker-compose.yml
What to do when you think you can't do Groovy-> Java in IntelliJ IDEA CE
[Grails] Error occurred running What to do when the Grails CLI does not start
What to do when "Nil location provided. Can't build URI." Appears on CarrierWave
What to do if ffi installation fails when launching an application in Rails
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
WELD-001408: What to do when Unsatisfied dependencies for type Bean with qualifiers @Default
What to do when ‘Could not find’ in any of the sources appears in the development environment with Docker × Rails × RSpec
What to do if you try to start GlassFish and it becomes java.lang.UnsupportedClassVersionError: org / glassfish / admin / cli / AsadminMain: Unsupported major.minor version 51.0
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server