---
schema_version: "1"
id: 94e47653117a6c040ab50e48369a556cdc3a4fd7fdacbe0b082b23fd127712b0
title: SDK コンポーネントおよび操作のトラブルシューティング - Mule 4
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mule-sdk/1.1/troubleshooting.md
canonical_url: https://docs.mulesoft.com/jp/mule-sdk/1.1/troubleshooting
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a75700538e7a9a1b1b2300cf5e6c462fa9415145fa3c5c65fa60b11995012e38
description: MuleSoft Documentation Site
release: "1.1"
latest: false
---
# SDK コンポーネントおよび操作のトラブルシューティング - Mule 4

以下のトラブルシューティング機能は、Mule SDK 1.4 以降で使用できます。

Java SDK のトラブルシューティングを行うために、ログ記録 (冗長ログを含む) を有効にする方法と、一般的なエラーメッセージの解釈について学習します。

## [](#ログ記録)ログ記録

ログを使用して、次の SDK コンポーネントのトラブルシューティングを行います。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 40%;">
<col style="width: 60%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">コンポーネント名</th>
<th class="tableblock halign-left valign-top">ログ機能</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.mulesoft.com/jp/mule-sdk/1.1/sources" class="xref page">ソース</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ライフサイクルの開始時と終了時など、ソースライフサイクルに関する情報をログに記録します。
エラーと再接続の場合、ログには発生した例外に関連付けられた完全なスタック追跡が表示されます。
クラスター環境の場合、ログにはソース状況情報が表示されます。これは、それがプライマリソースであるかどうかを示します。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.mulesoft.com/jp/mule-sdk/1.1/polling-sources" class="xref page">ポーリング入力元</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ソースによって承認および拒否された項目に関する情報をログに記録します。
拒否の場合、ログには拒否の原因に関する情報が含まれます。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.mulesoft.com/jp/mule-sdk/1.1/polling-sources#_watermarking" class="xref page">ポーリング入力元のウォーターマーク処理</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ポーリング入力元に対するウォーターマーク処理に関する情報をログに記録します。
このプロセスは低レベルのロジックを使用するため、デバッグまたはトラブルシューティングが必要な場合にのみトレースログを有効にします。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.mulesoft.com/jp/mule-sdk/1.1/connections#_pooling-strategy" class="xref page">プーリング接続プロバイダー</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">プーリング接続プロバイダーの接続管理に関する情報をログに記録します。
このログには、接続プールの状況情報、およびプールが接続を取得して返すタイミングを示す接続処理が表示されます。</p></td>
</tr>
</tbody>
</table>

## [](#冗長ログ)冗長ログ

冗長ログを使用して SDK コンポーネントのトラブルシューティングを行い、状況または動作に関する情報を取得します。 アプリケーションのパフォーマンスに大きく影響するため、冗長ログはテストやトラブルシューティングでのみ使用してください。

Anypoint Studio、または CloudHub API を使用している場合は Anypoint Runtime Manager で、冗長ログを有効にします。 どちらの場合も、アプリケーションのログファイルに情報が記録されます。

### [](#anypoint-studio-での冗長ログの有効化)Anypoint Studio での冗長ログの有効化

次の手順では、Anypoint Studio を使用して冗長ログを有効にする方法について説明します。

1. Anypoint Studio にアクセスし、​**\[Package Explorer\]**​ ビューに移動します。
2. アプリケーションのプロジェクト名を開きます。
3. `src/main/resources`​ パスフォルダーを開きます。
4. フォルダー内の ​`log4j2.xml`​ ファイルを開きます。
    
    ![enable-sdk-logging-studio](/mulesoft/current/ja-jp/mule-sdk/1.1/_images/enable-sdk-logging-studio.png)
5. `<Loggers>`​ タグ内に ​`<AsyncLogger>`​ タグを追加します。
    
    ```xml
    <Loggers>
        ...
        <AsyncLogger name="<component's fully qualified name>" level="<logging level>"/>
        ...
    </Loggers>
    ```
    
    コンポーネントの完全修飾名を指定するための参照として、次の表を使用してください。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 40%;">
<col style="width: 40%;">
<col style="width: 20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">完全修飾名</th>
<th class="tableblock halign-left valign-top">ログレベル</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">接続元</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>DEBUG</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ポーリング入力元</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>org.mule.runtime.module.extension.internal.runtime.source.poll.PollingSourceWrapper</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>DEBUG</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ポーリング入力元のウォーターマーク処理</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>org.mule.runtime.module.extension.internal.runtime.source.poll.PollingSourceWrapper</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>TRACE</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">プーリング接続プロバイダー</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>org.mule.runtime.core.internal.connection.PoolingConnectionHandler</code>​
​<code>org.mule.runtime.core.internal.connection.PoolingConnectionManagementStrategy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>DEBUG</code></p></td>
</tr>
</tbody>
</table>
    
    次の例は、完全修飾名を ​`log4j2.xml`​ ファイルに追加し、ソースの冗長ログを有効にする方法を示しています。
    
    ```xml
    <Loggers>
       ...
        <!-- Mule logger -->
        <AsyncLogger name="org.mule.runtime.core.internal.processor.LoggerMessageProcessor" level="INFO"/>
        <AsyncLogger name="org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource" level="DEBUG"/>
        <AsyncRoot level="INFO">
            <AppenderRef ref="file" />
        </AsyncRoot>
    </Loggers>
    ```

### [](#anypoint-runtime-manager-での冗長ログの有効化)Anypoint Runtime Manager での冗長ログの有効化

次の手順では、Anypoint Runtime Manager を使用して冗長ログを有効にする方法について説明します。

