6 Replies Latest reply on Jul 5, 2010 1:34 PM by Fred Curry

    Extending a portal

    Andre Winkler Newbie

      I have tried to extend the default portal from GateIn. I have a project with a web.xml with the following content:

       

       

      <web-app>
        <display-name>testPortal</display-name>
        <listener>
          <listener-class>org.exoplatform.container.web.PortalContainerConfigOwner</listener-class>
        </listener>
      </web-app>

       

      In which xml file do I have to add the testPortal name in the dependencies list of GateIn. I can not find a file with the portal definition.

        • 1. Re: Extending a portal
          Matt Wringe Master

          what exactly are you trying to do?

          • 2. Re: Extending a portal
            Trong Tran Master

            Here is a sample for the portal definition configuration : http://anonsvn.jboss.org/repos/gatein/portal/tags/3.0.0-GA/examples/extension/config/src/main/java/conf/configuration.xml

             

            are you trying to find such file ?

            • 3. Re: Extending a portal
              Andre Winkler Newbie

              The content of the configuration file is clear, but where I have to place this file, in my WAR in a JAR, in a tomcat directory?

              • 4. Re: Extending a portal
                Trong Tran Master

                There are two options for you :

                 

                - in the a JAR/conf/configuration.xml file which will be added to library folder of web server

                 

                - define it in the external configuration file of GateIn, for example : {tomcat}/gatein/conf/configuration.xml

                • 5. Re: Extending a portal
                  Amao Xu Newbie

                  for the extern portal, you can copy the data from gatein-sample-portal.ear.

                  Alle files, which are necessary for a portal is included in this package.

                  In my case, i create the ear file with name "gatein-mysample-portal.ear"

                  To change the name of portal for example "myexample", you should make changes in the following locations.

                   

                  your-portal-package.ear

                       ->META-INF->application.xml

                                 <display-name>myexample</display-name>

                                 <web>

                                           ........

                                           <context-root>myexample</context-root>

                                 </web>

                        ->sample-portal.war(could be different name, but the war for the portal)\WEB-INF\web.xml

                                 <display-name>myexample</display-name>

                        ->exo.portal.sample.portal.config-3.1.0-GA.jar(could be different name, but the jar for the portal)\conf\configuration.xml

                                 <init-params>

                                      <object-param>

                                           <name>myexample</name>

                                 .........

                                 <field name="name">

                                           <string>myexample</string>

                                 </field>

                                      ............

                                 <collection type="java.util.ArrayList">

                                 .........

                                 <value>

                                      <string>myexample<string>

                   

                  in my case, i have just overwrite the original gatein-sample-portal.ear. It works.

                  But it seems, that if i create two "sample portal".ear, it could bring confict.

                  • 6. Re: Extending a portal
                    Fred Curry Newbie

                    I just followed Amao's steps, and get the following error:

                     

                    13:30:35,719 INFO  [RootContainer] Trying to create the portal container 'myexample'
                    13:30:37,302 ERROR [RootContainer] Cannot create the portal container 'myexample' . ServletContext: org.apache.catalina.core.ApplicationContextFacade@318f0acd
                    java.lang.RuntimeException: Cannot instantiate component key=org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator type=org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl found at jndi:/localhost/portal/WEB-INF/conf/configuration.xml
                        at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:113)
                        at org.exoplatform.container.management.ManageableComponentAdapter.getComponentInstance(ManageableComponentAdapter.java:68)
                        at org.picocontainer.defaults.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:322)
                        at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstancesOfType(DefaultPicoContainer.java:281)
                        at org.exoplatform.container.CachingContainer.getComponentInstancesOfType(CachingContainer.java:106)
                        at org.picocontainer.defaults.LifecycleVisitor.visitContainer(LifecycleVisitor.java:97)
                        at org.picocontainer.defaults.DefaultPicoContainer.accept(DefaultPicoContainer.java:416)
                        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:597)
                        at org.picocontainer.defaults.AbstractPicoVisitor.traverse(AbstractPicoVisitor.java:32)
                        at org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:63)
                        at org.picocontainer.defaults.LifecycleVisitor.start(LifecycleVisitor.java:113)
                        at org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoContainer.java:369)
                        at org.exoplatform.container.PortalContainer.start(PortalContainer.java:568)
                        at org.exoplatform.container.RootContainer.createPortalContainer(RootContainer.java:332)
                        at org.exoplatform.container.RootContainer.createPortalContainers(RootContainer.java:226)
                        at org.exoplatform.container.web.PortalContainerCreator.contextInitialized(PortalContainerCreator.java:57)
                        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
                        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)
                        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
                        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
                        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
                        at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:597)
                        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                        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:668)
                        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                        at $Proxy38.start(Unknown Source)
                        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                        at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:823)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                        at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                        at org.jboss.system.ServiceController.start(ServiceController.java:460)
                        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
                        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
                        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1440)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1158)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1179)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1211)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1099)
                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:823)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:782)
                        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
                        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                        at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
                        at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
                        at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:775)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
                        at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
                        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
                        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
                        at org.jboss.Main.boot(Main.java:221)
                        at org.jboss.Main$1.run(Main.java:556)
                        at java.lang.Thread.run(Thread.java:637)
                    Caused by: java.lang.RuntimeException: Cannot instantiate component key=org.exoplatform.services.jcr.RepositoryService type=org.exoplatform.services.jcr.impl.RepositoryServiceImpl found at jndi:/localhost/portal/WEB-INF/conf/configuration.xml
                        at org.exoplatform.container.jmx.MX4JComponentAdapter.getComponentInstance(MX4JComponentAdapter.java:113)
                        at org.exoplatform.container.management.ManageableComponentAdapter.getComponentInstance(ManageableComponentAdapter.java:68)
                        at org.picocontainer.defaults.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:322)

                    ...

                     

                    Any ideas?

                     

                    Fred