Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-48959

Kaleo does not deploy correctly when sharding is enabled

    Details

      Description

      1.- use Liferay 6.2 EE SP5, bundle with tomcat (do not execute now)
      2.- delete all the kaleo folders inside webapps.
      3.- copy the oracle connector ojdbc6.jar in [tomcat_home]/lib/ext
      4.- Configure 3 shardings (do not use the default configuration)
      portal-ext.properties:

      jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
      jdbc.default.url=jdbc:oracle:thin:@127.0.1.1:1521:orcl
      jdbc.default.username=LIFERAY_SHARDDEFAULT
      jdbc.default.password=liferay

      dbc.panama.driverClassName=oracle.jdbc.driver.OracleDriver
      jdbc.panama.url=jdbc:oracle:thin:@127.0.1.1:1521:orcl
      jdbc.panama.username=LIFERAY_SHARD1
      jdbc.panama.password=liferay

      jdbc.elsalvador.driverClassName=oracle.jdbc.driver.OracleDriver
      jdbc.elsalvador.url=jdbc:oracle:thin:@127.0.1.1:1521:orcl
      jdbc.elsalvador.username=LIFERAY_SHARD2
      jdbc.elsalvador.password=liferay

      #############################DIFERENTES BASES DE DATOS#################################
      shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
      shard.available.names=default,panama,elsalvador

      spring.configs=\
      META-INF/base-spring.xml,\
      \
      META-INF/hibernate-spring.xml,\
      META-INF/infrastructure-spring.xml,\
      META-INF/management-spring.xml,\
      \
      META-INF/util-spring.xml,\
      \
      META-INF/jpa-spring.xml,\
      \
      META-INF/executor-spring.xml,\
      \
      META-INF/audit-spring.xml,\
      META-INF/cluster-spring.xml,\
      META-INF/editor-spring.xml,\
      META-INF/jcr-spring.xml,\
      META-INF/ldap-spring.xml,\
      META-INF/messaging-core-spring.xml,\
      META-INF/messaging-misc-spring.xml,\
      META-INF/mobile-device-spring.xml,\
      META-INF/notifications-spring.xml,\
      META-INF/poller-spring.xml,\
      META-INF/rules-spring.xml,\
      META-INF/scheduler-spring.xml,\
      META-INF/search-spring.xml,\
      META-INF/workflow-spring.xml,\
      \
      META-INF/counter-spring.xml,\
      META-INF/mail-spring.xml,\
      META-INF/portal-spring.xml,\
      META-INF/portlet-container-spring.xml,\
      META-INF/staging-spring.xml,\
      META-INF/virtual-layouts-spring.xml,\
      \
      META-INF/monitoring-spring.xml,\
      \
      #META-INF/dynamic-data-source-spring.xml,\
      META-INF/shard-data-source-spring.xml,\
      #META-INF/memcached-spring.xml,\
      \
      classpath*:META-INF/ext-spring.xml

      5.- copy the file shard-data-source-spring.xml in [LIFERAY_HOME]/[TOMCAT]/webapps/ROOT/WEB-INF/classes/META-INF/

      <?xml version="1.0"?>

      <beans
      default-destroy-method="destroy"
      default-init-method="afterPropertiesSet"
      xmlns="http://www.springframework.org/schema/beans"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
      <bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
      <property name="targetDataSource">
      <bean class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="targetSource" ref="shardDataSourceTargetSource" />
      </bean>
      </property>
      </bean>
      <bean id="liferayHibernateSessionFactory" class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="targetSource" ref="shardSessionFactoryTargetSource" />
      </bean>
      <bean id="shardDataSource0" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
      <property name="targetDataSource">
      <bean class="com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean">
      <property name="propertyPrefix" value="jdbc.default." />
      </bean>
      </property>
      </bean>
      <bean id="shardDataSource1" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
      <property name="targetDataSource">
      <bean class="com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean">
      <property name="propertyPrefix" value="jdbc.panama." />
      </bean>
      </property>
      </bean>
      <bean id="shardDataSource3" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
      <property name="targetDataSource">
      <bean class="com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean">
      <property name="propertyPrefix" value="jdbc.elsalvador." />
      </bean>
      </property>
      </bean>
      <bean id="shardDataSourceTargetSource" class="com.liferay.portal.dao.shard.ShardDataSourceTargetSource">
      <property name="dataSources">
      <map>
      <entry>
      <key>
      <value>default</value>
      </key>
      <ref bean="shardDataSource0" />
      </entry>
      <entry>
      <key>
      <value>panama</value>
      </key>
      <ref bean="shardDataSource1" />
      </entry>
      <entry>
      <key>
      <value>elsalvador</value>
      </key>
      <ref bean="shardDataSource3" />
      </entry>
      </map>
      </property>
      </bean>
      <bean id="shardSessionFactoryTargetSource" class="com.liferay.portal.dao.shard.ShardSessionFactoryTargetSource">
      <property name="shardDataSourceTargetSource" ref="shardDataSourceTargetSource" />
      </bean>
      <bean id="com.liferay.portal.kernel.dao.jdbc.MappingSqlQueryFactoryUtil" class="com.liferay.portal.kernel.dao.jdbc.MappingSqlQueryFactoryUtil">
      <property name="mappingSqlQueryFactory">
      <bean class="com.liferay.portal.dao.shard.ShardMappingSqlQueryFactoryImpl" />
      </property>
      </bean>
      <bean id="com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil" class="com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil">
      <property name="sqlUpdateFactory">
      <bean class="com.liferay.portal.dao.shard.ShardSqlUpdateFactoryImpl" />
      </property>
      </bean>
      <bean id="com.liferay.portal.kernel.dao.shard.ShardUtil" class="com.liferay.portal.kernel.dao.shard.ShardUtil">
      <property name="shard">
      <bean class="com.liferay.portal.dao.shard.ShardImpl">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      </property>
      </bean>
      <bean id="com.liferay.portal.kernel.util.InfrastructureUtil" class="com.liferay.portal.kernel.util.InfrastructureUtil">
      <property name="dataSource" ref="liferayDataSource" />
      <property name="mailSession" ref="mailSession" />
      <property name="shardDataSourceTargetSource" ref="shardDataSourceTargetSource" />
      <property name="shardSessionFactoryTargetSource" ref="shardSessionFactoryTargetSource" />
      <property name="transactionManager" ref="liferayTransactionManager" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardAdvice" class="com.liferay.portal.dao.shard.advice.ShardAdvice">
      <property name="shardDataSourceTargetSource" ref="shardDataSourceTargetSource" />
      <property name="shardSessionFactoryTargetSource" ref="shardSessionFactoryTargetSource" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardCompanyAdvice" class="com.liferay.portal.dao.shard.advice.ShardCompanyAdvice">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardPortletAdvice" class="com.liferay.portal.dao.shard.advice.ShardPortletAdvice">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice" class="com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" class="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardIterativelyAdvice" class="com.liferay.portal.dao.shard.advice.ShardIterativelyAdvice">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      <bean id="com.liferay.portal.dao.shard.advice.ShardParameterAdvice" class="com.liferay.portal.dao.shard.advice.ShardParameterAdvice">
      <property name="shardAdvice" ref="com.liferay.portal.dao.shard.advice.ShardAdvice" />
      </bean>
      <aop:config proxy-target-class="false">
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardCompanyAdvice" pointcut="bean(com.liferay.portal.service.CompanyLocalService)" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" pointcut="execution(void com.liferay.portal.convert.messaging.ConvertProcessMessageListener.receive(..))" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" pointcut="execution(void com.liferay.portal.events.StartupHelper.updateIndexes())" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" pointcut="execution(void com.liferay.portal.events.StartupHelper.upgradeProcess(int))" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" pointcut="execution(* com.liferay.portal.service.ReleaseLocalService.getBuildNumberOrCreate())" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" pointcut="execution(void com.liferay.portal.service.ServiceComponentLocalService.upgradeDB(..))" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardGloballyAdvice" pointcut="execution(void com.liferay.portlet.journal.service.JournalArticleLocalService.checkArticles())" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardIterativelyAdvice" pointcut="execution(void com.liferay.portal.events.StartupHelper.verifyProcess(boolean))" /> <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardParameterAdvice" pointcut="execution(* com.liferay.portal.service.AccountLocalService.getAccount(long, long))" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardParameterAdvice" pointcut="execution(* com.liferay.portal.service.GroupLocalService.getCompanyGroup(long))" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardParameterAdvice" pointcut="execution(* com.liferay.portal.service.UserLocalService.searchCount(..))" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice" pointcut="bean(*Persistence) || bean(*Finder)" />
      <aop:advisor advice-ref="com.liferay.portal.dao.shard.advice.ShardPortletAdvice" pointcut="bean(com.liferay.portal.service.PortletLocalService)" />
      </aop:config>
      </beans>

      6.- start liferay, finish the installation using the option "add sample data"

      7.- go to Control Panel > Server Administration > click on button Verify tables of all plugins

      8.- add a new instance, use LIFERAY_SHARD1 for the database of the new instance.

      9.- deploy kale workflow EE (download from marketplace, 15/05/14)

      10.- Roles are created at default but not are created in the new instance (database LIFERAY_SHARD1)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 37 weeks ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M2