Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Michael Klos
Liferay EE 6.0 SP2 + database sharding = exception
October 27, 2011 7:38 AM
Answer

Michael Klos

Rank: New Member

Posts: 17

Join Date: March 6, 2009

Recent Posts

Hi,

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

 1[#|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
 2com.liferay.portal.kernel.events.ActionException: java.lang.NullPointerException
 3    at com.liferay.portal.events.ChannelHubAppStartupAction.run(ChannelHubAppStartupAction.java:42)
 4    at com.liferay.portal.events.EventsProcessorImpl.processEvent(EventsProcessorImpl.java:106)
 5    at com.liferay.portal.events.EventsProcessorImpl.process(EventsProcessorImpl.java:58)
 6    at com.liferay.portal.ee.license.EventsProcessorImpl.process(Unknown Source)
 7    at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:38)
 8    at com.liferay.portal.util.PortalInstances._initCompany(PortalInstances.java:459)
 9    at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:92)
10    at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:749)
11    at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:341)
12    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
13    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1439)
14    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1241)
15    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5032)
16    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5319)
17    at com.sun.enterprise.web.WebModule.start(WebModule.java:500)
18    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
19    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
20    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:755)
21    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1980)
22    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1630)
23    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:100)
24    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
25    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
26    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
27    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
28    at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:364)
29    at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:208)
30    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
31    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
32    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
33    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
34    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
35    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
36    at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
37    at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
38    at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
39    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
40    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
41    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
42    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
43    at java.lang.reflect.Method.invoke(Method.java:597)
44    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
45    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
46Caused by: java.lang.NullPointerException
47    at com.liferay.portal.kernel.notifications.ChannelHubManagerUtil.createChannelHub(ChannelHubManagerUtil.java:42)
48    at com.liferay.portal.events.ChannelHubAppStartupAction.run(ChannelHubAppStartupAction.java:39)
49    ... 42 more
50|#]



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
Szymon Gołębiewski
RE: Liferay EE 6.0 SP2 + database sharding = exception
October 27, 2011 11:53 AM
Answer

Szymon Gołębiewski

Rank: Regular Member

Posts: 247

Join Date: June 8, 2009

Recent Posts

It looks like major problem. Did you searched liferay JIRA for such issue?
Michael Klos
RE: Liferay EE 6.0 SP2 + database sharding = exception
October 28, 2011 6:54 AM
Answer

Michael Klos

Rank: New Member

Posts: 17

Join Date: March 6, 2009

Recent Posts

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.

 1[#|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'
 2com.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'
 3 at com.liferay.portal.events.StartupAction.run(StartupAction.java:57)
 4 at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1193)
 5 at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:198)
 6 at javax.servlet.GenericServlet.init(GenericServlet.java:244)
 7 at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1439)
 8 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1241)
 9 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5032)
10 at org.apache.catalina.core.StandardContext.start(StandardContext.java:5319)
11 at com.sun.enterprise.web.WebModule.start(WebModule.java:500)
12 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
13 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
14 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:755)
15 at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1980)
16 at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1630)
17 at com.sun.enterprise.web.WebApplication.start(WebApplication.java:100)
18 at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
19 at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
20 at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
21 at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
22 at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:364)
23 at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:208)
24 at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
25 at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
26 at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
27 at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
28 at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
29 at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
30 at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
31 at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
32 at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
33 at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
34 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
35 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
36 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
37 at java.lang.reflect.Method.invoke(Method.java:597)
38 at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
39 at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
40Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
41 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:205)
42 at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:80)
43 at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:37)
44 at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:73)
45 at com.liferay.portal.events.StartupHelper$$FastClassByCGLIB$$d389986b.invoke(<generated>)
46 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
47 at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
48 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
49 at com.liferay.portal.dao.shard.advice.ShardGloballyAdvice.invoke(ShardGloballyAdvice.java:59)
50 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
51 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
52 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
53 at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
54 at com.liferay.portal.events.StartupHelper$$EnhancerByCGLIB$$d8e27ea9.upgradeProcess(<generated>)
55 at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:40)
56 at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:99)
57 at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:126)
58 at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
59 at com.liferay.portal.events.StartupAction.run(StartupAction.java:51)
60 ... 36 more
61Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
62 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:205)
63 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:221)
64 at com.liferay.portal.upgrade.UpgradeProcess_6_0_12.doUpgrade(UpgradeProcess_6_0_12.java:60)
65 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:202)
66 ... 54 more
67Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'virtualHost' in 'field list'
68 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
69 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
70 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
71 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
72 at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
73 at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
74 at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
75 at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
76 at com.liferay.portal.upgrade.v6_0_12.UpgradeVirtualHost.updateCompany(UpgradeVirtualHost.java:61)
77 at com.liferay.portal.upgrade.v6_0_12.UpgradeVirtualHost.doUpgrade(UpgradeVirtualHost.java:32)
78 at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:202)
79 ... 57 more
80|#]



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

 1
 2    jdbc.default.driverClassName=com.mysql.jdbc.Driver
 3    jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
 4    jdbc.default.username=
 5    jdbc.default.password=
 6   
 7    jdbc.one.driverClassName=com.mysql.jdbc.Driver
 8    jdbc.one.url=jdbc:mysql://localhost/lportal1?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
 9    jdbc.one.username=
