legacy-knowledge-base
公開されました Sep. 10, 2025

DB2 データベース作成時のSQLエラー

written-by

Jose Jimenez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • サーバー起動時のデータベース作成時にDB2 SQLエラーが発生し、ログに以下のようなメッセージが表示されます:
    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
  • ブラウザでのリクエストは、次のようなエラーで空白のページが返されることがあります:
    An unexpected system error occurred.
    
    java.lang.NullPointerException
    

環境

解像度

  • DB2 データベースは、テーブルスペースの 32k ページサイズ を使用して作成する必要があります。
  • portal-ext.propertiesファイルに、次のDB2固有の設定を追加します:
    custom.sql.function.isnull=CAST(? AS VARCHAR(32672)) IS NULL
    custom.sql.function.isnotnull=CAST(? AS VARCHAR(32672)) IS NOT NULL
  • Liferay データベースは多言語サポートのために UTF-8 を使用する必要があり、 UTF-8 コードセットを使用して DB2 データベースを作成します。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base