0

IBM WebSphere インスタンス (バージョン 8.5.xx) 上のアプリケーションに共有ライブラリが追加された場合にのみ、次のエラーが発生します。目標は、いくつかのアプリケーション間の多くの共有ライブラリ (jar) をサーバー上の共有ライブラリに移動して、アプリケーションの戦争サイズを縮小することです。私が見たところ、war ファイルのサイズが縮小されているかどうかは関係ありません。この共有ライブラリが追加されるたびに、以下のエラーが表示されます。

org.springframework.remoting.RemoteAccessException: Could not deserialize result from HTTP invoker remote service [<URL>]; nested exception is java.lang.ClassNotFoundException: com.example.models.ExampleModel
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:221)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:153)
    at com.example.configuration.LoggingHttpInvokerProxyFactoryBean.invoke(LoggingHttpInvokerProxyFactoryBean.java:28)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    at com.sun.proxy.$Proxy305.getSomeListOfObjects(Unknown Source)
...
...
...
Caused by: java.lang.ClassNotFoundException: com.example.models.ExampleModel
    at java.lang.Class.forNameImpl(Native Method)
    at java.lang.Class.forName(Class.java:403)
    at java.io.ClassCache$FutureValue.get(ClassCache.java:177)
    at java.io.ClassCache.get(ClassCache.java:148)
    at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:834)
    at org.springframework.core.ConfigurableObjectInputStream.resolveClass(ConfigurableObjectInputStream.java:78)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2017)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1900)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2194)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1722)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2439)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2363)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2221)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1722)
    at java.io.ObjectInputStream.readObjectImpl(ObjectInputStream.java:540)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:475)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.doReadRemoteInvocationResult(AbstractHttpInvokerRequestExecutor.java:291)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.readRemoteInvocationResult(AbstractHttpInvokerRequestExecutor.java:242)
    at org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor.doExecuteRequest(HttpComponentsHttpInvokerRequestExecutor.java:248)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:137)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:202)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:184)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:150)

以下は、モデル クラスが小さいスケールでどのように見えるかの同様の例です。私は主に、それが実際に Serializable を実装していることに注意したかった (デフォルトの serialVersionUID を使用):

package com.example.models.ExampleModel;

public class ExampleModel implements Serializable {
    private static final long serialVersionUID = 1L;
    private String customerNumber = "";
}

デバッグのアイデアは、少なくとも大歓迎です。また、共有ライブラリがサーバー上のアプリケーションに追加されていない場合、このリモート メソッドの呼び出しは正常に機能しますが、共有ライブラリが追加されている場合は機能しないようです。また、サーバー上の共有ライブラリには、見つからないクラスを含む jar がありません。見つからないクラスの jar が WEB-INF/lib フォルダーにあり、サーバーにインストールされることを確認しました。

4

2 に答える 2