Foren

RE: Liferay EE 6.0 SP2 + database sharding = exception

Michael Klos, geändert vor 12 Jahren.

Liferay EE 6.0 SP2 + database sharding = exception

New Member Beiträge: 17 Beitrittsdatum: 06.03.09 Neueste Beiträge
Hi,

I'm getting the following exception when I try to use Liferay EE 6.0 SP2 and database sharding.

[#|2011-10-27T15:15:29.968+0100|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=1;_ThreadName=Thread-1;|15:15:29,968 ERROR [PortalInstances:465] com.liferay.portal.kernel.events.ActionException: java.lang.NullPointerException
com.liferay.portal.kernel.events.ActionException: java.lang.NullPointerException
	at com.liferay.portal.events.ChannelHubAppStartupAction.run(ChannelHubAppStartupAction.java:42)
	at com.liferay.portal.events.EventsProcessorImpl.processEvent(EventsProcessorImpl.java:106)
	at com.liferay.portal.events.EventsProcessorImpl.process(EventsProcessorImpl.java:58)
	at com.liferay.portal.ee.license.EventsProcessorImpl.process(Unknown Source)
	at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:38)
	at com.liferay.portal.util.PortalInstances._initCompany(PortalInstances.java:459)
	at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:92)
	at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:749)
	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:341)
	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1439)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1241)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5032)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5319)
	at com.sun.enterprise.web.WebModule.start(WebModule.java:500)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:755)
	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1980)
	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1630)
	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:100)
	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
	at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:364)
	at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:208)
	at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
	at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
	at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
	at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
	at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
	at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
	at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
	at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
	at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
	at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
	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 com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
	at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.NullPointerException
	at com.liferay.portal.kernel.notifications.ChannelHubManagerUtil.createChannelHub(ChannelHubManagerUtil.java:42)
	at com.liferay.portal.events.ChannelHubAppStartupAction.run(ChannelHubAppStartupAction.java:39)
	... 42 more
|#]



I did some tests and everything works fine with

- Liferay EE 6.0 SP1 + MySQL 5.5 + Glassfish 3.1
- Liferay EE 6.0 SP1 + Oracle 11g + Glassfish 3.1
- Liferay CE 6.0.6 + MySQL 5.5 + Glassfish 3.1
- Liferay CE 6.0.6 + Oracle 11g + Glassfish 3.1

the only issue is with Liferay EE 6.0 SP2.

Has anyone have a similar problem?
Is there a simple fix?

thanks
Michael
thumbnail
Szymon Gołębiewski, geändert vor 12 Jahren.

RE: Liferay EE 6.0 SP2 + database sharding = exception

Regular Member Beiträge: 246 Beitrittsdatum: 08.06.09 Neueste Beiträge
It looks like major problem. Did you searched liferay JIRA for such issue?
Michael Klos, geändert vor 12 Jahren.

RE: Liferay EE 6.0 SP2 + database sharding = exception

New Member Beiträge: 17 Beitrittsdatum: 06.03.09 Neueste Beiträge
I haven't seen a JIRA with this issue. I'll create one.

I've also tried to upgrade Liferay EE 6.0 SP1 (with database sharding enabled and two portal instances) to Liferay EE 6.0 SP2 fixpack-upgrade-1-6012 but no luck. I'm getting the following exception with MySQL and Oracle database.

[#|2011-10-28T12:39:24.542+0100|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=1;_ThreadName=Thread-1;|12:39:24,542 ERROR [MainServlet:201] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
 at com.liferay.portal.events.StartupAction.run(StartupAction.java:57)
 at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1193)
 at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:198)
 at javax.servlet.GenericServlet.init(GenericServlet.java:244)
 at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1439)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1241)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5032)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:5319)
 at com.sun.enterprise.web.WebModule.start(WebModule.java:500)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:755)
 at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1980)
 at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1630)
 at com.sun.enterprise.web.WebApplication.start(WebApplication.java:100)
 at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
 at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
 at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
 at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
 at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:364)
 at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:208)
 at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
 at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
 at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
 at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
 at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
 at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
 at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
 at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
 at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
 at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
 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 com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
 at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:205)
 at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:80)
 at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:37)
 at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:73)
 at com.liferay.portal.events.StartupHelper$$FastClassByCGLIB$$d389986b.invoke(<generated>)
 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
 at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 at com.liferay.portal.dao.shard.advice.ShardGloballyAdvice.invoke(ShardGloballyAdvice.java:59)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
 at com.liferay.portal.events.StartupHelper$$EnhancerByCGLIB$$d8e27ea9.upgradeProcess(<generated>)
 at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:40)
 at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:99)
 at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:126)
 at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
 at com.liferay.portal.events.StartupAction.run(StartupAction.java:51)
 ... 36 more
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:205)
 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:221)
 at com.liferay.portal.upgrade.UpgradeProcess_6_0_12.doUpgrade(UpgradeProcess_6_0_12.java:60)
 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:202)
 ... 54 more
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
 at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
 at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
 at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
 at com.liferay.portal.upgrade.v6_0_12.UpgradeVirtualHost.updateCompany(UpgradeVirtualHost.java:61)
 at com.liferay.portal.upgrade.v6_0_12.UpgradeVirtualHost.doUpgrade(UpgradeVirtualHost.java:32)
 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:202)
 ... 57 more
