Olá!
Estou começando em Java e utilizo JSF + Richfaces + Hibernate 3 + Spring 2.5
Estamos migrando de Richfaces para PrimeFaces, entretanto, já foi lançado o primeFaces 2.0 que requer o JSF 2.0
Até aí, OK. baixei o jsf-api.jar e jsf-impl.jar e coloquei no meu BuildPath.
Alterei meu faces-config para 2.0 e tirei o <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
pois não é mais necessário com JSF2
No web.xml faço uma referência ao bid-data.xml onde coloco toda configuração do Spring 2.5
Tudo funcionando normalmente.
Porém, quando criei minha página de login, ao apertar o botão do PrimeFaces(<p:commandButton />) recebo um erro dizendo que o viewId é nulo.
Depois de pesquisar MUITO ( 2 dias) desconfio que o Spring 2.5 não seja compatível com o JSF 2.0[size=18] [/size]…será possível?
Terei que migrar do Spring 2.5 para 3? Nesse caso, como o Spring 3 ainda é uma versão RC, eu não arriscaria…
Aqui está meu faces-config:
[code]<?xml version="1.0" encoding="UTF-8"?>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
<locale-config>
<default-locale>pt_BR</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<message-bundle>messages</message-bundle>
<navigation-rule>
<from-view-id>/tools/formLogin.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/tools/index.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/tools/formForgotPassword.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/tools/forgotPasswordSuccess.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
[/code]
E aqui está um pedacinho do bid-data com as configs do Spring 2.5…
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.0.xsd">
E aqui está o erro:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Erro de argumento: O parâmetro viewId é nulo
javax.faces.webapp.FacesServlet.service(FacesServlet.java:323)
br.com.webtraffic.big.filter.ExpireFilter.doFilter(ExpireFilter.java:27)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
br.com.webtraffic.big.controller.authorization.AuthorizationViewRedirectionFilter.doFilter(AuthorizationViewRedirectionFilter.java:24)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause
java.lang.NullPointerException: Erro de argumento: O parâmetro viewId é nulo
com.sun.faces.util.Util.notNull(Util.java:221)
com.sun.faces.application.view.MultiViewHandler.getActionURL(MultiViewHandler.java:270)
org.springframework.faces.webflow.FlowViewHandler.getActionURL(FlowViewHandler.java:50)
com.sun.faces.renderkit.html_basic.FormRenderer.getActionStr(FormRenderer.java:234)
com.sun.faces.renderkit.html_basic.FormRenderer.encodeBegin(FormRenderer.java:137)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:823)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1608)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:415)
com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:204)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:90)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:311)
br.com.webtraffic.big.filter.ExpireFilter.doFilter(ExpireFilter.java:27)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
br.com.webtraffic.big.controller.authorization.AuthorizationViewRedirectionFilter.doFilter(AuthorizationViewRedirectionFilter.java:24)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
Por favor, se alguém souber de alguma incompatibilidade ou também lida com primeFaces, divida suas experincias…
Obrigada!