-
30. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
chuaky Sep 15, 2006 7:44 PM (in response to mzeijen)dear all,
I upload the modified booking example to this place, you could download it. Please do virus scan first, i first time upload something ...
http://up-file.com/download/08cb64633889/booking.zip.html -
31. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 15, 2006 8:23 PM (in response to mzeijen)Thanks chuaky.
Tried this and now got it working to the point of registering in the app apparently ok. I have also upgraded to portal 2.4.0GA.
When logging in with the new account I get
2006-09-16 01:12:46,767 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager
2006-09-16 01:12:46,767 DEBUG [org.jboss.seam.core.Manager] Found conversation id in request parameter: 8
2006-09-16 01:12:46,767 DEBUG [org.jboss.seam.core.Manager] Restoring conversation with id: 8
2006-09-16 01:12:46,767 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init
2006-09-16 01:12:46,767 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(8)
2006-09-16 01:12:47,128 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
2006-09-16 01:12:47,128 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
2006-09-16 01:12:47,128 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
2006-09-16 01:12:47,138 ERROR [STDERR] 16-Sep-2006 01:12:47 com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/main.xhtml]
java.lang.IllegalArgumentException: URL must be absolute. Was: main.seam
at org.jboss.portal.common.util.URLTools.enforceAbsoluteURL(URLTools.java:65)
at org.jboss.portal.portlet.impl.spi.AbstractInvocationContext.encodeURL(AbstractInvocationContext.java:49)
at org.jboss.portal.portlet.impl.jsr168.PortletResponseImpl.encodeURL(PortletResponseImpl.java:53)
at org.apache.myfaces.context.portlet.PortletExternalContextImpl.encodeResourceURL(PortletExternalContextImpl.java:197)
at org.apache.myfaces.renderkit.html.HtmlLinkRendererBase.renderOutputLinkStart(HtmlLinkRendererBase.java:381)
at org.apache.myfaces.renderkit.html.HtmlLinkRendererBase.encodeBegin(HtmlLinkRendererBase.java:95)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:307)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:540)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:396)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:519)
at org.jboss.portal.portlet.container.PortletContainer.dispatch(PortletContainer.java:440)
at org.jboss.portal.portlet.container.PortletContainerInvoker$1.dispatch(PortletContainerInvoker.java:143)
at org.jboss.portal.portlet.invocation.PortletInvocation.dispatch(PortletInvocation.java:242)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:85)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_4827075286966232824.invokeNext(TransactionInterceptor$invokeNotSupported_4827075286966232824.java)
at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:101)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_4827075286966232824.invokeNext(TransactionInterceptor$invokeNotSupported_4827075286966232824.java)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeNotSupported(TransactionInterceptor.java)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:49)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor.invoke(ProducerCacheInterceptor.java:50)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.ModesInterceptor.invoke(ModesInterceptor.java:59)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:45)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:55)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor.invoke(PortletSessionSynchronizationInterceptor.java:76)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java:124)
at sun.reflect.GeneratedMethodAccessor232.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:104)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:539)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.jboss.portal.portlet.impl.spi.AbstractRequestContext.include(AbstractRequestContext.java:193)
at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$1.include(ContextDispatcherInterceptor.java:68)
at org.jboss.portal.server.servlet.CommandServlet.include(CommandServlet.java:84)
at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:74)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:50)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:65)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.portlet.aspects.portlet.ValveInterceptor.invoke(ValveInterceptor.java:61)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
at org.jboss.portal.portlet.container.PortletContainerInvoker.invoke(PortletContainerInvoker.java:114)
at sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanO
in the log file
So some progress, but not quite there yet.
Anyone any ideas?
Andy. -
32. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 15, 2006 8:46 PM (in response to mzeijen)Ok, found the problem. The template.xhtml file contains
<h:form>
Welcome #{user.name}
| <h:outputLink value="main.seam">Search</h:outputLink>
| <h:outputLink value="password.seam">Settings</h:outputLink>
| <h:commandLink action="#{logout.logout}">Logout</h:commandLink>
</h:form>
this needs to change to
<h:form>
Welcome #{user.name}
| <h:outputLink value="/main.seam">Search</h:outputLink>
| <h:outputLink value="/password.seam">Settings</h:outputLink>
| <h:commandLink action="#{logout.logout}">Logout</h:commandLink>
</h:form> -
33. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 15, 2006 9:22 PM (in response to mzeijen)Time to give up this evening - Thanks Chuaky. I have managed to get a good part of it working. Still some errors when searching for hotels, but I think that could be a database issue, with luck.
-
34. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
sohui_gu Sep 18, 2006 3:36 AM (in response to mzeijen)I am having the same error. what to do?
-
35. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 18, 2006 4:46 AM (in response to mzeijen)If you mean the the Exception in PhaseListener problem - the main subject of this thread - check that you do not have StartupServletContextListener listed in web.xml. The last error I saw was in the cookie crum code as specified above and I got around it by making it an absolute reference, as stated above. However, I don't thnk that is a fix and the app probably needs some re-engineering to work as a portlet. There are several differences between the booking and portlet examples. Still learning this myself.
Andy. -
36. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
mzeijen Sep 18, 2006 5:45 AM (in response to mzeijen)Also make sure that you don't put the myFaces lib into you WEB-INF lib directory. In the tld file within that library there is also a directive that initializes MyFaces.
-
37. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
jjarkko Sep 22, 2006 10:04 AM (in response to mzeijen)Combining SeamFaceletViewHandler and com.sun.facelets.FaceletPortletViewHandler allowed me to take a next step forward in making JSF+myfaces+portlets+seam together:
/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.seam.ui.facelet; import java.io.IOException; import java.io.Writer; import javax.faces.FacesException; import javax.faces.application.ViewHandler; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import javax.faces.render.RenderKit; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; /** * This class just extends the SeamFaceletViewHandler to support Portlet usage of Facelets. * * * Merge of SeamFaceletViewHandler and com.sun.facelets.FaceletPortletViewHandler * * @author Jarkko Lietolahti */ public class SeamPortletFaceletViewHandler extends SeamFaceletViewHandler { public SeamPortletFaceletViewHandler(ViewHandler parent) { super(parent); } protected ResponseWriter createResponseWriter(FacesContext context) throws IOException, FacesException { ExternalContext extContext = context.getExternalContext(); RenderKit renderKit = context.getRenderKit(); RenderRequest request = (RenderRequest) extContext.getRequest(); RenderResponse response = (RenderResponse) extContext.getResponse(); String contenttype = request.getResponseContentType(); if (contenttype == null) { contenttype = "text/html"; } String encoding = response.getCharacterEncoding(); if (encoding == null) { encoding = "ISO-8859-1"; } ResponseWriter writer = renderKit.createResponseWriter( NullWriter. Instance, contenttype, encoding); contenttype = writer.getContentType(); // apply them to the response response.setContentType(contenttype); // Now, clone with the real writer writer = writer.cloneWithWriter(response.getWriter()); return writer; } protected static class NullWriter extends Writer { static final NullWriter Instance = new NullWriter(); public void write(char[] buffer) { } public void write(char[] buffer, int off, int len) { } public void write(String str) { } public void write(int c) { } public void write(String str, int off, int len) { } public void close() { } public void flush() { } } }
-
38. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 22, 2006 5:10 PM (in response to mzeijen)thanks, I'll try it out. Having problems finding SeamFaceletViewHandler. Is this in cvs head?
-
39. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 22, 2006 6:03 PM (in response to mzeijen)No matter, my bad, I must have had an old version of seam around. found it in 1.0.1 GA
-
40. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 25, 2006 4:52 PM (in response to mzeijen)Ok, so I have something working now, but I have problems accessing images in a portlet WAR file. I see some of the JSF based portlets in the main portal deployment include a call to getContext() to merge the front of the URL to the image name. Any idea how you view images with facelets i a portlet?
Thanks, Andy. -
41. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 26, 2006 10:41 AM (in response to mzeijen)Ok, so usually no response would indicate either no-one knows, I'm being an idiot or the question has been answered somewhere else. If anyone has an answer (which is pretty well leaving myself open to being called an idiot, I know) I'd be grateful for a pointer, as this is somewhat eluding me. I guess this is still a seam subject as I graphics seem to work with other view technologies. Should I just be able to use an img tag? Maybe I have a config problem?
Andy. -
42. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
gavin.king Sep 26, 2006 10:43 AM (in response to mzeijen)Well, its nothing to do with Seam. Ask in a facelets or JSF list.
-
43. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
andyd Sep 26, 2006 2:13 PM (in response to mzeijen)Thanks Gavin will do. By the way, I'm impressed with how Seam has come along in the last year. you guys have something to be proud about.
Andy. -
44. Re: Seam + Portlets + JSF + Facelets problem: Exception in P
gavin.king Sep 26, 2006 2:54 PM (in response to mzeijen)Thanks :-)