Problem with PostBack while using PrettyFaces

Splash Forums PrettyFaces Users Problem with PostBack while using PrettyFaces

This topic contains 13 replies, has 3 voices, and was last updated by  Christian Kaltepoth 9 years, 11 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #18148

    Lakshmi
    Participant

    Hi,

    We have configured a simple signOn page using pretty faces:

    Pretty-config.xml:

    <url-mapping id=”signOn”>

    <pattern value=”/psl/signOn” />

    <view-id value=”/signOn.faces” />

    </url-mapping>

    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>/psl/*</url-pattern>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    </filter-mapping>

    Our application is using JSF1.2 and Pretty Faces 3.3.2

    The SignOn page is loaded when we try for the first time. Second time if we try without clearing the cookies, it throws the following execption:

    [2/7/12 4:50:19:134 CST] 00000039 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: Faces Servlet. Exception thrown : java.lang.NoSuchMethodError: javax/faces/render/ResponseStateManager.isPostback(Ljavax/faces/context/FacesContext;)Z

    at com.ocpsoft.pretty.faces.util.FacesStateUtils.isPostback(FacesStateUtils.java:35)

    at com.ocpsoft.pretty.faces.beans.ParameterInjector.injectQueryParams(ParameterInjector.java:106)

    at com.ocpsoft.pretty.faces.beans.ParameterInjector.injectParameters(ParameterInjector.java:55)

    at com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(PrettyPhaseListener.java:102)

    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)

    We tried including jsf-api1.2_02.jar which contains the method ResponseStateManager.isPostback(). Still we faced the same error.

    Please let us know how can configure PostBack request.

    #22054

    Looks like you are packaging the wrong JAR files for JSF with your application. Which container do you deploy to. Could you post the contents of your /WEB-INF/lib directory?

    #22055

    You need to include the PrettyFaces JSF1.2 JAR. It looks like you have included PrettyFaces 2.0 JAR?

    com.ocpsoft:prettyfaces-jsf12:${version}

    vs.

    com.ocpsoft:prettyfaces-jsf2:${version}

    #22056

    Lakshmi
    Participant

    hi Lincoln,

    We are using prettyfaces-jsf1.2.jar only

    hi christian,

    The contents in our web-inf/lib are

    appreuse.jar

    aspectjrt.jar

    aspectjweaver.jar

    bhawk4j.jar

    commons-beanutils.jar

    commons-chain-1.1.jar

    commons-codec-1.3.jar

    commons-collections-3.1.jar

    commons-digester-1.8.jar

    commons-discovery-0.2.jar

    commons-fileupload-1.2.jar

    commons-httpclient-3.1.jar

    commons-io-1.3.2.jar

    commons-lang-2.3.jar

    commons-logging-1.0.4.jar

    cryptix32.jar

    easymock.jar

    el-api-1.0.jar

    el-impl-1.0.jar

    icu4j_3_4_1.jar

    jsf-api-1.2_02.jar

    jsf-facelets.jar

    jsf-ibm.jar

    junit-4.4.jar

    MiddlewareClient4.jar

    myfaces-api-1.2.0.jar

    ojdbc14.jar

    oscache-2.1.jar

    prettyfaces-jsf12-3.3.2.jar

    restfaces-1.2.jar

    richfaces-api-3.1.6.GA.jar

    richfaces-impl-3.1.6.GA.jar

    richfaces-ui-3.1.6.GA.jar

    spring.jar

    tiles-api-2.0.5.jar

    tiles-core-2.0.5.jar

    tiles-jsp-2.0.5.jar

    yuicompressor-2.4.2.jar

    #22057

    Your packaging doesn’t look good. There are several files that doesn’t belong there.

    IMHO you can remove the following files because the EL API and implementation are provided by all the servlet containers:

    el-api-1.0.jar
    el-impl-1.0.jar

    You are also deploying multiple versions of the JSF API:

    jsf-api-1.2_02.jar
    myfaces-api-1.2.0.jar

    And I don’t know what jsf-ibm.jar is.

    You should definitively clean up your packaging. What container do you deploy to? If the container doesn’t ship with a JSF implementation (like Tomcat or Jetty) just include a single version of the JSF API and implementation. Which files you need depends on the JSF implementation you want to use (MyFaces or Mojarra).

    This should do the trick.

    Christian

    #22058

    You are also including restfaces.jar which is another URL-manipulation framework. I recommend removing this if it is not in use. (Perhaps you are migrating from it?)

    #22059

    Lakshmi
    Participant

    hi,

    I have tried to remove these jar el-api-1.0.jar,el-impl-1.0.jar.But the application throws error.

    Also i ve tried to decompile the jar and put the code in my project.But it also throw some compatibility issue.

    Any suggestions?

    Our Web container is Websphere 6.1

    #22060

    Could you explain “the application throws error” a bit more. Which error?

    #22061

    If you are using Websphere 6.1, then I would be surprised if you are actually on JSF 1.2. Can you verify this? I am pretty sure that WAS 6.1 comes with JSF 1.1 (a very odd IBM version of it, at that.)

    If that is the case, then you need to use PrettyFaces 1.1.

    #22062

    Lakshmi
    Participant

    hi,

    I ve replaced pretty faces 1.2 jar with pretty faces 1.1 jar.The app throws the followin exception

    [2/16/12 9:07:35:227 CST] 0000003d ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: Faces Servlet. Exception thrown : java.lang.NullPointerException

    at com.lxnx.ols.pag.instrumentation.PagKeyEventDataCollectorUtils.getDataCollector(PagKeyEventDataCollectorUtils.java:311)

    at com.lxnx.ols.pag.instrumentation.PagKeyEventDataCollectorUtils.collectBeforePhaseInfo(PagKeyEventDataCollectorUtils.java:129)

    at com.lxnx.ols.pag.instrumentation.PagInstrumentationPhaseListener.beforePhase(PagInstrumentationPhaseListener.java:22)

    at org.springframework.web.jsf.DelegatingPhaseListenerMulticaster.beforePhase(DelegatingPhaseListenerMulticaster.java:75)

    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)

    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)

    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)

    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)

    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)

    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)

    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)

    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)

    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:75)

    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)

    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)

    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)

    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)

    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)

    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)

    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)

    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)

    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)

    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)

    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)

    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)

    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)

    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:290)

    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:984)

    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInboundPostHandshake(SSLConnectionLink.java:678)

    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInbound(SSLConnectionLink.java:533)

    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.ready(SSLConnectionLink.java:267)

    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)

    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)

    at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)

    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)

    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)

    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)

    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)

    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)

    If i use pretty faces 1.2 for first request it works fine but for pretty faces 1.1 it throws the above error

    Any suggestions

    #22063

    Lakshmi
    Participant

    Do we need to configure servlet mapping in web.xml?

    #22064

    Could you please verify which version of JSF your application server ships with? Actually I don’t know Websphere very much, so I don’t know that.

    The exception you posted looks very weird. Could you please also post your current content of /WEB-INF/lib?

    #22065

    Lakshmi
    Participant

    hi,

    appreuse.jar

    aspectjrt.jar

    aspectjweaver.jar

    bhawk4j.jar

    commons-beanutils.jar

    commons-chain-1.1.jar

    commons-codec-1.3.jar

    commons-collections-3.1.jar

    commons-digester-1.8.jar

    commons-discovery-0.2.jar

    commons-fileupload-1.2.jar

    commons-httpclient-3.1.jar

    commons-io-1.3.2.jar

    commons-lang-2.3.jar

    commons-logging-1.0.4.jar

    cryptix32.jar

    easymock.jar

    el-api-1.0.jar

    el-impl-1.0.jar

    icu4j_3_4_1.jar

    jsf-facelets.jar

    junit-4.4.jar

    MiddlewareClient4.jar

    ojdbc14.jar

    oscache-2.1.jar

    prettyfaces-jsf11-3.3.2.jar

    restfaces-1.2.jar

    richfaces-api-3.1.6.GA.jar

    richfaces-impl-3.1.6.GA.jar

    richfaces-ui-3.1.6.GA.jar

    spring.jar

    tiles-api-2.0.5.jar

    tiles-core-2.0.5.jar

    tiles-jsp-2.0.5.jar

    yuicompressor-2.4.2.jar

    list of jars in lib folder

    #22066

    As far as I understand you are using Websphere 6.1 which comes with a bundled Mojarra 1.1 JSF implementation, correct? In this cases you may be right and you will need to include el-api and el-impl in the WAR file.

    So your packaging looks much better now. But I’ve no idea about the NPE you are seeing. Do you have any idea what PagKeyEventDataCollectorUtils is? I searched the internet for this class but found NOTHING. Is it a class of you application?

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

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.