SQL 例外のトラブルシューティング

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

以下のような例外が発生した場合、Confluence インスタンスのログ レベルを上げることをお勧めします。アトラシアン サポートをリクエストする場合、この追加のログがあると、エラーの原因を解決するのに役立ちます。

ログ レベルを上げると、以下のようなエラーの診断が可能になります。

org.springframework.dao.DataIntegrityViolationException: (HibernateTemplate): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Duplicate entry '1234' for key 1
 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)
caused by: java.sql.BatchUpdateException: Duplicate entry '1234' for key 1
 at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647) 

または

(HibernateTemplate): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: ORA-00001: unique constraint (CONFLUENCE.SYS_C0012345) violated

このドキュメントでは、システムのログを増加させる手順を説明します。


Confluence 11.0 and later: logging is configured in log4j2.xml , and the log4j.properties  file is no longer read. Confluence 11.0 also uses a newer version of Hibernate, so the logger names in earlier versions of this page, such as net.sf.hibernate.SQL  and net.sf.hibernate.type , no longer produce any output. Use the logger names on this page instead.

管理コンソールを介したログ レベルの変更

Confluence 2.7 以降の場合、実行中に管理コンソールからログ レベルを調整することができます。 — 「手順」を参照してください。以下では log4j ファイルを直接変更する方法を説明しています。

  1. Open confluence/WEB-INF/classes/log4j2.xml and find the following lines in the <Loggers>  section:
    <Logger level="error" name="org.hibernate.SQL" additivity="false">
      <AppenderRef ref="sqllog"/>
    </Logger>
    
    (info) log4j2.xml ファイル内にこれらの行がない場合は、ファイルの最後に追加します。
  2. Change the level of org.hibernate.SQL  to debug , and add a new logger for org.hibernate.orm.jdbc.bind  directly after it: 
    <!-- log hibernate prepared statements/SQL queries (equivalent to setting 'hibernate.show_sql' to 'true') -->
    <Logger level="debug" name="org.hibernate.SQL" additivity="false">
      <AppenderRef ref="sqllog"/>
    </Logger>
    
    <!-- log hibernate prepared statement parameter values -->
    <Logger level="trace" name="org.hibernate.orm.jdbc.bind" additivity="false">
      <AppenderRef ref="sqllog"/>
    </Logger>
    Keep additivity="false"  and the <AppenderRef ref="sqllog"/>  line. They write the SQL logging to its own file, `atlassian-confluence-sql.log, rather than filling up the main application log. The parameter values are logged at `TRACE` level, which the main application log filters out by default.
  3. Confluence を再起動します。
  4. エラーの原因となった手順を再度実行します。
  5. ログ ディレクトリを zip 化し、サポート チケットに添付します。
  6. Oracle を使用していて制約エラーが発生した場合、データベース管理者に、制約 (CONFLUENCE.SYS_C0012345) が参照するテーブルと列を問い合わせ、その情報をサポート チケットに追加します。
  7. confluence/WEB-INF/classes/log4j2.xml を再度開いて、手順 1 で追加した 4 行を削除します (追加のログ取得はパフォーマンスに影響を与えるため、この手順が完了したら無効にする必要があります)。
関連トピック

Enabling Detailed SQL Logging
Working with Confluence Logs
Troubleshooting failed XML site backups

最終更新日: 2026 年 10 月 9 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.