1. Anypoint Runtime Manager にアクセスします。
2. 目的のアプリケーションを選択します。
3. 左側のペインで、​**\[Settings (設定)\]**​ に移動します。
4. **\[Logging (ログ)\]**​ タブに移動します。
    
    ![sdk-verbose-logging-runtime-manager](/mulesoft/current/ja-jp/mule-sdk/1.1/_images/enable-sdk-logging-runtime-manager.png)
5. コンポーネントの完全修飾名とログレベル (DEBUG または TRACE) を追加します。 コンポーネントの完全修飾名を指定する方法が示されている表を参照してください。
6. **\[Apply Changes (変更を適用)\]**​ をクリックします。

## [](#ログの例)ログの例

次の例は、SDK コンポーネントで想定されるログを示しています。

- [ソースログの例](#source-logging-example)
- [ポーリングソースログの例](#polling-source-logging-example)
- [ポーリングソースウォーターマークログの例](#polling-source-watermarking-logging-example)
- [プーリング接続プロバイダーログの例](#pooling-connection-provider-logging-example)

以下の例は、FTP サーバーのファイルをリストする FTP Connector ソースと処理したファイルの名前を記録するロガーで構成される Mule アプリケーションからのログです。

![FTP Connector ソースとロガーを表示する Studio の Mule フロー](/mulesoft/current/ja-jp/mule-sdk/1.1/_images/troubleshooting-app.png)

### [](#source-logging-example)ソースログの例

次の例は、ソースのログを示しています。

```none
org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource: Message source 'listener' on flow 'ftp-troubleshooting-examples' threw exception. Attempting to reconnect...
org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource: Message source 'listener' on flow 'ftp-troubleshooting-examples' successfully reconnected
org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource: Message source 'listener' on flow 'ftp-troubleshooting-examples' could not be reconnected. Will be shutdown.
org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource: Message source 'listener' on flow 'ftp-troubleshooting-examples' is stopping
```

### [](#polling-source-logging-example)ポーリングソースログの例

次の例は、ポーリングソースのログを示しています。

```none
org.mule.runtime.module.extension.internal.runtime.source.poll.PollingSourceWrapper: Item with id:[/ftp-example.json] is accepted
org.mule.runtime.module.extension.internal.runtime.source.poll.PollingSourceWrapper: Item with id:[/ftp-example.json] is rejected with status:[FILTERED_BY_WATERMARK]
```

### [](#polling-source-watermarking-logging-example)ポーリングソースウォーターマークログの例

次の例は、ポーリングソースウォーターマークのログを示しています。

```none
org.mule.runtime.module.extension.internal.runtime.source.poll.PollingSourceWrapper: A new watermark maximum has been found when processing item with id /ftp-example.json for source in flow ftp-troubleshooting-examples
```

### [](#pooling-connection-provider-logging-example)プーリング接続プロバイダーログの例

次の例は、プーリング接続プロバイダーのログを示しています。

```none
org.mule.runtime.core.internal.connection.PoolingConnectionManagementStrategy: Acquiring connection org.mule.extension.ftp.internal.connection.FtpFileSystem@1a0c776f from the pool FTP_Config-5e20b7d9-417d-4307-ab4c-9ef3e7ae4d9b
org.mule.runtime.core.internal.connection.PoolingConnectionManagementStrategy: Status for pool FTP_Config-5e20b7d9-417d-4307-ab4c-9ef3e7ae4d9b: 1 connections are active out of 5 max active limit, 0 connections are idle out of 5 max idle limit
```

## [](#エラー-cannot-find-org-mule-sdk-api-classes-org-mule-sdk-api-クラスが見つかりません)エラー: Cannot Find org.mule.sdk.api Classes (org.mule.sdk.api クラスが見つかりません)

モジュールの親 POM のバージョン 1.4.0 を使用すると、Java SDK によって ​`Cannot access XYZ class file: XYZ not found`​ または ​`Cannot find symbol: method someMethod() location: variable someVar of type XYZ`​ (この XYZ は ​`org.mule.sdk.api`​ パッケージのクラス) などのエラーがスローされます。

```xml
<parent>
  <groupId>org.mule.extensions</groupId>
  <artifactId>mule-modules-parent</artifactId>
  <version>1.4.0</version>
</parent>
```

次に例を示します。

\[ERROR\] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project : Compilation failure:

cannot access org.mule.sdk.api.runtime.streaming.StreamingHelper
\[ERROR\] class file for org.mule.sdk.api.runtime.streaming.StreamingHelper not found

cannot find symbol
\[ERROR\]   symbol:   method resolveCursors(java.util.HashMap<java.lang.String,java.lang.Object>,boolean)
\[ERROR\]   location: variable streamingHelper of type org.mule.runtime.extension.api.runtime.streaming.StreamingHelper

`org.mule.sdk.api`​ パッケージは実験的機能であり、現在まだ開発中です。非実験的機能のドキュメントページで明示的に指示されない限り、このパッケージは使用しないでください。このパッケージは実験的であるため、MuleSoft ではこのパッケージで定義されたクラスに対するサポート、または後方互換性を保証いたしません。

`org.mule.sdk.api`​ パッケージのクラスやインターフェースがすべての Mule バージョンで認識されるとは限らない点にも注意が必要です。より正確には、​`org.mule.sdk.api`​ のどのクラスも Mule バージョン 4.4 以前では認識されず、そのすべてのコンポーネントが Mule 4.4 以降でサポートされるとは限りません。

このエラーを修正するには、​`org.mule.sdk.api`​ パッケージの使用を避け、代わりに ​`org.mule.runtime.extension.api`​ パッケージの同等のクラスまたはアノテーションを使用してください。