Seam + Portlets + JSF + Facelets problem: Exception in Phase
mzeijen Sep 1, 2006 6:02 PMI have been working on a way to get Seam working in a Portlet together with JSF and Facelets. After some hours of trying several stuff to get it all working together I thought I had the solution. But then the exception below got thrown. At first I thought that the problem was that I got the wrong value for the myFacesLifecycleBug property. But I tried true and false and both don't work (I am using myFaces 1.1.3). Any other solution I don't know. My configuration details are below the exception.
23:49:05,156 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase java.lang.IllegalStateException: No active session context at org.jboss.seam.Seam.isSessionInvalid(Seam.java:176) at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:235) at org.jboss.seam.jsf.SeamPortletPhaseListener.afterPhase(SeamPortletPhaseListener.java:87) at org.jboss.seam.jsf.SeamExtendedManagedPersistencePortletPhaseListener.afterPhase(SeamExtendedManagedPersistencePortletPhaseListener.java:53) at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391) at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:322) at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:297) at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:379) at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:265) at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167) at javax.portlet.GenericPortlet.render(GenericPortlet.java:407) at com.smies.portlet.MyFacesGenericPortlet.render(MyFacesGenericPortlet.java:51) 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.GeneratedMethodAccessor245.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.GeneratedMethodAccessor234.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.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy65.invoke(Unknown Source) at org.jboss.portal.portlet.state.producer.StatefulPortletInvoker.invoke(StatefulPortletInvoker.java:249) at sun.reflect.GeneratedMethodAccessor233.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.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy67.invoke(Unknown Source) at org.jboss.portal.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:139) at org.jboss.portal.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:155) 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.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.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy69.invoke(Unknown Source) at org.jboss.portal.portlet.test.TestPortletInvoker$1.dispatch(TestPortletInvoker.java:63) 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.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor.invoke(PortalSessionSynchronizationInterceptor.java:85) 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.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:93) 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.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:83) 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.test.TestPortletInvoker.invoke(TestPortletInvoker.java:123) at sun.reflect.GeneratedMethodAccessor227.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.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy51.invoke(Unknown Source) at org.jboss.portal.core.impl.model.instance.InstanceImpl.invoke(InstanceImpl.java:273) at org.jboss.portal.core.command.RenderWindowCommand.execute(RenderWindowCommand.java:108) at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:91) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140) at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:171) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:80) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:79) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:59) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.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.core.command.CommandContext.execute(CommandContext.java:102) at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:91) at org.jboss.portal.core.command.CommandContext.chain(CommandContext.java:148) at org.jboss.portal.core.command.MarkupCommand.renderPortletWindow(MarkupCommand.java:463) at org.jboss.portal.core.command.RenderPageCommand.renderFragments(RenderPageCommand.java:76) at org.jboss.portal.core.command.MarkupCommand.execute(MarkupCommand.java:340) at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:91) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140) at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:171) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:80) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:79) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:59) at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.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.core.command.CommandContext.execute(CommandContext.java:102) at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:91) at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:78) at org.jboss.portal.core.CoreController.handle(CoreController.java:126) at sun.reflect.GeneratedMethodAccessor235.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.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:287) at $Proxy161.handle(Unknown Source) at org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:79) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140) at org.jboss.portal.server.aspects.server.NavigationInterceptor.invoke(NavigationInterceptor.java:64) at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:65) at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:74) at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:174) at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:92) at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37) at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130) at org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49) at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79) at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:275) at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java) at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java) at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.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.server.servlet.PortalServlet.process(PortalServlet.java:294) at org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:172) 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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595)
Here are the config files:
Components.xml
<components> <component name="org.jboss.seam.core.init"> <property name="debug">true</property> <property name="myFacesLifecycleBug">false</property> <property name="jndiPattern">@jndiPattern@</property> </component> <!-- 120 second conversation timeout --> <component name="org.jboss.seam.core.manager"> <property name="conversationTimeout">120000</property> </component> <component class="org.jboss.seam.core.Ejb" installed="@embeddedEjb@"/> </components>
components.properties
embeddedEjb false jndiPattern TestPortlet/#{ejbName}/local
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd"> <faces-config> <!-- Navigation rules for the Booking demo app --> <navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>view</from-outcome> <to-view-id>/view.xhtml</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>edit</from-outcome> <to-view-id>/edit.xhtml</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>help</from-outcome> <to-view-id>/help.xhtml</to-view-id> </navigation-case> </navigation-rule> <application> <view-handler> com.sun.facelets.FaceletPortletViewHandler </view-handler> </application> <!-- Select one of the two standard persistence lifecycle models for the Seam application --> <lifecycle> <phase-listener> org.jboss.seam.jsf.SeamExtendedManagedPersistencePortletPhaseListener </phase-listener> </lifecycle> </faces-config>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app> <!-- ### Seam ############################################################################################### --> <listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <!-- Propagate conversations across redirects --> <filter> <filter-name>Seam Redirect Filter</filter-name> <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class> </filter> <filter-mapping> <filter-name>Seam Redirect Filter</filter-name> <url-pattern>*.seam</url-pattern> </filter-mapping> <filter-mapping> <filter-name>Seam Redirect Filter</filter-name> <url-pattern>*.xhtml</url-pattern> </filter-mapping> <!-- ### JSF ############################################################################################### --> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- ### MY FACES ############################################################################################### --> <context-param> <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name> <param-value>true</param-value> <description> This parameter tells MyFaces if javascript code should be allowed in the rendered HTML output. If javascript is allowed, command_link anchors will have javascript code that submits the corresponding form. If javascript is not allowed, the state saving info and nested parameters will be added as url parameters. Default: "true" </description> </context-param> <context-param> <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name> <param-value>false</param-value> <description> This parameter tells MyFaces if javascript code should be allowed in the rendered HTML output. If javascript is allowed, command_link anchors will have javascript code that submits the corresponding form. If javascript is not allowed, the state saving info and nested parameters will be added as url parameters. Default: "false" Setting this param to true should be combined with STATE_SAVING_METHOD "server" for best results. This is an EXPERIMENTAL feature. You also have to enable the detector filter/filter mapping below to get JavaScript detection working. </description> </context-param> <context-param> <param-name>org.apache.myfaces.PRETTY_HTML</param-name> <param-value>true</param-value> <description> If true, rendered HTML code will be formatted, so that it is "human readable". i.e. additional line separators and whitespace will be written, that do not influence the HTML code. Default: "true" </description> </context-param> <context-param> <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> <param-value>true</param-value> <description> If true, a javascript function will be rendered that is able to restore the former vertical scroll on every request. Convenient feature if you have pages with long lists and you do not want the browser page to always jump to the top if you trigger a link or button action that stays on the same page. Default: "false" </description> </context-param> <!-- Extensions Filter --> <filter> <filter-name>extensionsFilter</filter-name> <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class> <init-param> <param-name>uploadMaxFileSize</param-name> <param-value>100m</param-value> <description> Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> </init-param> <init-param> <param-name>uploadThresholdSize</param-name> <param-value>100k</param-value> <description> Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> </init-param> </filter> <!-- ### Faces Servlet Mapping ############################################################################################### --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.seam</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> </web-app>
The portlet implementation of the FaceletsViewHandler
package com.sun.facelets; import java.io.IOException; 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; /** * ViewHandler implementation for Facelets used in Portlets * */ public class FaceletPortletViewHandler extends FaceletViewHandler { public FaceletPortletViewHandler(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; } }
Special version of the MyFaceGenericPortlet.
/** * */ package com.smies.portlet; import java.io.IOException; import java.util.Enumeration; import javax.portlet.PortletException; import javax.portlet.PortletMode; import javax.portlet.PortletSession; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.UnavailableException; /** * */ public class MyFacesGenericPortlet extends org.apache.myfaces.portlet.MyFacesGenericPortlet { private String viewPage = null; private String editPage = null; private String helpPage = null; public void init() throws UnavailableException, PortletException { viewPage = (String) this.getInitParameter("ViewPage"); editPage = (String) this.getInitParameter("EditPage"); helpPage = (String) this.getInitParameter("HelpPage"); super.init(); } public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException { PortletSession session = request.getPortletSession(); PortletMode mode = (PortletMode) session .getAttribute("CurrentPortletMode"); if (mode == null) { mode = request.getPortletMode(); } if (mode != request.getPortletMode()) { request.setAttribute("isPortletModeChanged", Boolean.TRUE); } else { request.setAttribute("isPortletModeChanged", Boolean.FALSE); } session.setAttribute("CurrentPortletMode", mode); super.render(request, response); } protected void setDefaultView() throws UnavailableException { this.defaultView = getPortletConfig().getInitParameter(DEFAULT_VIEW); if (defaultView == null) { this.defaultView = this.viewPage; } if (defaultView == null) { String msg = "Fatal2: must specify a JSF view id as the default view in portlet.xml"; throw new UnavailableException(msg); } } protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException { Boolean isPortletModeChanged = (Boolean) request.getAttribute("isPortletModeChanged"); if (isPortletModeChanged.booleanValue()) { setPortletRequestFlag(request); nonFacesRequest(request, response, editPage); return; } facesRender(request, response); } protected void doHelp(RenderRequest request, RenderResponse response) throws PortletException, IOException { Boolean isPortletModeChanged = (Boolean) request.getAttribute("isPortletModeChanged"); if (isPortletModeChanged.booleanValue()) { setPortletRequestFlag(request); nonFacesRequest(request, response, helpPage); return; } facesRender(request, response); } }