Spring Boot Error - 没有为此应用程序配置工厂

时间:2017-08-26 13:17:12

标签: java spring jsf spring-boot

我收到IllegalStateException,说我有#34;没有为此应用程序配置工厂。"当我尝试从命令行运行我的应用程序时,会发生此错误。我可以在Eclipse IDE中运行它,没有错误。它似乎只影响JSF部分,因为这个应用程序也有一些REST控制器,即使在JSF部分失败时它仍然可以运行。

这是我的日志文件的输出:

"2017-08-26 07:47:48 [main] INFO  c.t.Ticketbot1ApplicationTests - Starting 

Ticketbot1ApplicationTests on DESKTOP-TR95CNM with PID 7248 (started by James in C:\Users\James\Documents\workspace-sts-3.9.0.RELEASE\ticketbot-1)
""2017-08-26 07:47:48 [main] DEBUG c.t.Ticketbot1ApplicationTests - Running with Spring Boot v1.5.2.RELEASE, Spring v4.3.7.RELEASE
""2017-08-26 07:47:48 [main] INFO  c.t.Ticketbot1ApplicationTests - No active profile set, falling back to default profiles: default
""2017-08-26 07:47:49 [main] INFO  o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
""2017-08-26 07:47:49 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$46fb3533] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
""2017-08-26 07:47:57 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
""2017-08-26 07:47:57 [main] INFO  o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
""2017-08-26 07:47:57 [main] INFO  org.hibernate.Version - HHH000412: Hibernate Core {5.0.12.Final}
""2017-08-26 07:47:57 [main] INFO  org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
""2017-08-26 07:47:57 [main] INFO  org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
""2017-08-26 07:47:57 [main] INFO  o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
""2017-08-26 07:47:58 [main] INFO  org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.SQLServer2012Dialect
""2017-08-26 07:47:59 [main] INFO  o.h.tool.hbm2ddl.SchemaUpdate - HHH000228: Running hbm2ddl schema update
""2017-08-26 07:48:03 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
""2017-08-26 07:48:04 [main] INFO  c.t.Ticketbot1ApplicationTests - Started Ticketbot1ApplicationTests in 16.959 seconds (JVM running for 17.665)
""2017-08-26 07:48:04 [Thread-3] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
""2017-08-26 07:48:32 [main] INFO  com.ticketbot.Ticketbot1Application - Starting Ticketbot1Application v0.0.1-SNAPSHOT on DESKTOP-TR95CNM with PID 8056 (C:\Users\James\Documents\workspace-sts-3.9.0.RELEASE\ticketbot-1\target\ticketbot.jar started by James in C:\Users\James\Documents\workspace-sts-3.9.0.RELEASE\ticketbot-1\target)
""2017-08-26 07:48:32 [main] DEBUG com.ticketbot.Ticketbot1Application - Running with Spring Boot v1.5.2.RELEASE, Spring v4.3.7.RELEASE
""2017-08-26 07:48:32 [main] INFO  com.ticketbot.Ticketbot1Application - No active profile set, falling back to default profiles: default
""2017-08-26 07:48:32 [main] INFO  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6e5e91e4: startup date [Sat Aug 26 07:48:32 CDT 2017]; root of context hierarchy
""2017-08-26 07:48:33 [main] INFO  o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
""2017-08-26 07:48:33 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$984f17d1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
""2017-08-26 07:48:34 [main] INFO  o.s.b.c.e.t.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 8080 (http)
""2017-08-26 07:48:34 [main] INFO  o.a.catalina.core.StandardService - Starting service Tomcat
""2017-08-26 07:48:34 [main] INFO  o.a.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/8.5.11
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  org.apache.jasper.servlet.TldScanner - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.ServletRegistrationBean - Mapping servlet: 'facesServlet' to [*.jsf]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.ServletRegistrationBean - Mapping servlet: 'dispatcherServlet' to [/]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/*]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'httpPutFormContentFilter' to: [/*]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'requestContextFilter' to: [/*]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'rewriteFilter' to urls: [/*]
""2017-08-26 07:48:36 [localhost-startStop-1] WARN  o.a.m.w.AbstractFacesInitializer - No mappings of FacesServlet found. Abort initializing MyFaces.
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  o.a.m.w.StartupServletContextListener - MyFaces Core has started, it took [73] ms.
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - RewriteFilter starting up...
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [4] org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener [org.ocpsoft.rewrite.prettyfaces.PrettyFacesRewriteLifecycleListener<-100>, org.ocpsoft.rewrite.faces.FacesRewriteLifecycleListener<0>, org.ocpsoft.rewrite.servlet.config.lifecycle.JoinRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.impl.DefaultRewriteLifecycleListener<2147483647>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper [org.ocpsoft.rewrite.servlet.impl.HttpRewriteRequestCycleWrapper<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.spi.RewriteProvider [org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.servlet.spi.RewriteResultHandler [org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpInboundRewriteProducer<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteProducer<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.servlet.spi.ContextListener [org.ocpsoft.rewrite.prettyfaces.PrettyConfigContextListener<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [0] org.ocpsoft.rewrite.servlet.spi.RequestListener []
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.servlet.spi.RequestParameterProvider [org.ocpsoft.rewrite.prettyfaces.PrettyFacesRequestParameterProvider<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider [org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider<30>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.spi.InvocationResultHandler [org.ocpsoft.rewrite.faces.NavigatingInvocationResultHandler<100>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [0] org.ocpsoft.common.spi.ServiceEnricher []
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.spi.ConfigurationCacheProvider [org.ocpsoft.rewrite.servlet.impl.ServletContextConfigurationCacheProvider<0>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [2] org.ocpsoft.rewrite.config.ConfigurationProvider [org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>, org.ocpsoft.rewrite.prettyfaces.PrettyFacesRewriteConfigurationProvider<1>]
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Loaded [0] org.ocpsoft.rewrite.spi.RuleCacheProvider []
""2017-08-26 07:48:36 [localhost-startStop-1] WARN  unknown.jul.logger - Cannot find classes folder: /WEB-INF/classes/
""2017-08-26 07:48:36 [localhost-startStop-1] INFO  unknown.jul.logger - Rewrite 3.4.1.Final initialized.
""2017-08-26 07:48:45 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
""2017-08-26 07:48:45 [main] INFO  o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
""2017-08-26 07:48:45 [main] INFO  org.hibernate.Version - HHH000412: Hibernate Core {5.0.12.Final}
""2017-08-26 07:48:45 [main] INFO  org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
""2017-08-26 07:48:45 [main] INFO  org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
""2017-08-26 07:48:45 [main] INFO  o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
""2017-08-26 07:48:45 [main] INFO  org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.SQLServer2012Dialect
""2017-08-26 07:48:47 [main] INFO  o.h.tool.hbm2ddl.SchemaUpdate - HHH000228: Running hbm2ddl schema update
""2017-08-26 07:48:51 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
""2017-08-26 07:48:53 [main] INFO  o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
""2017-08-26 07:48:53 [main] INFO  o.s.b.c.e.t.TomcatEmbeddedServletContainer - Tomcat started on port(s): 8080 (http)
""2017-08-26 07:48:53 [main] INFO  com.ticketbot.Ticketbot1Application - Started Ticketbot1Application in 21.55 seconds (JVM running for 22.108)
""2017-08-26 07:49:00 [http-nio-8080-exec-1] INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring FrameworkServlet 'dispatcherServlet'
""2017-08-26 07:49:00 [http-nio-8080-exec-1] WARN  unknown.jul.logger - Could not determine project stage due to underlying exception.
"java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
A typical config looks like this;
<listener>
  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

    at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:305)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225)
    at com.ocpsoft.pretty.faces.util.FacesFactory.getApplication(FacesFactory.java:30)
    at com.ocpsoft.pretty.faces2.config.reload.JSF2DevelopmentModeDetector.isDevelopmentMode(JSF2DevelopmentModeDetector.java:44)
    at com.ocpsoft.pretty.faces.config.reload.PrettyConfigReloader.isDevelopmentModeActive(PrettyConfigReloader.java:129)
    at com.ocpsoft.pretty.faces.config.reload.PrettyConfigReloader.reloadIfNecessary(PrettyConfigReloader.java:62)
    at org.ocpsoft.rewrite.prettyfaces.PrettyFacesRewriteLifecycleListener.beforeInboundLifecycle(PrettyFacesRewriteLifecycleListener.java:51)
    at org.ocpsoft.rewrite.prettyfaces.PrettyFacesRewriteLifecycleListener.beforeInboundLifecycle(PrettyFacesRewriteLifecycleListener.java:34)
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
"2017-08-26 07:49:01 [http-nio-8080-exec-1] INFO  unknown.jul.logger - Loaded [1] org.ocpsoft.rewrite.spi.GlobalParameterProvider [org.ocpsoft.rewrite.instance.WildcardParameterProvider<0>]
""2017-08-26 07:49:11 [Thread-4] INFO  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6e5e91e4: startup date [Sat Aug 26 07:48:32 CDT 2017]; root of context hierarchy
""2017-08-26 07:49:11 [Thread-4] INFO  o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown
""2017-08-26 07:49:11 [Thread-4] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
"

我在StackOverflow上搜索了这个错误的所有实例,但还没找到一个有效的解决方案。

我的POM

<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.ticketbot</groupId>
    <artifactId>ticketbot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ticketbot</name>
    <description>Ticket Bot REST API</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.6.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
<!--        <start-class>com.ticketbot.Application</start-class> -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>


        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>2.2.12</version>

        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>2.2.12</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ocpsoft.rewrite</groupId>
            <artifactId>rewrite-servlet</artifactId>
            <version>3.4.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.ocpsoft.rewrite</groupId>
            <artifactId>rewrite-integration-faces</artifactId>
            <version>3.4.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.ocpsoft.rewrite</groupId>
            <artifactId>rewrite-config-prettyfaces</artifactId>
            <version>3.4.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>6.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.12</version>
        </dependency>

    </dependencies>

    <build>
        <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>

                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <finalName>${project.artifactId}</finalName>
    </build>


</project>

的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="3.1">
    <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>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
</web-app>

faces-config.xml中

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" 
            version="2.2">
    <application>
        <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    </application>
</faces-config>

修改

我注意到,由于某种原因,在命令提示符中显示的部分消息未显示在日志文件中。此错误似乎源于tomcat-embed-core-8.5.16.jar。我附上一个错误的屏幕截图,以显示我的意思。

Screen Capture of Error Message

0 个答案:

没有答案