JSF 2.3启动中未定义的组件类型javax.faces.ViewRoot [英] Undefined component type javax.faces.ViewRoot in JSF 2.3 startup

查看:87
本文介绍了JSF 2.3启动中未定义的组件类型javax.faces.ViewRoot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在此处找到的早期问题的新转折. .

我正在从MyFaces 2.1升级到2.3.5,并且从PrimeFaces 6.1升级到7.这还包括从托管bean迁移到CDI.此时,服务器启动,似乎MyFaces,PrimeFaces和CDI正在初始化.但是,当我尝试加载我的第一页时,出现"Undefined component type javax.faces.ViewRoot".请注意,这是组件类型"而不是类.

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.

通过进入MyFaces代码,我可以看到组件类映射正在使用许多组件进行初始化,但与ViewRoot相似.我很犹豫尝试手动注册UIViewRoot,因为在早期版本中这不是必需的,而且我还没有看到有必要提及这种事情.

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.

[对于@tandraschko,他对我最近在这里的努力非常有帮助,因此我正在使用不捆绑的MyFaces api&展示库.正如您所建议的那样,我将创建一个简化的项目,以查看是否可以更小规模地重现或确定问题.]

[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.]

<!-- 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>


<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> 


<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>   


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)

推荐答案

最后!解决了.不过,答案显示出我的无知:

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

不要将您的faces-config.xml文件重命名为 standard-faces-config.xml

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

以前,我在设置Maven和Eclipse来正确构建包含我的所有库(包括JSF)并由我的主应用程序项目引用的公共项目时遇到麻烦.有时,主应用程序的faces-config.xml似乎正在覆盖通用应用程序的faces-config.xml.我偶然发现了对standard-faces-config.xml的引用.因此,我将常见的faces-config.xml重命名为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.

更糟糕的是,一旦我使Maven和Eclipse正常运行,我就怀疑这种变化.但是恢复文件名似乎没有任何作用.这已经成为我第二个来之不易的课:

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:

使用Maven和Eclipse,请确保您确实在重建和重新部署项目

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.

非常感谢所有回答的人,尤其是@tandraschko!

Many thanks to everyone who responded, especially @tandraschko!

这篇关于JSF 2.3启动中未定义的组件类型javax.faces.ViewRoot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