[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] java.lang.ClassNotFoundException: org.eclipse.peristence.platform.database.oracle.OraclePlatform

It worked fine by removing the following 

 <property name="databasePlatform"
value="org.eclipse.peristence.platform.database.oracle.OraclePlatform" />

from the 

	<bean id="entityManagerFactory"
	
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter">
			<bean
				class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
				<property name="showSql" value="true" />
				<property name="generateDdl" value="false" />
			</bean>
		</property>
		<property name="loadTimeWeaver">
			<bean
				class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"
/>
		</property>
	</bean>


Can somebody give me the reason ???


Gaurav Malhotra wrote:
> 
> Hello,
> 
>  I am getting the error that
> org.eclipse.peristence.platform.database.oracle.OraclePlatform class not
> found. But in my classpath eclipselink.jar exists.
> 
> I am enclosing the stack trace, pom.xml and .classpath
> 
>   
> 
>  Exception Stack trace
> 
> 
> testFirstTest(com.oracle.healthinsurance.model.service.CrudServiceImplTest) 
> Time elapsed: 3.234 sec  <<< ERROR!
> org.springframework.transaction.CannotCreateTransactionException: Could
> not open JPA EntityManager for transaction; nested exception is
> javax.persistence.PersistenceException: Exception [EclipseLink-7042]
> (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080614)):
> org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Database platform class
> [org.eclipse.peristence.platform.database.oracle.OraclePlatform] not
> found.
> Internal Exception: Exception [EclipseLink-3007] (Eclipse Persistence
> Services - 1.0 (Build SNAPSHOT - 20080614)):
> org.eclipse.persistence.exceptions.ConversionException
> Exception Description: The object
> [org.eclipse.peristence.platform.database.oracle.OraclePlatform], of class
> [class java.lang.String], could not be converted to [class
> java.lang.Class].  Please ensure that the class
> [org.eclipse.peristence.platform.database.oracle.OraclePlatform] 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.peristence.platform.database.oracle.OraclePlatform
> 	at
> org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:375)
> 	at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
> 	at
> org.springframework.test.AbstractTransactionalSpringContextTests.startNewTransaction(AbstractTransactionalSpringContextTests.java:387)
> 	at
> org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(AbstractTransactionalSpringContextTests.java:217)
> 	at
> org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:101)
> 	at junit.framework.TestCase.runBare(TestCase.java:132)
> 	at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
> 	at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.access$001(AbstractAnnotationAwareTransactionalTests.java:71)
> 	at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.run(AbstractAnnotationAwareTransactionalTests.java:175)
> 	at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTest(AbstractAnnotationAwareTransactionalTests.java:283)
> 	at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTestTimed(AbstractAnnotationAwareTransactionalTests.java:254)
> 	at
> org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runBare(AbstractAnnotationAwareTransactionalTests.java:172)
> 	at
> org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:174)
> 	at
> org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:255)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
> 	at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
> 	at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> Caused by: javax.persistence.PersistenceException: Exception
> [EclipseLink-7042] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT -
> 20080614)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Database platform class
> [org.eclipse.peristence.platform.database.oracle.OraclePlatform] not
> found.
> Internal Exception: Exception [EclipseLink-3007] (Eclipse Persistence
> Services - 1.0 (Build SNAPSHOT - 20080614)): 
> 
> My pom.xml
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>ohi-orm</groupId>
> 	<artifactId>ohi-orm</artifactId>
> 	<packaging>jar</packaging>
> 	<version>1.0-SNAPSHOT</version>
> 	<name>ohi-orm</name>
> 	<url>http://www.oracle.com</url>
> 	<properties>
> 		<spring.framework.version>2.5.5.A</spring.framework.version>
> 		<aspectj.aspectjweaver.version>1.5.3</aspectj.aspectjweaver.version>
> 		<aspectj.aspectjrt.version>1.5.3</aspectj.aspectjrt.version>
> 		<commons-logging.version>1.1.1</commons-logging.version>
> 		<log4j.version>1.2.15</log4j.version>
> 		<cglib.cglib-nodep.version>2.1_3</cglib.cglib-nodep.version>
> 		<easymock.version>2.0</easymock.version>
> 		<junit.version>4.4</junit.version>
> 	
> <org.eclipse.persistence.eclipselink.version>1.0-SNAPSHOT</org.eclipse.persistence.eclipselink.version>
> 		<javax.persistence.ejb.version>1.0</javax.persistence.ejb.version>
> 	</properties>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>${junit.version}</version>
> 			<scope>test</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.eclipse.persistence</groupId>
> 			<artifactId>eclipselink</artifactId>
> 			<version>${org.eclipse.persistence.eclipselink.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>javax.persistence</groupId>
> 			<artifactId>ejb</artifactId>
> 			<version>${javax.persistence.ejb.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>javax.jms</groupId>
> 			<artifactId>jms</artifactId>
> 			<version>1.1</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.beans</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.context.support</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.core</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.context.support</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.transaction</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.orm</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.aop</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.jms</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.transaction</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>org.springframework.test</artifactId>
> 			<version>${spring.framework.version}</version>
> 			<scope>test</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>cglib</groupId>
> 			<artifactId>cglib-nodep</artifactId>
> 			<scope>test</scope>
> 			<version>${cglib.cglib-nodep.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>easymock</groupId>
> 			<artifactId>easymock</artifactId>
> 			<version>${easymock.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>log4j</groupId>
> 			<artifactId>log4j</artifactId>
> 			<version>${log4j.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>commons-logging</groupId>
> 			<artifactId>commons-logging</artifactId>
> 			<version>${commons-logging.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>aspectj</groupId>
> 			<artifactId>aspectjrt</artifactId>
> 			<version>${aspectj.aspectjrt.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>aspectj</groupId>
> 			<artifactId>aspectjweaver</artifactId>
> 			<version>${aspectj.aspectjweaver.version}</version>
> 		</dependency>
> 	    <dependency> 
> 	      <groupId>Oracle.driver</groupId>  
> 	      <artifactId>ojdbc</artifactId>  
> 	      <version>5</version> 
> 	    </dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 		</plugins>
> 	</build>
> 	<repositories>
> 		<repository>
> 			<id>com.springsource.repository.bundles.release</id>
> 			<name>
> 				SpringSource Enterprise Bundle Repository - SpringSource
> 				Bundle Releases
> 			</name>
> 			<url>
> 				http://repository.springsource.com/maven/bundles/release
> 			</url>
> 		</repository>
> 		<repository>
> 			<id>com.springsource.repository.bundles.external</id>
> 			<name>
> 				SpringSource Enterprise Bundle Repository - External
> 				Bundle Releases
> 			</name>
> 			<url>
> 				http://repository.springsource.com/maven/bundles/external
> 			</url>
> 		</repository>
> 	</repositories>
> </project>
> 
> My .classpath
> 
> <classpath>
>   <classpathentry kind="src" path="src/main/java"/>
>   <classpathentry kind="src" path="src/main/resources"
> excluding="**/*.java"/>
>   <classpathentry kind="src" path="src/test/java"
> output="target/test-classes"/>
>   <classpathentry kind="src" path="src/test/resources"
> output="target/test-classes" excluding="**/*.java"/>
>   <classpathentry kind="output" path="target/classes"/>
>   <classpathentry kind="con"
> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>   <classpathentry kind="var"
> path="M2_REPO/Oracle/driver/ojdbc/5/ojdbc-5.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/aspectj/aspectjrt/1.5.3/aspectjrt-1.5.3.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/aspectj/aspectjweaver/1.5.3/aspectjweaver-1.5.3.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar"
> sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/easymock/easymock/2.0/easymock-2.0.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/javax/jms/jms/1.1/jms-1.1.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/javax/persistence/ejb/1.0/ejb-1.0.jar"/>
>   <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"
> sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/log4j/log4j/1.2.15/log4j-1.2.15.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/eclipse/persistence/eclipselink/1.0-SNAPSHOT/eclipselink-1.0-SNAPSHOT.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.aop/2.5.5.A/org.springframework.aop-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-1.0.0.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/apache/commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.beans/2.5.5.A/org.springframework.beans-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.core/2.5.5.A/org.springframework.core-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.context.support/2.5.5.A/org.springframework.context.support-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.context/2.5.5.A/org.springframework.context-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.jms/2.5.5.A/org.springframework.jms-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.orm/2.5.5.A/org.springframework.orm-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.jdbc/2.5.5.A/org.springframework.jdbc-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.transaction/2.5.5.A/org.springframework.transaction-2.5.5.A.jar"/>
>   <classpathentry kind="var"
> path="M2_REPO/org/springframework/org.springframework.test/2.5.5.A/org.springframework.test-2.5.5.A.jar"/>
> </classpath>
> 

-- 
View this message in context: http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.eclipse.peristence.platform.database.oracle.OraclePlatform-tp18709095p18710298.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.