5 Replies Latest reply on Feb 5, 2010 8:23 AM by Marko Strukelj

    How to use GateIn JCR integration in my portlet?

    null null Newbie

      Hello

      I try to write the portlet using SEAM framework running on jboss GateIn beta5 that use JCR(exo JCR) of GateIn and I met an error when run it

      09:18:28,906 WARN  [MCIntegrationContainer] MC integration failed - maybe not supported in this environment (component: class org.exoplatform.container.ExoContainerContext)
      java.lang.RuntimeException: MC Integration initialization error
              at org.exoplatform.container.mc.MCIntegrationInvoker.getMCIntegration(MCIntegrationInvoker.java:138)
              at org.exoplatform.container.mc.MCIntegrationInvoker.hasMCKernel(MCIntegrationInvoker.java:77)
              at org.exoplatform.container.mc.MCIntegrationContainer.hasMCKernel(MCIntegrationContainer.java:121)
              at org.exoplatform.container.mc.MCIntegrationContainer.registerComponent(MCIntegrationContainer.java:94)
              at org.exoplatform.container.CachingContainer.registerComponent(CachingContainer.java:178)
              at org.exoplatform.container.management.ManageableContainer.registerComponent(ManageableContainer.java:169)
              at org.picocontainer.defaults.DefaultPicoContainer.registerComponentInstance(DefaultPicoContainer.java:220)
              at org.exoplatform.container.CachingContainer.registerComponentInstance(CachingContainer.java:197)
              at org.exoplatform.container.management.ManageableContainer.registerComponentInstance(ManageableContainer.java:175)
              at org.picocontainer.defaults.DefaultPicoContainer.registerComponentInstance(DefaultPicoContainer.java:197)
              at org.exoplatform.container.CachingContainer.registerComponentInstance(CachingContainer.java:190)
              at org.exoplatform.container.ExoContainer.<init>(ExoContainer.java:89)
              at org.exoplatform.container.RootContainer.<init>(RootContainer.java:87)
              at org.exoplatform.container.RootContainer.buildRootContainer(RootContainer.java:385)
              at org.exoplatform.container.RootContainer.getInstance(RootContainer.java:440)
              at org.exoplatform.container.ExoContainerContext.getTopContainer(ExoContainerContext.java:110)
              at org.exoplatform.container.ExoContainerContext.getCurrentContainer(ExoContainerContext.java:126)
              at bull.com.orderform.session.JcrDocumentBean.jcrDocument(JcrDocumentBean.java:108)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:592)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at

      This is my Code

             @In(value="#{facesContext}")
          FacesContext facesContext;

      public void jcrDocument()
          {
              this.value = "DEFAULT";
              HttpServletRequest httpRequest = (HttpServletRequest) facesContext.getExternalContext().getRequest();
              JCRBrowser jcrBrowser = (JCRBrowser) httpRequest.getSession().getAttribute("browser");

              ExoContainer container = (ExoContainer) httpRequest.getSession()
                                                                 .getServletContext()
                                                                 .getAttribute("org.exoplatform.frameworks.web.eXoContainer");
              if (container == null) {
                  String portalName = httpRequest.getSession().getServletContext().getServletContextName();
                  container = ExoContainerContext.getCurrentContainer();
                }

                SessionProviderService sessionProviderService = (SessionProviderService) container.getComponentInstanceOfType(SessionProviderService.class);

                RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);

                ManageableRepository repository;
              try {
                  repository = repositoryService.getDefaultRepository();
                  Session jcrSession = sessionProviderService.getSessionProvider(null)
                  .getSession(repository.getConfiguration()
                                        .getDefaultWorkspaceName(),
                              repository);
                  System.out.print("\n--START-->repository.getConfiguration "+repository.getConfiguration()
                      .getDefaultWorkspaceName());
              } catch (LoginException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (NoSuchWorkspaceException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (RepositoryException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (RepositoryConfigurationException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }

      }

      I don't know how to use the exo JCR in my portlet. Can someone tell me what exactly I have to do?

       

      Best regards

      HieuHN

        • 1. Re: How to use GateIn JCR integration in my portlet?
          Marko Strukelj Master

          The stack trace that you see, while annoying or even intimidating, is just a warning of certain functionality (that's not part of the public API) not being available. It shouldn't impact your application in any way.

           

          You can turn off the logging by configuring your logging for org.exoplatform.container.mc.MCIntegrationContainer to ERROR or above.

          Most interesting for me is why you would get that error in the first place.

           

          From your stack trace I see that you call:

           

          container = ExoContainerContext.getCurrentContainer();

           

          It's this line that triggers initialization of RootContainer, which should have gotten initialized much earlier through some other (more proper) code triggers.

           

          It might be packaging issue.

           

          Can you describe more precisely how you package and deploy your application - how you name your deployment archive, where you put it, how you configure the portlet bridge, do you remove any original .ear/.jar files from deploy dir ...

           

           

          Cheers,

           

          - marko

          • 2. Re: How to use GateIn JCR integration in my portlet?
            Thomas Heute Master
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
            repository = repoService.getRepository(REPOSITORY_NAME);
            

             

            Should have been enough. Let us know if you succeed/still have issues.

            • 3. Re: How to use GateIn JCR integration in my portlet?
              null null Newbie

              Hi Marko Strukelj and Thomas Heute,http://community.jboss.org/people/mstruk

               

              Thanks for all your help

              I try to use follow your suggest and I meet error. My portlet can run directly (http://localhost:8080/OrderForm/home.xhtml) or run as portlet in GateIn. I add attach file below is my portlet configuration and code for more detail.

              10:36:24,015 SEVERE [application] java.lang.ClassCastException: org.gatein.pc.portlet.impl.jsr168.api.ActionRequestImpl
              javax.faces.el.EvaluationException: java.lang.ClassCastException: org.gatein.pc.portlet.impl.jsr168.api.ActionRequestImpl
                      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                      at javax.faces.component.UICommand.broadcast(UICommand.java:387)
                      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
                      at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
                      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
                      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)
                      at org.jboss.portletbridge.lifecycle.InvokeApplicationPhase.executePhase(InvokeApplicationPhase.java:57)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:72)
                      at org.jboss.portletbridge.lifecycle.UpdateModelPhase.executeNextPhase(UpdateModelPhase.java:49)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.ProcessValidatorsPhase.executeNextPhase(ProcessValidatorsPhase.java:50)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.ApplyValuesPhase.executeNextPhase(ApplyValuesPhase.java:50)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.RestoreViewPhase.executeNextPhase(RestoreViewPhase.java:72)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:62)
                      at org.jboss.portletbridge.lifecycle.PortletLifecycle.execute(PortletLifecycle.java:114)
                      at org.jboss.portletbridge.AjaxPortletBridge.execute(AjaxPortletBridge.java:1078)
                      at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:391)
                      at javax.portlet.faces.GenericFacesPortlet.processAction(GenericFacesPortlet.java:526)
                      at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:557)
                      at org.gatein.pc.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:109)
                      at org.gatein.pc.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:72)
                      at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:505)
                      at org.gatein.pc.portlet.container.ContainerPortletDispatcher.invoke(ContainerPortletDispatcher.java:42)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.EventPayloadInterceptor.invoke(EventPayloadInterceptor.java:196)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.RequestAttributeConversationInterceptor.invoke(RequestAttributeConversationInterceptor.java:119)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.CCPPInterceptor.invoke(CCPPInterceptor.java:65)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:49)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor.access$001(ContextDispatcherInterceptor.java:49)
                      at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:123)
                      at org.gatein.wci.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:82)
                      at sun.reflect.GeneratedMethodAccessor658.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:592)
                      at org.gatein.wci.command.CommandServlet.doGet(CommandServlet.java:135)
                      at org.gatein.wci.command.CommandServlet.doPost(CommandServlet.java:166)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
                      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:543)
                      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:480)
                      at org.gatein.wci.command.CommandServlet.include(CommandServlet.java:84)
                      at org.gatein.wci.command.CommandDispatcher.include(CommandDispatcher.java:58)
                      at org.gatein.wci.tomcat.TC6ServletContainerContext.include(TC6ServletContainerContext.java:87)
                      at org.gatein.wci.impl.DefaultServletContainer.include(DefaultServletContainer.java:191)
                      at org.gatein.pc.portlet.impl.spi.AbstractServerContext.dispatch(AbstractServerContext.java:69)
                      at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:77)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:69)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.ValveInterceptor.invoke(ValveInterceptor.java:75)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.container.ContainerPortletInvoker.invoke(ContainerPortletInvoker.java:117)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:230)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.PortletCustomizationInterceptor.invoke(PortletCustomizationInterceptor.java:76)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:229)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:152)
                      at org.gatein.pc.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:173)
                      at org.exoplatform.portal.webui.application.UIPortlet.invoke(UIPortlet.java:886)
                      at org.exoplatform.portal.webui.application.UIPortletActionListener$ProcessActionActionListener.execute(UIPortletActionListener.java:98)
                      at org.exoplatform.webui.event.Event.broadcast(Event.java:89)
                      at org.exoplatform.portal.webui.application.UIPortletLifecycle.processAction(UIPortletLifecycle.java:117)
                      at org.exoplatform.portal.webui.application.UIPortletLifecycle.processAction(UIPortletLifecycle.java:53)
                      at org.exoplatform.webui.core.UIComponent.processAction(UIComponent.java:130)
                      at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processAction(UIPortalApplicationLifecycle.java:66)
                      at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processAction(UIPortalApplicationLifecycle.java:30)
                      at org.exoplatform.webui.core.UIComponent.processAction(UIComponent.java:130)
                      at org.exoplatform.webui.core.UIApplication.processAction(UIApplication.java:113)
                      at org.exoplatform.portal.application.PortalRequestHandler.execute(PortalRequestHandler.java:105)
                      at org.exoplatform.web.WebAppController.service(WebAppController.java:143)
                      at org.exoplatform.portal.application.PortalController.onService(PortalController.java:127)
                      at org.exoplatform.container.web.AbstractHttpServlet.service(AbstractHttpServlet.java:114)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter.doFilter(ThreadLocalSessionProviderInitializedFilter.java:116)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.web.CacheUserProfileFilter.doFilter(CacheUserProfileFilter.java:68)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.services.security.web.SetCurrentIdentityFilter.doFilter(SetCurrentIdentityFilter.java:76)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.web.filter.ExtensibleFilter$ExtensibleFilterChain.doFilter(ExtensibleFilter.java:112)
                      at org.exoplatform.sample.ext.web.SampleFilter.doFilter(SampleFilter.java:46)
                      at org.exoplatform.web.filter.ExtensibleFilter$ExtensibleFilterChain.doFilter(ExtensibleFilter.java:108)
                      at org.exoplatform.web.filter.ExtensibleFilter.doFilter(ExtensibleFilter.java:84)
                      at org.exoplatform.web.filter.GenericFilter.doFilter(GenericFilter.java:66)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      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:235)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      at java.lang.Thread.run(Thread.java:595)
              Caused by: java.lang.ClassCastException: org.gatein.pc.portlet.impl.jsr168.api.ActionRequestImpl
                      at bull.com.orderform.session.JcrDocumentBean.jcrDocument(JcrDocumentBean.java:99)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:592)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                      at bull.com.orderform.session.JcrDocumentBean_$$_javassist_seam_2.jcrDocument(JcrDocumentBean_$$_javassist_seam_2.java)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:592)
                      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
                      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
                      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                      at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
                      ... 124 more
              10:36:24,046 ERROR [LifecyclePhase] Error executing INVOKE_APPLICATION 5 phase.
              javax.faces.FacesException: #{JcrDocument.jcrDocument}: java.lang.ClassCastException: org.gatein.pc.portlet.impl.jsr168.api.ActionRequestImpl
                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
                      at javax.faces.component.UICommand.broadcast(UICommand.java:387)
                      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
                      at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
                      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
                      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)
                      at org.jboss.portletbridge.lifecycle.InvokeApplicationPhase.executePhase(InvokeApplicationPhase.java:57)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:72)
                      at org.jboss.portletbridge.lifecycle.UpdateModelPhase.executeNextPhase(UpdateModelPhase.java:49)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.ProcessValidatorsPhase.executeNextPhase(ProcessValidatorsPhase.java:50)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.ApplyValuesPhase.executeNextPhase(ApplyValuesPhase.java:50)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.RestoreViewPhase.executeNextPhase(RestoreViewPhase.java:72)
                      at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:99)
                      at org.jboss.portletbridge.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:62)
                      at org.jboss.portletbridge.lifecycle.PortletLifecycle.execute(PortletLifecycle.java:114)
                      at org.jboss.portletbridge.AjaxPortletBridge.execute(AjaxPortletBridge.java:1078)
                      at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:391)
                      at javax.portlet.faces.GenericFacesPortlet.processAction(GenericFacesPortlet.java:526)
                      at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:557)
                      at org.gatein.pc.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:109)
                      at org.gatein.pc.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:72)
                      at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:505)
                      at org.gatein.pc.portlet.container.ContainerPortletDispatcher.invoke(ContainerPortletDispatcher.java:42)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.EventPayloadInterceptor.invoke(EventPayloadInterceptor.java:196)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.RequestAttributeConversationInterceptor.invoke(RequestAttributeConversationInterceptor.java:119)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.CCPPInterceptor.invoke(CCPPInterceptor.java:65)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:49)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor.access$001(ContextDispatcherInterceptor.java:49)
                      at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:123)
                      at org.gatein.wci.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:82)
                      at sun.reflect.GeneratedMethodAccessor658.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:592)
                      at org.gatein.wci.command.CommandServlet.doGet(CommandServlet.java:135)
                      at org.gatein.wci.command.CommandServlet.doPost(CommandServlet.java:166)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
                      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:543)
                      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:480)
                      at org.gatein.wci.command.CommandServlet.include(CommandServlet.java:84)
                      at org.gatein.wci.command.CommandDispatcher.include(CommandDispatcher.java:58)
                      at org.gatein.wci.tomcat.TC6ServletContainerContext.include(TC6ServletContainerContext.java:87)
                      at org.gatein.wci.impl.DefaultServletContainer.include(DefaultServletContainer.java:191)
                      at org.gatein.pc.portlet.impl.spi.AbstractServerContext.dispatch(AbstractServerContext.java:69)
                      at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:77)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:69)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.ValveInterceptor.invoke(ValveInterceptor.java:75)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.container.ContainerPortletInvoker.invoke(ContainerPortletInvoker.java:117)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:230)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.PortletCustomizationInterceptor.invoke(PortletCustomizationInterceptor.java:76)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.portlet.aspects.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:229)
                      at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87)
                      at org.gatein.pc.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:152)
                      at org.gatein.pc.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:173)
                      at org.exoplatform.portal.webui.application.UIPortlet.invoke(UIPortlet.java:886)
                      at org.exoplatform.portal.webui.application.UIPortletActionListener$ProcessActionActionListener.execute(UIPortletActionListener.java:98)
                      at org.exoplatform.webui.event.Event.broadcast(Event.java:89)
                      at org.exoplatform.portal.webui.application.UIPortletLifecycle.processAction(UIPortletLifecycle.java:117)
                      at org.exoplatform.portal.webui.application.UIPortletLifecycle.processAction(UIPortletLifecycle.java:53)
                      at org.exoplatform.webui.core.UIComponent.processAction(UIComponent.java:130)
                      at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processAction(UIPortalApplicationLifecycle.java:66)
                      at org.exoplatform.portal.webui.workspace.UIPortalApplicationLifecycle.processAction(UIPortalApplicationLifecycle.java:30)
                      at org.exoplatform.webui.core.UIComponent.processAction(UIComponent.java:130)
                      at org.exoplatform.webui.core.UIApplication.processAction(UIApplication.java:113)
                      at org.exoplatform.portal.application.PortalRequestHandler.execute(PortalRequestHandler.java:105)
                      at org.exoplatform.web.WebAppController.service(WebAppController.java:143)
                      at org.exoplatform.portal.application.PortalController.onService(PortalController.java:127)
                      at org.exoplatform.container.web.AbstractHttpServlet.service(AbstractHttpServlet.java:114)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter.doFilter(ThreadLocalSessionProviderInitializedFilter.java:116)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.web.CacheUserProfileFilter.doFilter(CacheUserProfileFilter.java:68)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.services.security.web.SetCurrentIdentityFilter.doFilter(SetCurrentIdentityFilter.java:76)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.exoplatform.web.filter.ExtensibleFilter$ExtensibleFilterChain.doFilter(ExtensibleFilter.java:112)
                      at org.exoplatform.sample.ext.web.SampleFilter.doFilter(SampleFilter.java:46)
                      at org.exoplatform.web.filter.ExtensibleFilter$ExtensibleFilterChain.doFilter(ExtensibleFilter.java:108)
                      at org.exoplatform.web.filter.ExtensibleFilter.doFilter(ExtensibleFilter.java:84)
                      at org.exoplatform.web.filter.GenericFilter.doFilter(GenericFilter.java:66)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      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:235)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      at java.lang.Thread.run(Thread.java:595)
              Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: org.gatein.pc.portlet.impl.jsr168.api.ActionRequestImpl
                      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                      ... 123 more
              Caused by: java.lang.ClassCastException: org.gatein.pc.portlet.impl.jsr168.api.ActionRequestImpl
                      at bull.com.orderform.session.JcrDocumentBean.jcrDocument(JcrDocumentBean.java:99)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:592)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                      at bull.com.orderform.session.JcrDocumentBean_$$_javassist_seam_2.jcrDocument(JcrDocumentBean_$$_javassist_seam_2.java)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              Best regards

              HieuHN

              • 4. Re: How to use GateIn JCR integration in my portlet?
                gregory sebert Newbie

                Hello,

                 

                We solved the problem, it's was a packaging problem combine with a classloader issue.

                 

                This is a example of how to access to the default GateIn JCR workspace from a portlet :

                 

                RepositoryService    repositoryService;

                ManageableRepository repository;

                Session              session;

                Node                 node;

                 

                ExoContainer container = new ExoContainer();
                container = ExoContainerContext.getContainerByName("portal");


                SessionProviderService sessionProviderService = (SessionProviderService) container

                          .getComponentInstanceOfType(SessionProviderService.class);

                 

                RepositoryService repositoryService = (RepositoryService) container
                          .getComponentInstanceOfType(RepositoryService.class);


                ManageableRepository repository;
                            repository = repositoryService.getDefaultRepository();


                Session jcrSession = sessionProviderService
                                      .getSessionProvider(null).getSession(
                                          repository.getConfiguration()
                                              .getDefaultWorkspaceName(), repository);
                          
                Node node = jcrSession.getRootNode();

                 

                Regards,

                 

                Grégory SEBERT

                BULL Belgium

                • 5. Re: How to use GateIn JCR integration in my portlet?
                  Marko Strukelj Master

                  Yes, it's wrong to include exo.* jars in your .ear/.war.

                   

                  They must be loaded from their default location:

                  • gatein.ear/lib on JBossAS,
                  • $TOMCAT_HOME/lib in Tomcat stand-alone

                   

                  Thanks for the feedback.

                   

                  Cheers,

                   

                  - marko