PrimeFaces 2 + Seam 2 integration help

UI Components for JSF
Post Reply
FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

22 Apr 2010, 19:29

I'm starting a new project. I use Seam for persistence and security and I'd like to use PrimeFaces instead of RichFaces for the view layer.

I'm getting the following exception when I perform an ajax request:

Code: Select all

22/04/2010 14:22:31 com.sun.faces.renderkit.RenderKitUtils renderHtmlErrorPage
WARNING: JSF1087: Não foi possível gerar a página de erro de Facelets porque a resposta já foi enviada.
22/04/2010 14:22:31 com.sun.faces.renderkit.RenderKitUtils renderHtmlErrorPage
SEVERE: javax.faces.FacesException
javax.faces.FacesException
	at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:136)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
	at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
	at org.jboss.seam.document.DocumentStorePhaseListener.beforePhase(DocumentStorePhaseListener.java:38)
	at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
	... 29 more
Seam: 2.2.1 CR1
PrimeFaces: 2.0.1

Any ideas?

Thanks,
Felipe

gus315
Posts: 66
Joined: 01 Dec 2009, 21:08

22 Apr 2010, 20:19

It looks that the rootId is null from Seam source code:

Code: Select all

String rootId = Pages.getViewId(phaseEvent.getFacesContext());
if (rootId.contains(DocumentStore.DOCSTORE_BASE_URL))
How about your other pages? If other pages work, it seems that your integration of PrimeFaces 2 + Seam 2 is successful.

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

22 Apr 2010, 20:29

I have only one test page to validate the configuration. It works fine with PrimeFaces 1.0.1.

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

   <h:head>

   </h:head>

   <h:body>
      <p:panel header="Teste">
         <h:form>
            <h:panelGrid>               
               <p:commandButton update="teste" action="#{testController.count}" />
               <h:outputText id="teste" value="#{testController.bean.id}" />
            </h:panelGrid>
         </h:form>
      </p:panel>
   </h:body>
</html>

gus315
Posts: 66
Joined: 01 Dec 2009, 21:08

23 Apr 2010, 01:54

I ever tried PrimeFaces 2 + Seam 2.2.1.CR1, but the integration failed due to page navigation issue on Seam 2. There are a couple of JSF 2 issues on Seam 2.2.1.CR2:
https://jira.jboss.org/jira/browse/JBSEAM-4621;
https://jira.jboss.org/jira/browse/JBSEAM-4637.

You may test a couple of page navigations on your project, and see whether you can get the same issues. Thanks.

heyoulin
Posts: 35
Joined: 29 Mar 2010, 19:49

23 Apr 2010, 16:20

In org.jboss.seam.jsf.SeamViewHandler.java

change

@Override
public UIViewRoot restoreView(FacesContext ctx, String viewId)
{
return viewHandler.restoreView(ctx, viewId);
}


to

@Override
public UIViewRoot restoreView(FacesContext ctx, String viewId)
{
UIViewRoot vr=viewHandler.restoreView(ctx, viewId);
vr.setViewId(viewHandler.deriveViewId(ctx,viewId));
return vr;
}

I think this is jsf2 bug?

gus315
Posts: 66
Joined: 01 Dec 2009, 21:08

23 Apr 2010, 18:52

Yes, maybe it is a Seam 2 bug if it is from org.jboss.seam.jsf.SeamViewHandler.java. You may create jira in the Seam JIRA site: https://jira.jboss.org/jira/browse/JBSE ... dmap-panel

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

23 Apr 2010, 20:19

gus315 wrote:I ever tried PrimeFaces 2 + Seam 2.2.1.CR1, but the integration failed due to page navigation issue on Seam 2. There are a couple of JSF 2 issues on Seam 2.2.1.CR2:
https://jira.jboss.org/jira/browse/JBSEAM-4621;
https://jira.jboss.org/jira/browse/JBSEAM-4637.

You may test a couple of page navigations on your project, and see whether you can get the same issues. Thanks.
I had the same problem from the first link. I voted for the issue.

I guess I'll have to start the project without JSF 2.

Thanks.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests