java.lang.NoSuchMethodError: com.ocpsoft.pretty.faces.beans.ExtractedValuesURLBu

Splash Forums PrettyFaces Users java.lang.NoSuchMethodError: com.ocpsoft.pretty.faces.beans.ExtractedValuesURLBu

This topic contains 2 replies, has 2 voices, and was last updated by  Lucky 1 year, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27086

    Lucky
    Participant

    java.lang.NoSuchMethodError: com.ocpsoft.pretty.faces.beans.ExtractedValuesURLBuilder.build(…)
    When I use <h:form> in my search results page

    Here are my configuration details
    web.xml

    <context-param>
      <param-name>com.ocpsoft.pretty.DEVELOPMENT</param-name>
      <param-value>true</param-value>
    </context-param>
      

    ` <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>

    Using Jars
    prettyfaces-jsf2-3.1.0.jar
    prettyfaces-core-3.3.2.jar

    pretty-config.xml

    <url-mapping id="mySearch-result">
    	<pattern value="/#{mySearchMBean.addressId}/"/>
    	<view-id value="/pages/mySearch-result.xhtml"/> 
    	<action>#{mySearchMBean.doLookupForAddress}</action>
    </url-mapping>

    mySearch.xhtml

    <h:form>
        		Search Address by id:<br />
    			<h:inputText value="#{mySearchMBean.addressId}" /><br />
    			 <h:commandButton type="submit" value="Submit"  action="pretty:mySearch-result" inclueViewParams="true">
    			 </h:commandButton>
    		</h:form>

    ManagedBean action method

    @ManagedBean(name="mySearchMBean")
    @RequestScoped
    public class MySearchMBean {
    public String doLookupForAddress() {
        	MySearchDAO dao = new MySearchDAO();
        	adresss = dao.findAddressById(addressId);
             System.out.println("doLookupForAddres");
            return "mySearch-result";
        }
    }

    mySearch-result.xhtml

    <strong><h:form></strong>
    <p><b>ADDRESS ID:</b> ${mySearchMBean.adresss.addressId}</p>
    <p><b>NAME:</b> ${mySearchMBean.adresss.name}</p>
    <p><b>STREET:</b> ${mySearchMBean.adresss.street}</p>
    <p><b>LOCATION:</b> ${mySearchMBean.adresss.location}</p>
    <p><b>ZIP:</b> ${mySearchMBean.adresss.zip}</p>
    
    <strong><h:form></strong>
    

    If I use h:form in mySearch-results.xhtml page its thowing exception with the root cause as below

    java.lang.NoSuchMethodError: com.ocpsoft.pretty.faces.beans.ExtractedValuesURLBuilder.build(Lcom/ocpsoft/pretty/faces/config/mapping/UrlMapping;)Ljava/lang/String;
    	com.ocpsoft.pretty.faces.application.PrettyViewHandler.getActionURL(PrettyViewHandler.java:124)
    	javax.faces.application.ViewHandlerWrapper.getActionURL(ViewHandlerWrapper.java:189)
    	javax.faces.application.ViewHandlerWrapper.getActionURL(ViewHandlerWrapper.java:189)+
    
    

    If I removed <h:form> from the page its working fine.

    I am New to the Prettyfaces,
    Am I missing anything? Is my configuration and url mapping are correct?
    Thanks

    • This topic was modified 1 year, 3 months ago by  Lucky.
    #27088

    You have different PrettyFaces versions for the core and jsf2 modules. You should update both to 3.3.3.

    #27089

    Lucky
    Participant

    Wow! Excellent, I updated both jar’s with same 3.3 version its working now.
    Thanks Christian for your quick response.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.