Hi Team,

i am getting a strange error while using spring with eclipselink

org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The class, [MigriertAttributeTransformer] cannot be used as an 
AttributeTransformer.
Internal Exception: java.lang.ClassCastException: class MigriertAttributeTransformer cannot be cast to 
class org.eclipse.persistence.mappings.transformers.Attrib
 uteTransformer (MigriertAttributeTransformer is in unnamed module of loader 
org.springframework.instrument.classloading.SimpleThrowawayClassLoader @6cc86152; org 
.eclipse.persistence.mappings.transformers.AttributeTransformer is in unnamed module of loader 'app')

I got answers from eclipselink forum saying its something to do with spring classloader but didnot find anything useful.

Could you please help me out

Iam using spring 5.2.7 version with eclipselink 2.7.6

These are my properties in persistence.xml

 <properties>
                    <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver" />
                    <property name="javax.persistence.jdbc.url" value="" />
                    <property name="javax.persistence.jdbc.user" value="" />
                    <property name="javax.persistence.jdbc.password" value="" />
                     <property name="eclipselink.ddl-generation" value="create-tables" />
                <property name="eclipselink.ddl-generation.output-mode" value="database" />
                    <property name="eclipselink.logging.level" value="ALL" />
                    <property name="eclipselink.logging.parameters" value="true" />
                    <!-- from iau-maris-opa -->
                    <property name="eclipselink.jdbc.bind-paramaters" value="true" />
                    <property name="eclipselink.target-database" value="Oracle" />
                    <property name="eclipselink.target-server" value="None"/>
                    <property name="eclipselink.persistence-context.flush-mode" value="commit" />
                    <property name="eclipselink.persistence-context.reference-mode" value="WEAK" />
                <property name="eclipselink.weaving" value="static" />
                <property name="eclipselink.weaving.eager" value="true" />
                 <property name="eclipselink.jdbc.exclusive-connection.mode" value="Always"/>
                 <property name="eclipselink.sessions-xml" value="Testsessions.xml"/>
                 <property name="eclipselink.session-name" value="default_test"/>
                  <property name="eclipselink.orm.validate.schema" value="boTLDescriptor.xml"/>
                <!--  <property name="eclipselink.target-server" value=""/>-->

            </properties>

Spring-context.xml lookslike this

 <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">

    <property name="persistenceXmlLocation" value="classpath:persistence.xml" />
 <!-- <property name="dataSource" ref="dataSource" />-->
    <property name="persistenceUnitName" value="persistenceUnit_test" />
    <property name="jpaVendorAdapter">
        <bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
            <property name="showSql" value="true"/>
            <property name="generateDdl" value="true"/>
           <property name="databasePlatform" value="org.eclipse.persistence.platform.database.Oracle12Platform"/>
        </bean>
    </property>
    <property name="jpaDialect">
        <bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect" />
    </property>
<property name="jpaPropertyMap">
    <props>
        <prop key="eclipselink.weaving">false</prop>
    </props>
    </property>
</bean>

Comment From: bclozel

Sorry but open source support is EOL for the 5.2.x generation. We can reopen this issue if you can reproduce the problem on a supported version. In that case, providing a sample application would be necessary. Thanks.