1. 程式人生 > >EclipseLink2.7出現java.lang.SecurityException異常

EclipseLink2.7出現java.lang.SecurityException異常

在把EclipseLink從6.x升級到7.3的時候出現如下異常:

java.lang.SecurityException: class "javax.persistence.Index"'s signer information does not match signer information of other classes in the same package

這裡瞭解到這個bug在3.0才會修復,可是3.0目前還沒有釋出。
臨時性解決辦法就是排除預設依賴,降低javax.persistence的版本,Maven配置如下:

<dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.7.3</version>
        <exclusions>
            <exclusion>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>javax.persistence</artifactId>
            </exclusion>
    </exclusions>
</dependency>
<dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.1.1</version>
</dependency>