10    jdbc.one.password=
11   
12    jdbc.two.driverClassName=com.mysql.jdbc.Driver
13    jdbc.two.url=jdbc:mysql://localhost/lportal2?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
14    jdbc.two.username=
15    jdbc.two.password=
16
17    shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
18    shard.available.names=default,one,two
19    shard.default.name=default
20
21   spring.configs=\
22        META-INF/base-spring.xml,\
23        \
24        META-INF/hibernate-spring.xml,\
25        META-INF/infrastructure-spring.xml,\
26        META-INF/management-spring.xml,\
27        \
28        META-INF/util-spring.xml,\
29        \
30        META-INF/jpa-spring.xml,\
31        \
32        META-INF/audit-spring.xml,\
33        META-INF/cluster-spring.xml,\
34        META-INF/editor-spring.xml,\
35        META-INF/jcr-spring.xml,\
36        META-INF/ldap-spring.xml,\
37        META-INF/messaging-core-spring.xml,\
38        META-INF/messaging-misc-spring.xml,\
39        META-INF/poller-spring.xml,\
40        META-INF/rules-spring.xml,\
41        META-INF/scheduler-spring.xml,\
42        META-INF/scripting-spring.xml,\
43        META-INF/search-spring.xml,\
44        META-INF/workflow-spring.xml,\
45        \
46        META-INF/counter-spring.xml,\
47        META-INF/document-library-spring.xml,\
48        META-INF/mail-spring.xml,\
49        META-INF/portal-spring.xml,\
50        META-INF/portlet-container-spring.xml,\
51        \
52        #META-INF/dynamic-data-source-spring.xml,\
53        META-INF/shard-data-source-spring.xml,\
54        #META-INF/memcached-spring.xml,\
55        #META-INF/monitoring-spring.xml,\
56        \
57        META-INF/ext-spring.xml
58   
Michael Klos
RE: Liferay EE 6.0 SP2 + database sharding = exception
October 28, 2011 7:08 AM
Answer

Michael Klos

Rank: New Member

Posts: 17

Join Date: March 6, 2009

Recent Posts

http://issues.liferay.com/browse/LPS-22577
Magnus Smith
RE: Liferay EE 6.0 SP2 + database sharding = exception
November 1, 2011 11:31 AM
Answer

Magnus Smith

Rank: New Member

Posts: 3

Join Date: March 18, 2011

Recent Posts

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
RE: Liferay EE 6.0 SP2 + database sharding = exception
November 2, 2011 4:13 AM
Answer

Michael Klos

Rank: New Member

Posts: 17

Join Date: March 6, 2009

Recent Posts

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

 1
 2spring.configs=\
 3        META-INF/base-spring.xml,\
 4        \
 5        META-INF/hibernate-spring.xml,\
 6        META-INF/infrastructure-spring.xml,\
 7        META-INF/management-spring.xml,\
 8        \
 9        META-INF/util-spring.xml,\
10        \
11        META-INF/jpa-spring.xml,\
12        \
13        META-INF/audit-spring.xml,\
14        META-INF/cluster-spring.xml,\
15        META-INF/editor-spring.xml,\
16        META-INF/executor-spring.xml,\
17        META-INF/jcr-spring.xml,\
18        META-INF/ldap-spring.xml,\
19        META-INF/messaging-core-spring.xml,\
20        META-INF/messaging-misc-spring.xml,\
21        META-INF/mobile-device-spring.xml,\
22        META-INF/notifications-spring.xml,\
23        META-INF/poller-spring.xml,\
24        META-INF/rules-spring.xml,\
25        META-INF/scheduler-spring.xml,\
26        META-INF/scripting-spring.xml,\
27        META-INF/search-spring.xml,\
28        META-INF/workflow-spring.xml,\
29        \
30        META-INF/counter-spring.xml,\
31        META-INF/document-library-spring.xml,\
32        META-INF/mail-spring.xml,\
33        META-INF/portal-spring.xml,\
34        META-INF/portlet-container-spring.xml,\
35        \
36        #META-INF/dynamic-data-source-spring.xml,\
37        META-INF/shard-data-source-spring.xml,\
38        #META-INF/memcached-spring.xml,\
39        #META-INF/monitoring-spring.xml,\
40        \
41        META-INF/ext-spring.xml
Abhay Chaware
RE: Liferay EE 6.0 SP2 + database sharding = exception
August 28, 2013 11:03 PM
Answer

Abhay Chaware

Rank: Junior Member

Posts: 36

Join Date: July 17, 2013

Recent Posts

Thanks ! I think this must go in the SHARDING WIKI page of liferay.