Exception occurred while accessing jsf page: Servlet.service() for servlet default threw exception: java.lang.NoSuchMethodError

StackOverflow https://stackoverflow.com/questions/22769334

Question

I'm trying to develop a web application using following technologies JSF 2.0 , EJB 3, JPA, Maven.. It's based on MVC design pattern so I have 3 projects so far: one is an EJB project which contains business and model, the second one is the view part which contains JSF and all beans that will be used in JSF pages and the third one is an EAR projects used to unite previous project that I mentioned.

So far I made a simple app and the EAR Project was deployed successfully in JBoss 7 but whenever I try to access a page I get the following exception:

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

I want to mention that I'm not so familiar with these technologies.

Please let me know if you want to give you additional info such as maven dependencies or whatever you think that it can cause this error.

I have the following dependencies related to prettyfaces:

<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> 
Était-ce utile?

La solution

I guess that the prettyfaces-core is missing, try to add this dependency :

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

I'm not sure about it, if it doesn't work, try the depedencies listed in the link below

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top