Community
Participate
Working Groups
Problem: ------------------ I ran across this one when I temporarily removed the target-database and jdbc.platform elements from the persistence unit - I received an expected CNFE on Oracle10Platform - which was recently removed as part of bug# 218075 The same problem will occur for SQLAnywhere users in this case because of the fix in another recent bug. Reproduction ------------------- Comment out the following and perform a predeploy: <!-- property name="eclipselink.jdbc.platform" value="oracle.toplink.platform.database.oracle.OraclePlatform"/> <property name="eclipselink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/> <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/--> [EL Finest]: 2008.07.09 17:25:40.390--Thread(Thread[main,5,main])--DBPlatform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform, RegularExpression: (?i)oracle.*. [EL Fine]: 2008.07.09 17:25:40.390--Thread(Thread[main,5,main])--Detected Vendor platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform [EL Finest]: 2008.07.09 17:25:40.405--ServerSession(12014584)--Thread(Thread[main,5,main])--End deploying Persistence Unit statJPA; state Deployed; factoryCount 1 Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-7042] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080708)): org.eclipse.persistence.exceptions.ValidationException Exception Description: Database platform class [org.eclipse.persistence.platform.database.oracle.Oracle10Platform] not found. Internal Exception: Exception [EclipseLink-3007] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080708)): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [org.eclipse.persistence.platform.database.oracle.Oracle10Platform], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [org.eclipse.persistence.platform.database.oracle.Oracle10Platform] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: org.eclipse.persistence.platform.database.oracle.Oracle10Platform at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:267) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:69) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:118) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:112) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:100) at org.eclipse.persistence.example.navigation.Introspector.initialize(Introspector.java:111) at org.eclipse.persistence.example.navigation.Introspector.main(Introspector.java:162) Fix: ------------------- In core/resource/org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties From: SQL\ Anywhere=org.eclipse.persistence.platform.database.SQLAnyWherePlatform (?i)oracle.*=org.eclipse.persistence.platform.database.oracle.Oracle10Platform To: SQL\ Anywhere=org.eclipse.persistence.platform.database.SQLAnywherePlatform (?i)oracle.*=org.eclipse.persistence.platform.database.oracle.OraclePlatform
Created attachment 107026 [details] core.resource.patch Oracle10Platform is replaced by the generic OraclePlatform SQLAnyWhere is renamed SQLAnywhere Todo: Require new JPA tests for platform generation in the absence of a target-server element
Reviewed with Tom, the CNFE is normal if the run target of the app does not include the org.eclipse.persistence.oracle project in the classpath which is in the eclipselink.jar - as the Oracle9|10|11Platform classes solely exist there now. Q) Going forward do we want to move to Oracle11Platforom as the default auto-detect platform for oracle?
Created attachment 107069 [details] propose that Oracle11 from (oracle project) is the default auto-detect
Created attachment 107073 [details] The EPL/EDL license header was the 2007 version (all resources)
I need to ask Doug about switching to the Oracle11 platform default
Retask: (the exception is normal if the client does not have foundation/core.oracle or eclipselink.jar on the classpath) -------------------------------------- Discussed with PM 1) we need to refactor the auto-detection code to check the MAJOR/MINOR db version. 2) Before instantiating a platform we should traverse the platform tree to verify that a class exists so a CNFE does not occur in any case. A platform independent method would be preferred - for example the TC4Connection class states the version number... via platform dependent... OracleDatabaseMetaData(OracleDatabaseMetaData).getDatabaseProductName() line: 198 [local variables unavailable] or... Thread [main] (Suspended) DBPlatformHelper.matchVendorNameInProperties(String, Properties, SessionLog) line: 107 DBPlatformHelper.getDBPlatform(String, SessionLog) line: 62 versionNumber 10201 conn T4CConnection (id=49) url "jdbc:oracle:thin:@1...:1521:orcl" (id=195) ver T4C7Oversion (id=197) versionNumber 10201 ServerSession(DatabaseSessionImpl).loginAndDetectDatasource() line: 573 EntityManagerFactoryProvider.login(ServerSession, Map) line: 209 EntityManagerSetupImpl.deploy(ClassLoader, Map) line: 246 EntityManagerFactoryImpl.getServerSession() line: 69 EntityManagerFactoryImpl.createEntityManagerImpl(Map, boolean) line: 118 EntityManagerFactoryImpl.createEntityManagerImpl(boolean) line: 112 EntityManagerFactoryImpl.createEntityManager() line: 100 The call in ServerSession.loginAndDetectDatasource should also get the version numbers as well as the datasource name and pass these to DBPlatformHelper.matchVendorNameInProperties(). getLogin().setPlatformClassName(DBPlatformHelper.getDBPlatform(conn.getMetaData().getDatabaseProductName(), getSessionLog()));
This bug is being moved to Future where we can properly sort them all together based on community votes and severity. We will then assign them accordingly to future patch sets and releases.
Changing the priority of the bugs that have been recently triaged to future. Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink