春季启动JSF 2.0应用程序以Jar

时间:2018-09-05 12:02:14

标签: maven spring-boot tomcat jsf-2

我有一个spring boot + JSF应用程序,当我们以以下方式运行它时,它会以一种魅力运行:

mvn spring-boot:run

但是,当我使用mvn clean compile package install创建一个jar时

然后运行java -jar myapp.jar

我得到:

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>

在这里建议的Web xml中,我尝试了以下三个选项:

<listener>
      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>

OR

<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener> 

OR

<listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener
        </listener-class>
    </listener>

但是错误仍然是相同的,用尽了所有想法,请多多帮助。

最佳

0 个答案:

没有答案