标签: facesservlet

java.lang.ClassFormatError:在类文件javax/faces/webapp/FacesServlet中不是本机或抽象的方法中的Absent Code属性

我想在Tomcat 7中使用Mojarra 2.1,所以我在我的pom文件中添加了以下依赖项:

<dependency>
       <groupId>com.sun.faces</groupId>
       <artifactId>jsf-api</artifactId>
       <version>2.1.2</version>
     </dependency>

     <dependency>
       <groupId>com.sun.faces</groupId>
       <artifactId>jsf-impl</artifactId>
       <version>2.1.2</version>
     </dependency>
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试启动Tomcat时,我遇到以下异常:

org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8007]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
    ... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
    ... 9 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at …
Run Code Online (Sandbox Code Playgroud)

jsf tomcat maven facesservlet classformaterror

15
推荐指数
4
解决办法
5万
查看次数

FacesServlet无法在Web片段中工作

我有两个Web应用程序(web-module1.war和web-module2.war),我想使用Web片段(web-core.jar)进行常见的servlet声明,如FacesServlet.

当我在web.xml中声明FacesServlet没问题,但是当我将此声明移动到web-fragment.xml时,我收到此错误:

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 …
Run Code Online (Sandbox Code Playgroud)

myfaces jsf-2 facesservlet web-fragment

2
推荐指数
1
解决办法
700
查看次数