« Return to Thread: Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.platform.database.DatabasePlatform incompatible with org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform

Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.platform.database.DatabasePlatform incompatible with org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform

by dmitryerkin :: Rate this Message:

Reply to Author | View in Thread

hi
I am trying to start an application which has an ejb3 module.
This module is configured to use the eclipselink persistence provider.
I receive next error while the application is starting:

Exception Description: Predeployment of PersistenceUnit [oebsEJB] failed.
Internal Exception: Exception [EclipseLink-9003] (Eclipse Persistence Services - 1.0 (Build 1.0 - 20080707)): org.eclipse.persistence.exceptions.SessionLoaderException
Exception Description: Unable to process XML tag [platform-class] with value [org.eclipse.persistence.platform.database.oracle.Oracle10Platform].
Internal Exception: java.lang.ClassCastException:
org.eclipse.persistence.platform.database.oracle.Oracle10Platform incompatible with org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform


here are my xml files.

persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence ../../../eclipselink/src/xsd/persistence_1_0.xsd ">
        <persistence-unit name="oebsEJB">
                <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <properties>
                        <property name="eclipselink.sessions-xml" value="sessions.xml"/>
                        <property name="eclipselink.session-name" value="oebs"/>
                </properties>
        </persistence-unit>
</persistence>

sessions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<sessions version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <session xsi:type="server-session">
      <name>oebs</name>
      <server-platform xsi:type="websphere-61-platform"/>
      <event-listener-classes/>
      <logging xsi:type="eclipselink-log"/>
      <primary-project xsi:type="xml">META-INF/oebs.xml</primary-project>
      <login xsi:type="database-login">
         <platform-class>org.eclipse.persistence.platform.database.oracle.Oracle10Platform</platform-class>
         <password></password>
         <external-connection-pooling>true</external-connection-pooling>
         <external-transaction-controller>true</external-transaction-controller>
         <sequencing>
            <default-sequence xsi:type="table-sequence">
               <name>Default</name>
            </default-sequence>
         </sequencing>
         <datasource>jdbc/oebs</datasource>
         <struct-converters/>
      </login>
      <connection-pools>
         <read-connection-pool>
            <name>ReadConnectionPool</name>
            <exclusive>false</exclusive>
         </read-connection-pool>
         <write-connection-pool>
            <name>default</name>
         </write-connection-pool>
      </connection-pools>
      <connection-policy/>
   </session>
</sessions>

The platform-class is located in the sessions.xml file.

The application server which I use is Websphere AS 6.1.0.17.

Why can not eclipselink do an explicit type conversion between org.eclipse.persistence.platform.database.DatabasePlatform and org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform although DatabasePlatform is the children of DatasourcePlatform?

Regards
Dmitry

 « Return to Thread: Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.platform.database.DatabasePlatform incompatible with org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform