2

AtomikosがSpringを介して構成されている場合、jta.propertiesまたはtransactions.propertiesファイルは必要ありません。それにもかかわらず、Atomikosは、stderrに出力される次のメッセージで起動します。

No properties path set - looking for transactions.properties in classpath...
transactions.properties not found - looking for jta.properties in classpath...
Failed to open transactions properties file - using default values

Springの構成ではうまくいかなかったように見えますが、明らかにすべてが正常です。誰かがこれを取り除く方法を知っているので、私はそれについて1.000回尋ねられることはありませんか?

特定のコンポーネントまたはjarからstderrをリダイレクトする方法はありますか?

4

2 に答える 2

5

com.atomikos.icatch.hide_init_file_pathシステムプロパティを任意の値に設定する必要があります。これは、Javaコマンドラインで実行します。Mavenでは、次のようにコマンドライン引数をsurefireに渡すことでこれを行います。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <argLine>-Dcom.atomikos.icatch.hide_init_file_path=true</argLine>
    </configuration>
</plugin>

更新:Spring構成ファイル内から、次のようにプロパティを設定できます。

<bean id="atomikosSystemProps" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject">
        <!-- System.getProperties() -->
        <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
            <property name="targetClass" value="java.lang.System" />
            <property name="targetMethod" value="getProperties" />
        </bean>
    </property>
    <property name="targetMethod" value="putAll" />
    <property name="arguments">
        <!-- The new Properties -->
        <util:properties>
            <prop key="com.atomikos.icatch.hide_init_file_path">true</prop>
        </util:properties>
    </property>
</bean>

インスタンス化の順序が正しくなるように、AtomikosBeanをこのBeanに「依存」させることを忘れないでください。

于 2010-07-16T14:40:16.070 に答える
1

AtomikosはSLF4Jでログを記録します。この依存関係のみがSLF4Jでログに記録される場合は、SLF4JのNOPバインダーを使用でき、何もログに記録されません。おそらくあなたが望むものではありませんが、非常に単純です。

特定のパッケージのログメッセージを無視するようにSLF4Jのバックエンドロガーを構成できます。SLF4Jのバックエンドロガーとしてログバックを使用した例:

<logger name="com.atomikos.something" level="OFF"/>

SLF4Jとさまざまなバックエンドロガーについてのチュートリアルをここに書きました。

于 2010-06-10T22:15:26.653 に答える