Java weblogic 12.2.1.3升级后,当从swing使用enum访问ejb bean时,CORBA封送1398079699/InvalidClassException

Java weblogic 12.2.1.3升级后,当从swing使用enum访问ejb bean时,CORBA封送1398079699/InvalidClassException,java,java-8,enums,ejb,weblogic12c,Java,Java 8,Enums,Ejb,Weblogic12c,*应用程序详细信息-swing、ejb、weglobic 12.2.1.3、java 8-客户端服务器桌面应用程序 最近,我们将应用程序从jdk 7升级到8,并将weblogic 12.1.3升级到12.2.1.3。因此,基于weblogic文档,我们将wlfullclient.jar替换为wlthin3client.jar 然而,在替换了这个jar之后,我们在来自客户端的ejb类通信的ew中遇到了上述异常。它不会在所有EJB中引起问题。但是可序列化的JavaBean具有导致此问题的枚举。而且

*应用程序详细信息-swing、ejb、weglobic 12.2.1.3、java 8-客户端服务器桌面应用程序

  • 最近,我们将应用程序从jdk 7升级到8,并将weblogic 12.1.3升级到12.2.1.3。因此,基于weblogic文档,我们将wlfullclient.jar替换为wlthin3client.jar

  • 然而,在替换了这个jar之后,我们在来自客户端的ejb类通信的ew中遇到了上述异常。它不会在所有EJB中引起问题。但是可序列化的JavaBean具有导致此问题的枚举。而且,这些类和enum紧密集成在应用程序中。所以,不能改变执行

    -我们尝试订购不同的WL客户端jar,如wlclient.jar、wlthin3client.jar、wljmsclient.jar和客户端应用程序类路径中的其他几个,但没有成功

  • 如果我使用以前的WL版本wlfullclient.jar,一切正常。然而,根据WL文档,该jar已弃用,在WL(12.2.1.3)中不可用,我们需要用wlthin3client.jar替换它*

…并且
com.xxxx.xxxx.VcrConfigRelationship$VcrConfigType
是否具有可访问的无参数构造函数?否。根据下面的语句==>对象是可序列化的(自身实现可序列化接口),即使其超类不是。但是,serializable类层次结构中的第一个超类(未实现serializable接口)必须具有无参数构造函数。如果违反此规则,readObject()将在运行时生成java.io.InvalidClassException。而且,上述代码早在升级之前就存在了。那么,为什么它对wlfullclient.jar有效呢?对于超类来说,没有arg构造函数是不够的,所述构造函数还必须能够被子类访问(在同一个包中是
public
protected
或default)。你是说
VcrConfigType
是不可序列化的,你是在使用它的可序列化子类?VcrConfigType是VcrConfigRelationship.java可序列化bean中的枚举。我在上面添加了这个类的示例代码。然后,关于超类构造函数可访问性的规则不适用,因为
enum
常量是特殊的。标准序列化将只记录类型和名称,并在反序列化时从类型中获取实际常量。这与IIOP不匹配,但是,不管它做什么,它都不能应用标准的对象序列化过程(在您的案例中它似乎正在尝试)
java.lang.Enum
没有无参数构造函数。
com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
WARNING: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7004)

**Caused by: java.io.InvalidClassException: com.xxxx.xxxx.VcrConfigRelationship$VcrConfigType; UnsupportedOperationException accessing no-arg constructor**
    at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1471)
    at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:414)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:341)

Caused by: java.lang.UnsupportedOperationException
    at com.sun.corba.se.impl.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:1020)

java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is: 
    org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
    at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:227)
    at javax.rmi.CORBA.Util.mapSystemException(Util.java:95)

public class VcrConfigRelationship implements Serializable {
    private static final long serialVersionUID = 1L;
    public enum VcrConfigType {
        TEST("TEST"), TESTENV("TESTENV"),NULL;
        private String value;
        private VcrConfigType() {
            this.value = null;
        }
        private VcrConfigType(String value) {
            this.value = value;
        }
        public String getValue() {
            return value;
        }
    }
    private VcrConfigType configCd;
    public VcrConfigRelationship(int configParamId, VcrConfigType configCd) {
        super();
        this.configParamId = configParamId;
        this.configCd = configCd;
    }