Spring-RMI事件导致java.io.InvalidClassException:过滤器状态:已拒绝 [英] Spring-RMI event causes java.io.InvalidClassException: filter status: REJECTED

查看:1577
本文介绍了Spring-RMI事件导致java.io.InvalidClassException:过滤器状态:已拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

项目使用RMI时,Spring 4.3.3和Java 8存在问题.在使用RMI将事件发送到其他应用程序期间,应用程序引发异常.它运行良好(应用程序已有几年历史了),但是在Weblogic服务器上安装了一些补丁程序后就崩溃了.

代码

应用程序使用spring-context

org.springframework.context.support.AbstractApplicationContext

 private void publishEvent(final ApplicationEvent event) {
        taskExecutor.submit(new Runnable() {
            @Override
            public void run() {
                publisher.publishEvent(event);
            }
        });
    }

日志

> 2019-10-01 10:42:14,366 ERROR .c.b.i.i.ImportServiceImpl - An unexpected error occurred during the synchronous import process.
org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.io.InvalidClassException: filter status: REJECTED
        at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:215)
        at org.springframework.remoting.rmi.RmiClientInterceptor.getStub(RmiClientInterceptor.java:237)
        at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:258)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

(...)       


>   Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.io.InvalidClassException: filter status: REJECTED
        at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:125)
        at java.rmi.Naming.lookup(Naming.java:101)
        at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:200)
        ... 104 common frames omitted
Caused by: java.io.InvalidClassException: filter status: REJECTED
        at java.io.ObjectInputStream.filterCheck(ObjectInputStream.java:1255)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1878)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:123)
        ... 106 common frames omitted

解决方案

我在类似的情况下使用了上面提出的解决方案,并且对我有用:

JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.oif.serialFilterScope=weblogic

您可以找到Weblogic设置的说明 解决方案

I used the solution proposed above in a similiar situation and it works for me:

JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.oif.serialFilterScope=weblogic

You can find the description of the Weblogic settings here.

这篇关于Spring-RMI事件导致java.io.InvalidClassException:过滤器状态:已拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