DB2 SQL Errors during the database creation

Issue

  • There are DB2 SQL errors during the database creation in the server startup, causing messages in the log like the following: 
    2019-09-19 07:38:30.286 ERROR [main][ReleaseManagerOSGiCommands:93] bundle com.liferay.portal.upgrade.impl:3.0.6 (143)[com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands(410)] : The activate method has thrown an exception
    com.liferay.portal.kernel.upgrade.UpgradeException: Bundle com.liferay.portal.workflow.metrics.service_1.0.3 [928] has invalid content in tables.sql:_create table WorkflowMetricsSLADefinition (_	mvccVersion LONG default 0 not null,_	uuid_ VARCHAR(75) null,_    	workflowMetricsSLADefinitionId LONG not null primary key,_	groupId LONG,_	companyId LONG,_	userId LONG,_	userName VARCHAR(75) null,_	createDate DATE null,_	modifiedDate DATE null,_	name STRING null,_	description TEXT null,_	duration LONG,_	calendarKey VARCHAR(75) null,_	processId LONG,_	processVersion VARCHAR(75) null,_	pauseNodeKeys VARCHAR(75) null,_     	startNodeKeys VARCHAR(75) null,_	stopNodeKeys VARCHAR(75) null,_	status INTEGER_); [Sanitized]
    	at com.liferay.portal.spring.extender.internal.upgrade.InitialUpgradeExtender$InitialUpgradeStep.upgrade(InitialUpgradeExtender.java:179)
    [..]
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
    Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-601, SQLSTATE=42710, SQLERRMC=JOSE.WORKFLOWMETRICSSLADEFINITION;TABLE, DRIVER=4.26.14
    	at com.ibm.db2.jcc.am.b7.a(b7.java:810) 
    [..]
    	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:344)
    [..]
    	at com.liferay.portal.spring.extender.internal.upgrade.InitialUpgradeExtender$InitialUpgradeStep.upgrade(InitialUpgradeExtender.java:175)
    	... 122 more
    2019-09-19 07:38:33.573 INFO  [main][SystemCheckOSGiCommands:54] System check is enabled. You can run a system check with the command "system:check" in Gogo shell.
    19-Sep-2019 07:38:34.996 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [54,546] milliseconds
  • Request on browsers can return a blank page with the next error:
    An unexpected system error occurred.
    
    java.lang.NullPointerException
    

 

Environment

Resolution

  • DB2 database must be created using a 32k pagesize in the tablespace.
  • Add the next specific configuration for DB2 in the portal-ext.properties file:
    custom.sql.function.isnull=CAST(? AS VARCHAR(32672)) IS NULL
    custom.sql.function.isnotnull=CAST(? AS VARCHAR(32672)) IS NOT NULL
  • Liferay databases must use UTF-8 for a multilingual support, create the DB2 database using the UTF-8 codeset.

Additional Information

这篇文章有帮助吗?
0 人中有 0 人觉得有帮助