代码之家  ›  专栏  ›  技术社区  ›  eduarde

访问jsf页时发生异常:Servlet默认值的Servlet.service()引发异常:java.lang.NoSuchMethodError

  •  0
  • eduarde  · 技术社区  · 10 年前

    我正在尝试使用以下技术开发web应用程序JSF 2.0、EJB3、JPA、Maven。。它基于MVC设计模式,所以到目前为止我有3个项目:一个是包含业务和模型的EJB项目,第二个是包含JSF和所有将在JSF页面中使用的bean的视图部分,第三个是用于合并我提到的前一个项目的EAR项目。

    到目前为止,我制作了一个简单的应用程序,EAR项目在JBoss 7中成功部署,但每当我尝试访问页面时,我都会遇到以下异常:

    Servlet.service() for servlet default threw exception: java.lang.NoSuchMethodError: com.ocpsoft.pretty.PrettyContext.newDetachedInstance(Ljavax/servlet/http/HttpServletRequest;)Lcom/ocpsoft/pretty/PrettyContext;
    

    我想提的是,我对这些技术不是很熟悉。

    请让我知道,如果你想给你额外的信息,如maven依赖关系或你认为可能导致此错误的任何信息。

    我有以下与漂亮面孔相关的依赖关系:

    <dependency>
        <groupId>com.ocpsoft</groupId>
        <artifactId>ocpsoft-pretty-faces</artifactId>
        <version>2.0.3</version>
    </dependency>
    
    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
            <artifactId>rewrite-servlet</artifactId>
        <version>2.0.11.Final</version>
    </dependency>
    
    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
        <artifactId>rewrite-integration-faces-annotations</artifactId>
        <version>2.0.0.Alpha5</version>
    </dependency>
    
    
    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
        <artifactId>rewrite-config-prettyfaces</artifactId>
        <version>2.0.11.Final</version>
    </dependency> 
    
    1 回复  |  直到 10 年前
        1
  •  0
  •   Bylox    10 年前

    我猜缺少prettyfaces核心,请尝试添加此依赖项:

     <dependency>
        <groupId>com.ocpsoft</groupId>
        <artifactId>prettyfaces-core</artifactId>
        <version>3.0.0</version>
      </dependency>
    

    我不确定,如果它不起作用,请尝试下面链接中列出的部门

    http://mavenhub.com/c/com/ocpsoft/pretty/prettycontext