Undefined component type javax.faces.ViewRoot in JSF 2.3 startup

流过昼夜 提交于 2020-01-06 05:37:07

问题


This is a new twist from my earlier issues found here.

I'm upgrading from MyFaces 2.1 to 2.3.5, and from PrimeFaces 6.1 to 7. This has also included migrating from managed beans to CDI. At this point, the server starts up and it appears that MyFaces, PrimeFaces, and CDI are being initialized. However, when I attempt to load my first page I get "Undefined component type javax.faces.ViewRoot". Note, this is a "component type" not a class.

Tracing into the MyFaces code, I can see that the component class map is being initialized with lots of components, but nothing similar to ViewRoot. I'm hesitant to try manually registering UIViewRoot since this wasn't necessary with the earlier versions and I haven't seen any mention of something like this being necessary.

Can anyone suggest what I may be doing wrong?

I've included the relevant configuration and log files (abridged) below.

[And for @tandraschko who's been so helpful with my recent struggles here, I am using the non-bundled MyFaces api & impl libraries. And as you've suggested, I'm going to create a stripped-down project to see if I can reproduce or identify the issue on a smaller scale.]

pom.xml

<!-- MyFaces -->
<dependency>
    <groupId>org.apache.myfaces.core</groupId>
    <artifactId>myfaces-api</artifactId>
    <version>2.3.5</version>
</dependency>
<dependency>
    <groupId>org.apache.myfaces.core</groupId>
    <artifactId>myfaces-impl</artifactId>
    <version>2.3.5</version>
</dependency>

<!-- PrimeFaces -->
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>7.0</version>
</dependency>
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>all-themes</artifactId>
    <version>1.0.10</version>
</dependency>

<!-- Spring -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>4.0.9.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>4.0.9.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-oxm</artifactId>
    <version>4.0.9.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>4.0.9.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.batch</groupId>
    <artifactId>spring-batch-core</artifactId>
    <version>2.2.7.RELEASE</version>
</dependency>

<!-- Tomcat -->
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-catalina</artifactId>
    <version>9.0.30</version>
</dependency>
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-util</artifactId>
    <version>9.0.12</version>
    <scope>provided</scope>
</dependency>

<!-- OpenWebBeans - implements CDI Container -->
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-spi</artifactId>
    <version>${owb.version}</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-impl</artifactId>
    <version>${owb.version}</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-web</artifactId>
    <version>${owb.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-jsf</artifactId>
    <version>${owb.version}</version>
</dependency>

<!-- Apache taglibs -->
<dependency>
    <groupId>org.apache.taglibs</groupId>
    <artifactId>taglibs-standard-impl</artifactId>
    <version>1.2.5</version>
</dependency>
<dependency>
    <groupId>org.apache.taglibs</groupId>
    <artifactId>taglibs-standard-spec</artifactId>
    <version>1.2.5</version>
</dependency>

<!-- Misc -->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>4.0.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.el</groupId>
    <artifactId>javax.el-api</artifactId>
    <version>3.0.0</version>
</dependency>

<dependency>
    <groupId>commons-digester</groupId>
    <artifactId>commons-digester</artifactId>
    <version>2.1</version>
</dependency>


faces-config.xml

<lifecycle>
  <phase-listener>
    com.company.application.security.AuthorizationListener
  </phase-listener>
</lifecycle> 

<lifecycle>
    <phase-listener>org.primefaces.component.lifecycle.LifecyclePhaseListener</phase-listener>
</lifecycle>    

<render-kit>
    <renderer>
        <component-family>org.primefaces.component</component-family>
        <renderer-type>org.primefaces.component.DataTableRenderer</renderer-type>
        <renderer-class>com.company.common.web.CustomDataTableRenderer</renderer-class>
    </renderer>
    <renderer>
        <component-family>org.primefaces.component</component-family>
        <renderer-type>org.primefaces.component.MenubarRenderer</renderer-type>
        <renderer-class>com.company.common.web.CustomMenubarRenderer</renderer-class>
    </renderer>     
</render-kit>   

<application>
    <el-resolver>
      org.springframework.web.jsf.el.SpringBeanFacesELResolver
    </el-resolver>
    <action-listener>
       com.company.common.app.DialogActionListenerCompatibilityFix
       <!-- This was necessary as default failed with missing default constructor -->
    </action-listener>
    <navigation-handler>
       org.primefaces.application.DialogNavigationHandler
    </navigation-handler>
    <view-handler>
       org.primefaces.application.DialogViewHandler
    </view-handler>
</application> 


web.xml

<listener>
    <listener-class>com.company.application.app.AppApplicationContextListener</listener-class>
</listener>
<listener>
    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
</listener>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>org.apache.myfaces.SUPPORT_MANAGED_BEANS</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>org.apache.myfaces.annotation.USE_CDI_FOR_ANNOTATION_SCANNING</param-name>
    <param-value>true</param-value>
</context-param>   


Console Output

INFO: Server version:        Apache Tomcat/9.0.8
INFO: Server built:          Apr 27 2018 19:32:00 UTC
INFO: Server number:         9.0.8.0
INFO: OS Name:               Windows 10
INFO: OS Version:            10.0
INFO: Architecture:          amd64
INFO: Java Home:             C:\Program Files\Java\OpenJDK_11.0.5.10
INFO: JVM Version:           11.0.5+10
INFO: JVM Vendor:            AdoptOpenJDK
INFO: CATALINA_BASE:         C:\Users\name\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp9
INFO: CATALINA_HOME:         C:\Program Files\apache-tomcat-9.0.8
INFO: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:51836
INFO: Command line argument: -javaagent:C:\Eclipse\eclipse\configuration\org.eclipse.osgi\409\0\.cp\lib\javaagent-shaded.jar
INFO: Command line argument: -Dcatalina.base=C:\Users\name\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp9
INFO: Command line argument: -Dcatalina.home=C:\Program Files\apache-tomcat-9.0.8
INFO: Command line argument: -Dwtp.deploy=C:\Users\name\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp9\wtpwebapps
INFO: Command line argument: -Dfile.encoding=Cp1252

Jan 02, 2020 3:42:38 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Jan 02, 2020 3:42:38 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.8

INFO  common.app.ApplicationServicesProvisioner - Registering ApplicationServices Class as com.company.application.app.ApplicationServicesImpl
INFO  common.app.DatabaseServicesProvisioner - Registering DatabaseServices Class as com.company.application.app.DatabaseServicesImpl

INFO  web.lifecycle.WebContainerLifecycle - OpenWebBeans Container is starting...
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/beans.xml
INFO  web.scanner.WebScannerService - Adding information from WEB-INF/beans.xml
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Program%20Files/apache-tomcat-9.0.8/lib/websocket-api.jar
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Program%20Files/apache-tomcat-9.0.8/lib/ecj-4.7.3a.jar
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Program%20Files/apache-tomcat-9.0.8/lib/jaspic-api.jar
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Program%20Files/apache-tomcat-9.0.8/lib/annotations-api.jar
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Program%20Files/apache-tomcat-9.0.8/lib/
INFO  corespi.scanner.AbstractMetaDataDiscovery - added beans archive URL: file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/classes/
INFO  common.web.SessionBeanBase - Prime Faces version:  7.0
INFO  webbeans.config.BeansDeployer - All injection points were validated successfully.
INFO  web.lifecycle.WebContainerLifecycle - OpenWebBeans Container has started, it took [4028] ms.

INFO  [Catalina].[localhost].[/app] - Initializing Spring root WebApplicationContext
INFO  web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO  context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Thu Jan 02 15:42:46 EST 2020]; root of context hierarchy
INFO  factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
INFO  factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/check-database.xml]
INFO  factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/batch-infrastructure.xml]
INFO  factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/batch-jobs/batch-jobs.xml]
INFO  factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]
INFO  factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'helloWorldJob': replacing [Generic bean: class [org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.batch.core.configuration.xml.JobParserJobFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
INFO  factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/batch-jobs/appBatchRunnerJob.xml]
INFO  factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'app_BatchJobRunner': replacing [Generic bean: class [org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.batch.core.configuration.xml.JobParserJobFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
INFO  factory.config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [license.config]
INFO  factory.config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [application.secrets]
INFO  factory.config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [application.properties]
INFO  factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'postProcessTasklet': replacing [Generic bean: class [com.company.application.batch.PostProcessBatchTest]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]]
INFO  factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'completionNotificationTasklet': replacing [Generic bean: class [com.company.common.batch.BatchJobCompletionNotifier]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]]
INFO  factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'xmlItemWriter': replacing [Generic bean: class [org.springframework.batch.item.xml.StaxEventItemWriter]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in ServletContext resource [/WEB-INF/batch-jobs/helloWorldJob.xml]]
INFO  factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'appBatchJobTasklet': replacing [Generic bean: class [com.company.common.batch.BatchJobRunner]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in ServletContext resource [/WEB-INF/batch-jobs/appBatchRunnerJob.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in ServletContext resource [/WEB-INF/batch-jobs/appBatchRunnerJob.xml]]

INFO  common.db.appCheckDatabase - Loaded JDBC driver: org.postgresql.Driver
INFO  common.db.appCheckDatabase - Skipping database accessibility check
INFO  common.batch.appDriverManagerDataSource - Loaded JDBC driver: org.postgresql.Driver
INFO  repository.support.JobRepositoryFactoryBean - No database type set, using meta data indicating: POSTGRES
INFO  scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService 
INFO  scheduling.concurrent.ThreadPoolTaskScheduler - Initializing ExecutorService  'scheduler'
INFO  oxm.jaxb.Jaxb2Marshaller - Creating JAXBContext with classes to be bound [class com.company.application.batch.Report]
INFO  web.context.ContextLoader - Root WebApplicationContext: initialization completed in 4668 ms

INFO  myfaces.config.DefaultFacesConfigurationProvider - Reading standard config META-INF/standard-faces-config.xml
INFO  myfaces.config.DefaultFacesConfigurationProvider - Reading config /WEB-INF/faces-config.xml
INFO  myfaces.config.DefaultFacesConfigurationProvider - Reading config : jar:file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/lib/openwebbeans-el22-2.0.12.jar!/META-INF/faces-config.xml
INFO  myfaces.config.DefaultFacesConfigurationProvider - Reading config : jar:file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/lib/openwebbeans-jsf-2.0.12.jar!/META-INF/faces-config.xml
INFO  myfaces.config.DefaultFacesConfigurationProvider - Reading config : jar:file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/lib/primefaces-7.0.jar!/META-INF/faces-config.xml
INFO  myfaces.config.LogMetaInfUtils - Artifact 'myfaces-api' was found in version '2.3.5' from path 'file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/lib/myfaces-api-2.3.5.jar'
INFO  myfaces.config.LogMetaInfUtils - Artifact 'myfaces-impl' was found in version '2.3.5' from path 'file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/lib/myfaces-impl-2.3.5.jar'
INFO  myfaces.config.LogMetaInfUtils - Artifact 'myfaces-impl-shared-public' was found in version '2.3.5' from path 'file:/C:/Users/name/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/app/WEB-INF/lib/myfaces-impl-shared-public-2.3.5.jar'
INFO  myfaces.util.ExternalSpecifications - MyFaces CDI support enabled
INFO  spi.impl.DefaultInjectionProviderFactory - Using InjectionProvider org.apache.myfaces.spi.impl.CDIAnnotationDelegateInjectionProvider
INFO  myfaces.util.ExternalSpecifications - MyFaces Bean Validation support disabled
INFO  myfaces.config.FacesConfigurator - Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
INFO  config.annotation.DefaultLifecycleProviderFactory - Using LifecycleProvider org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider
INFO  primefaces.webapp.PostConstructApplicationEventListener - Running on PrimeFaces 7.0
INFO  myfaces.webapp.AbstractFacesInitializer - ServletContext initialized.

INFO  myfaces.webapp.WebConfigParamsLogger - Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
WARN  myfaces.webapp.AbstractFacesInitializer - 

*******************************************************************
*** WARNING: Apache MyFaces-2 is running in DEVELOPMENT mode.   ***
***                                         ^^^^^^^^^^^         ***
*** Do NOT deploy to your live server(s) without changing this. ***
*** See Application#getProjectStage() for more information.     ***
*******************************************************************

INFO  myfaces.webapp.StartupServletContextListener - MyFaces Core has started, it took [2047] ms.
INFO  catalina.startup.Catalina - Server startup in 14480 ms

[[[  browse to login.jsf  ]]]


ERROR myfaces.application.ApplicationImpl - Undefined component type javax.faces.ViewRoot
INFO  common.security.AuthorizationListenerBase - redirecting to the login page: session is not null, currentPage = , currentUser = null
INFO  common.app.ApplicationContainerBase - Application startup
application Build: 0.1.0 (1); Updated: Monday November 4, 2019 4:29 pm
app Build: 2.1.8 (149); Updated: Friday, November 8, 2019 3:54 pm

INFO  application.web.SessionBean - ========== Session Constructor ===============
INFO  application.web.SessionBean - ===== Build #0.1.0 (1) Updated: Monday November 4, 2019 4:29 pm POSTGRESQL
INFO  application.web.SessionBean - ==============================================
ERROR common.exceptions.appExceptionHandler - Apache root cause: 
javax.faces.FacesException: Undefined component type javax.faces.ViewRoot
    at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1504)
    at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1472)
    at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:133)
    at org.apache.myfaces.shared.view.ViewDeclarationLanguageBase.createView(ViewDeclarationLanguageBase.java:53)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createView(FaceletViewDeclarationLanguage.java:2056)
    at org.apache.myfaces.application.ViewHandlerImpl.createView(ViewHandlerImpl.java:264)
    at javax.faces.application.ViewHandlerWrapper.createView(ViewHandlerWrapper.java:115)
    at javax.faces.application.ViewHandlerWrapper.createView(ViewHandlerWrapper.java:115)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage$FaceletViewMetadata.createMetadataView(FaceletViewDeclarationLanguage.java:2757)
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:252)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:195)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:142)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:204)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:111)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.company.common.security.SsoAuthFilter.doFilter(SsoAuthFilter.java:136)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.company.common.web.RequestHeaderFilter.doFilter(RequestHeaderFilter.java:62)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.company.common.web.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.company.common.web.URLSessionFilter.doFilter(URLSessionFilter.java:56)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.company.common.web.RawResourceFilter.doFilter(RawResourceFilter.java:150)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:834)

回答1:


Finally! Solved it. Though, the answer shows my ignorance:

Don't rename your faces-config.xml file to standard-faces-config.xml

Earlier, I had trouble setting up Maven and Eclipse to properly build a common project containing all my libraries (including JSF) and referenced by my main application project. At one point it seemed that the main application's faces-config.xml was overwriting the common application's faces-config.xml. I stumbled across references to standard-faces-config.xml. So I'd renamed the common faces-config.xml to standard-faces-config.xml, which seemed to work. I'd assumed that was how to handle multi-project applications.

To make matters worse, I'd suspected this change once I got Maven and Eclipse working. But reverting the filename didn't seem to do anything. This has become my second hard-earned lesson:

With Maven and Eclipse, make sure you're really rebuilding and redeploying your projects

So many times now I've made changes and relaunched, only to realize my changes weren't included.

Many thanks to everyone who responded, especially @tandraschko!



来源:https://stackoverflow.com/questions/59570179/undefined-component-type-javax-faces-viewroot-in-jsf-2-3-startup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!