6 Replies Latest reply on Feb 8, 2010 7:33 AM by pseudojboss

    Create a new Portal from scratch using .xml files

    david.calvente

      Hi,
      I've been working on Beta2 to build a fresh portal but I can't find the right way.
      I used sample-portal but it's dependent on classic.

      I wuold like to get a receipt to build a new one, like starter, but with all required content for a minimum functionality.

        • 1. Re: Create a new Portal from scratch using .xml files
          rafaelliu

          Why are you using XMLs file? Do you want to create a "template" site (one that you'll have by default when you create it?)

          • 2. Re: Create a new Portal from scratch using .xml files
            david.calvente

            That could be an idea.

            For mi it's important to have as much as posible build from XML files to avoid Admin work.
            Think about all the tasks related to users navigations, etc taht could be pre established with theXML Files and stored in CVS/SVN ...

            I read in documentation that it's posible. I tried with sample-portal, but not able to get a good understanding..

            Is it posible to extend the documentation to cover this issue in detail?

            David

            • 3. Re: Create a new Portal from scratch using .xml files
              rafaelliu
              • 4. Re: Create a new Portal from scratch using .xml files
                david.calvente

                Hi,

                 

                I'm tryng to have my ouwn portal ear in order to deploy it directly on GateIn.

                I copied sample-portal from Beta-03 tag into a new maven project. I modified everyplace where some important entry references "sample" by a new name (the neme of my portal) and built all artefacts (config, jar, war and rest-war) and packaged into my ear.

                 

                I reviwed all entries and made sure all contexts, references, etc where pointing to my new portal...

                 

                The ear deploys with error: The portal container 'tnf-portal' doesn't not exist or it has not yet been registered, please check your PortalContainerDefinitions and the loading order

                 

                ###########  LOG  ######

                2009-12-13 22:23:00,082 INFO  [org.exoplatform.container.RootContainer] The portal container 'portal' has been created successfully
                2009-12-13 22:23:00,083 WARN  [org.exoplatform.container.RootContainer] The portal container 'tnf-portal' doesn't not exist or it has not yet been registered, please check your PortalContainerDefinitions and the loading order.
                2009-12-13 22:23:00,456 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/rest-tnf-portal
                2009-12-13 22:23:00,568 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/tnf-portal
                2009-12-13 22:23:00,651 INFO  [portal:ResourceRequestFilter] Cache eXo Resource at client: true
                2009-12-13 22:23:00,777 INFO  [org.apache.coyote.http11.Http11Protocol] Arrancando Coyote HTTP/1.1 en puerto http-0.0.0.0-8080
                2009-12-13 22:23:00,845 INFO  [org.apache.coyote.ajp.AjpProtocol] Arrancando Coyote AJP/1.3 en ajp-0.0.0.0-8009
                2009-12-13 22:23:00,884 INFO  [org.jboss.bootstrap.microcontainer.ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 3m:27s:640ms

                 

                 

                and when accessing it from a browser:

                 

                ###########  LOG  ######
                2009-12-13 22:26:36,037 WARN  [core.security.SetCurrentIdentityFilter] An error occured while cache user profile
                java.lang.NullPointerException
                    at org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter.doFilter(ThreadLocalSessionProviderInitializedFilter.java:132)
                    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.GenericFilter.doFilter(GenericFilter.java:62)
                    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:736)

                 

                I'm sure there should be a mistake, but I reviewed all, searching for sample vs tnf misconfigurations and everything seems to be OK

                 

                Is there any extra dependency (sample-extensions..) or something I'm doing wrong?

                 

                Do you know an easiest way to build my own portal ear without dependencies?

                 

                Best regards

                 

                David

                • 5. Re: Create a new Portal from scratch using .xml files
                  sorenschmidt

                  Hola David,

                   

                  After the first start-up of GateIn, configurations are loaded in the JCR (which uses a database) and can be modified using the administration interface. At the succeeding startups you can use the configuration files to add some configurations but you don't replace it completely.

                   

                  If you want to hold all configuration in xml files and you don't modify it using the admin interface, you should use a memory-only hsqldb database.

                   

                  Then the configuration is only temporary stored in the JCR and reloaded at each startup. At each stop of the application server the configuration is lost, because it was stored only in the memory. At the next startup the configuration is reloaded completely from xml configuration files.

                   

                  There is also a brand-new article talking about this : http://wiki.exoplatform.com/xwiki/bin/view/Portal/Transient+File-Based+Configuration

                   

                  Saludos de Ginebra

                  Soren

                   

                   

                  PS: Let me show how to do it. You create a special datasource "jcrconf" to which you assign the memory-only database.

                  in ...\conf\jcr\jcr-configuration.xml

                    <component>
                      <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
                      <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
                      <init-params>
                        <value-param>
                          <name>conf-path</name>
                          <description>JCR configuration file</description>
                          <value>war:/conf/jcr/repository-configuration.xml</value>
                        </value-param>
                        <properties-param>
                          <name>working-conf</name>
                          <description>working-conf</description>
                          <property name="persister-class-name"
                                    value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
                          <property name="source-name"
                                    value="jcrconf" />
                          <property name="dialect"
                                    value="hsqldb" />
                        </properties-param>
                      </init-params>
                    </component>

                   

                   

                   

                  in \conf\database\database-configuration.xml

                   

                    <external-component-plugins>
                      <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
                      <component-plugin>
                        <name>bind.datasource</name>
                        <set-method>addPlugin</set-method>
                        <type>org.exoplatform.services.naming.BindReferencePlugin</type>
                        <init-params>
                          <value-param>
                            <name>bind-name</name>
                            <value>jcrconf</value>
                          </value-param>
                          <value-param>
                            <name>class-name</name>
                            <value>javax.sql.DataSource</value>
                          </value-param>
                          <value-param>
                            <name>factory</name>
                            <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                          </value-param>
                          <properties-param>
                            <name>ref-addresses</name>
                            <description>ref-addresses</description>
                            <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
                            <property name="url" value="jdbc:hsqldb:mem:exo-data/data/exodb"/>
                            <property name="username" value="sa"/>
                            <property name="password" value=""/>
                          </properties-param>
                        </init-params>
                      </component-plugin>
                    </external-component-plugins>

                  • 6. Re: Create a new Portal from scratch using .xml files

                    Hi,

                     

                    I've done the same as described in the last post. I checked out the examples/portal and wanted to build my own portal. So I renamed all the "sample" with "mysample" and deployed it on the server. So the I have the Exception like in the last post:

                     

                    12:46,225 WARN  [SetCurrentIdentityFilter] An error occured while cache user profile
                    java.lang.NullPointerException
                        at org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter.doFilter(ThreadLocalSessionProviderInitializedFilter.java:132)
                        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.GenericFilter.doFilter(GenericFilter.java:62)
                        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:619)

                     

                    What I am doing wrong? Are there more things I have to do except the renaming?