Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.platform.database.DatabasePlatform incompatible with org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform

Odd, seems to be a class-loader issue.  Where did you put the eclipselink.jar
on your classpath (system, applib, ear)?  Do you still get the error if you
don't use a sessions.xml, just set the platform in the persistence.xml
property?

As a workaround you could probably set the platform through a
SessionCustomizer.


dmitryerkin wrote:
> 
> 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
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Internal-Exception%3A-java.lang.ClassCastException%3A-org.eclipse.persistence.platform.database.DatabasePlatform-incompatible-with-org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform-tp18847857p18851700.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top