|#]
</generated></generated>



for testing I used clean database, glassfish 3.1 and below portal-ext.properties file. So nothing fancy no customization just out of the box Liferay EE 6.0 SP2 with database sharding enabled. I've also tried to use it with JNDI data sources defined in glassfish without any success


    jdbc.default.driverClassName=com.mysql.jdbc.Driver
    jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false
    jdbc.default.username=
    jdbc.default.password=
	
    jdbc.one.driverClassName=com.mysql.jdbc.Driver
    jdbc.one.url=jdbc:mysql://localhost/lportal1?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false
    jdbc.one.username=
    jdbc.one.password=
	
    jdbc.two.driverClassName=com.mysql.jdbc.Driver
    jdbc.two.url=jdbc:mysql://localhost/lportal2?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false
    jdbc.two.username=
    jdbc.two.password=

    shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
    shard.available.names=default,one,two
    shard.default.name=default

   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/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/poller-spring.xml,\
        META-INF/rules-spring.xml,\
        META-INF/scheduler-spring.xml,\
        META-INF/scripting-spring.xml,\
        META-INF/search-spring.xml,\
        META-INF/workflow-spring.xml,\
        \
        META-INF/counter-spring.xml,\
        META-INF/document-library-spring.xml,\
        META-INF/mail-spring.xml,\
        META-INF/portal-spring.xml,\
        META-INF/portlet-container-spring.xml,\
        \
        #META-INF/dynamic-data-source-spring.xml,\
        META-INF/shard-data-source-spring.xml,\
        #META-INF/memcached-spring.xml,\
        #META-INF/monitoring-spring.xml,\
        \
        META-INF/ext-spring.xml
    
Michael Klos, geändert vor 12 Jahren.

RE: Liferay EE 6.0 SP2 + database sharding = exception

New Member Beiträge: 17 Beitrittsdatum: 06.03.09 Neueste Beiträge
http://issues.liferay.com/browse/LPS-22577
Magnus Smith, geändert vor 12 Jahren.

RE: Liferay EE 6.0 SP2 + database sharding = exception

New Member Beiträge: 3 Beitrittsdatum: 18.03.11 Neueste Beiträge
So after some debugging the problem seems to be that during the process applcation startup events that the ChannelHubAppStartupAction fails because the ChannelHubManager has not been initialised in the ChannelHubManagerUtil.

By what process should the ChannalHubManager get initialised in the ChannelHubManagerUtil?

Any clues? emoticon
Michael Klos, geändert vor 12 Jahren.

RE: Liferay EE 6.0 SP2 + database sharding = exception

New Member Beiträge: 17 Beitrittsdatum: 06.03.09 Neueste Beiträge
ChannelHubManager has been introduced in the Liferay 6.0 EE SP2 and there is no documentation apart form this http://www.liferay.com/group/customer/knowledge/upgrade/6.0-ee-sp2 how to upgrade to SP2. Unfortunately it doesn't say that you have to add META-INF/notifications-spring.xml to your existing portal-ext.properties (which works with Liferay 6.0 EE SP1) if you enable database sharding. Below correct spring.config for Liferay 6.0 EE SP2 and database sharding


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/audit-spring.xml,\
        META-INF/cluster-spring.xml,\
        META-INF/editor-spring.xml,\
        META-INF/executor-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/scripting-spring.xml,\
        META-INF/search-spring.xml,\
        META-INF/workflow-spring.xml,\
        \
        META-INF/counter-spring.xml,\
        META-INF/document-library-spring.xml,\
        META-INF/mail-spring.xml,\
        META-INF/portal-spring.xml,\
        META-INF/portlet-container-spring.xml,\
        \
        #META-INF/dynamic-data-source-spring.xml,\
        META-INF/shard-data-source-spring.xml,\
        #META-INF/memcached-spring.xml,\
        #META-INF/monitoring-spring.xml,\
        \
        META-INF/ext-spring.xml
Abhay Chaware, geändert vor 10 Jahren.

RE: Liferay EE 6.0 SP2 + database sharding = exception

Junior Member Beiträge: 36 Beitrittsdatum: 17.07.13 Neueste Beiträge
Thanks ! I think this must go in the SHARDING WIKI page of liferay.