Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Malek Tarboush
Unable to set the response
25. November 2010 13:24
Antwort

Malek Tarboush

Rang: Junior Member

Nachrichten: 30

Eintrittsdatum: 19. September 2010

Neue Beiträge

Hello

I'm trying to run jsf 2 portlet in liferay 6.0.5 CE bundled with tomcat
it worked fine but after 2 deploy i dont know why it start throw this exception

1
2The FacesServlet cannot have a url-pattern of /*. Please define a different url-pattern.


and in liferay log it is
1
2ERROR [ExternalContextImpl:1040] Unable to set the response {0} for portletResponse=[com.liferay.portlet.RenderResponseImpl] because it i
3s not a ResourceResponse.


but when i put the DebugPhaseListener class which exist in the portletfaces example
this exception is not throws and the jsf page rendered fine
just the part that i dont call managed bean !!
and also it throws exception in liferay log

 1java.lang.ClassCastException: com.liferay.portlet.ResourceResponseImpl cannot be cast to javax.servlet.http.Ht
 2        at com.sun.faces.util.OnOffResponseWrapper.<init>(OnOffResponseWrapper.java:58)
 3        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:94)
 4        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 5        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
 6        at BridgeImpl.java.doFacesRequest(BridgeImpl.java:299)
 7        at org.portletfaces.bridge.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:173)
 8        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:119)
 9        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
10        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
11        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
12        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
13        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)


i'm using portletfaces beta3 from svn
i used the beta2 and its the same

any idea about this problem ?

thankx
Neil Griffin
RE: Unable to set the response
29. November 2010 07:53
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2223

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

Malek, I looked for OnOffResponseWrapper.java in the Mojarra 2.0.4-b02 source tree but couldn't find it. What version of Mojarra are you using?
Malek Tarboush
RE: Unable to set the response
10. Dezember 2010 11:39
Antwort

Malek Tarboush

Rang: Junior Member

Nachrichten: 30

Eintrittsdatum: 19. September 2010

Neue Beiträge

Hi Neil

I'm using jsf 2.0.2 that came with netbeans 6.9.1 i think that why i have this exception

when i used 2.0.3 it didn't throw any exception
but when i click on any submit this message appear in tomcat console
1ERROR [ExternalContextImpl:1040] Unable to set the response {0}
2for portletResponse=[com.liferay.portlet.RenderResponseImpl] because it is not a ResourceResponse

and the portlet works fine after refresh the page

but when i used jsf 2.0.4b2 that came with your portlet example everything works fine
without any exception
i checked out this class OnOffResponseWrapper.java its not exist in jsf 2.0.3 nor in jsf 2.0.4

Regards
Neil Griffin
RE: Unable to set the response
13. Dezember 2010 12:15
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2223

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

OK very glad to hear it is working with Mojarra 2.0.4b2
Neil Griffin
RE: Unable to set the response
15. Februar 2011 13:33
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2223

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

Note that this same error message "Please define a different url-pattern" was reported here:

http://www.liferay.com/community/forums/-/message_boards/message/7549155

A colleague of mine happened to run into this very same error today. It was caused by the absence of a basic WEB-INF/faces-config.xml file in the portlet, like this:


1<?xml version="1.0" encoding="UTF-8"?>
2<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
3    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
5    version="2.0">
6
7</faces-config>


One might think that this file is optional with JSF 2.0, but apparently Mojarra has a dependency on the existence of this file for the FaceletViewHandlingStrategy to get instantiated properly.