PDF exports are failing with a 'java is not an executable' error

お困りですか?

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

コミュニティに質問

プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

PDF exports are failing with a "java is not an executable" error on Confluence Data Center after a JDK change:



環境

Confluence Data Center (6.10 and newer, 7.x and 8.x)


診断

1. PDF exports are failing with the following error:

Caused by: com.atlassian.confluence.util.sandbox.SandboxException: /opt/jdk/jdk8u332-b09/jre/bin/java is not an executable

PS: for instances hosted on Windows Server, a similar "java.exe is not an executable" error will be displayed.


2. The directory mentioned in $JAVA_HOME is not available at the server:

$ sudo su - confluence

$ echo $JAVA_HOME
/opt/jdk/jdk8u332-b09/jre

$ cd $JAVA_HOME
cd: no such file or directory: /opt/jdk/jdk8u332-b09/jre


3. The following error is displayed in <Confluence-Home>/logs/atlassian-confluence.log:

2022-12-20 14:22:08,583 ERROR [http-nio-127.0.0.1-8090-exec-182] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
 -- url: /spaces/flyingpdf/pdfpageexport.action | traceId: 101bf951f8e1603f | userName: charlie | referer: https://charlie.confluence.com/display/CHARLIE/SamplePage
java.lang.RuntimeException: com.atlassian.confluence.importexport.ImportExportException: We couldn't complete your export. There was an error converting the page "SamplePage". <a href="https://docs.atlassian.com/confluence/docs-718/PDF+export+in+Confluence+Data+Center">Learn more</a>
	at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction.doExecute(ExportPageAsPdfAction.java:58)
	at com.atlassian.confluence.extra.flyingpdf.impl.PdfExportSemaphore.run(PdfExportSemaphore.java:28)
	at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:31)
        ...
Caused by: com.atlassian.confluence.importexport.ImportExportException: We couldn't complete your export. There was an error converting the page "SamplePage". <a href="https://docs.atlassian.com/confluence/docs-718/PDF+export+in+Confluence+Data+Center">Learn more</a>
	at com.atlassian.confluence.extra.flyingpdf.sandbox.SandboxXmlToPdfConverter.convertXhtmlToPdf(SandboxXmlToPdfConverter.java:108)
	at com.atlassian.confluence.extra.flyingpdf.sandbox.SandboxPdfExporterService.renderPdf(SandboxPdfExporterService.java:348)
	at com.atlassian.confluence.extra.flyingpdf.sandbox.SandboxPdfExporterService.createPdf(SandboxPdfExporterService.java:334)
        ...
	... 415 more
Caused by: com.atlassian.confluence.util.sandbox.SandboxException: /opt/jdk/jdk8u332-b09/jre/bin/java is not an executable
	at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.getJavaRuntime(SandboxProcess.java:330)
	at com.atlassian.confluence.impl.util.sandbox.SandboxProcess.start(SandboxProcess.java:254)

原因

Java is not available at the defined $JAVA_HOME location, so the External Process Pool (also known as "Sandbox") fails to start with the above error.

This is most likely caused by a Java update (eg. Java 8 to 11) where the old version is removed from the server but Confluence was not restarted.

It is also possible that the Java directory was moved or deleted after Confluence was started up.

ソリューション

Confluence を再起動します。

Once done, confirm if $JAVA_HOME is updated with the new Java path:

$ sudo su - confluence

$ echo $JAVA_HOME
/opt/jdk/jdk11.0.14.1/jre

$ $JAVA_HOME/bin/java -version
OpenJDK Runtime Environment Temurin-11.0.14.1+1 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.14.1+1 (build 11.0.14.1+1, mixed mode)


回避策

Restarting Confluence during business hours may cause unwanted downtime, so here's a few options:

1. Temporarily restore the deleted Java version to the original $JAVA_HOME path on the server.

PS: Once Confluence gets restarted and the $JAVA_HOME variable is updated, the old Java version can be deleted again.

2. Manually update the $JAVA_HOME variable with the new Java path:

$ sudo su - confluence

$ echo $JAVA_HOME
/opt/jdk/jdk8u332-b09/jre

$ JAVA_HOME=/opt/jdk/jdk11.0.14.1/jre

$ echo $JAVA_HOME
/opt/jdk/jdk11.0.14.1/jre



最終更新日: 2022 年 12 月 28 日

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

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