I am using pretty faces in Jakarta Server Faces app. My POM is having following dependencies:
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>8.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-config-prettyfaces</artifactId>
<version>8.0.2.Final</version>
</dependency>
<dependency>
<groupId>com.ocpsoft</groupId>
<artifactId>prettyfaces-jsf2</artifactId>
<version>3.3.3</version>
</dependency>
First I tried with two rewrite dependencies and then tried with last one prettyfaces dependency but no one worked. All three also didn't work. It is always failing to deploy on Wildfly 30 giving following errors:
22:01:42,194 WARN [org.jboss.modules.define] (MSC service thread 1-8) Failed to define class com.ocpsoft.pretty.faces.application.PrettyViewHandler in Module "deployment.camplus.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link com/ocpsoft/pretty/faces/application/PrettyViewHandler
Not only this one error. It is giving following errors as well along with it
22:01:42,121 WARN [org.jboss.modules.define] (MSC service thread 1-8) Failed to define class com.ocpsoft.pretty.faces.application.PrettyNavigationHandler in Module "deployment.camplus.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link com/ocpsoft/pretty/faces/application/PrettyNavigationHandler
22:01:42,111 WARN [org.jboss.modules.define] (MSC service thread 1-8) Failed to define class org.ocpsoft.rewrite.faces.RewriteViewHandler in Module "deployment.camplus.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/ocpsoft/rewrite/faces/RewriteViewHandler
I have also tried by adding following in the web.xml
<filter>
<filter-name>Pretty Filter</filter-name>
<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Pretty Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
And my pretty-config.xml file is:
<pretty-config
xmlns="http://ocpsoft.org/schema/rewrite-config-prettyfaces"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.org/schema/rewrite-config-prettyfaces
http://ocpsoft.org/xml/ns/prettyfaces/rewrite-config-prettyfaces.xsd">
<url-mapping id="login">
<pattern value="/login" />
<view-id value="/Login.jsf" />
</url-mapping>
</pretty-config>
Tried everything written on the website but pretty faces are not working and also failing on deployment on Wildfly30.
Jakarta version is 10 and Java version is 21
I have resolve by using following two dependencies only
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>8.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-config-prettyfaces</artifactId>
<version>8.0.2.Final</version>
</dependency>
Also the mentioned filter should not be there in web.xml