Quantcast
Channel: SCN : Discussion List - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 3131

Persistence operation failed with reason: The bean encountered a non-application exception

$
0
0


Hi guys,

 

I'm trying to finish Week 2 of the Introduction to SAP HANA Cloud Platform,  Unit 1, Introduction and First Steps with EJB but I get this error when I access my application on the server:


Persistence operation failed with reason: The bean encountered a non-application exception; nested exception is: javax.persistence.PersistenceException: Exception [EclipseLink-7042] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.ValidationException Exception Description: Database platform class [com.sap.persistence.platform.database.HDBPlatform] not found. Internal Exception: java.lang.ClassCastException: class com.sap.persistence.platform.database.HDBPlatform:org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@187b83c7[org.eclipse.persistence.core:2.4.1.v20121003-ad44345(id=253)] incompatible with interface org.eclipse.persistence.internal.databaseaccess.Platform:org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@3905d182[persistence-with-ejb:0.0.0(id=302)]

 

I already set com.sap.persistence.platform.database.HDBPlatform in the persistence.xml file, even with xml editor  can see the value is there:

 

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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/persistencehttp://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="persistence-with-ejb" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/DefaultDB</jta-data-source>
        <class>com.sap.cloud.sample.persistence.Person</class>
        <properties>
            <property name="eclipselink.ddl-generation" value="create-tables" />
            <property name="eclipselink.logging.level" value="SEVERE" />
            <property name="eclipselink.target-database" value="com.sap.persistence.platform.database.HDBPlatform"/>
        </properties>
    </persistence-unit>
</persistence>

 

I saw this covered here, but the solution is not working:

SAP HCP openSAP course guide week 2

SAP HCP openSAP course guide week 2

 


Any ideas on what could be wrong?

 

Thanks a lot,

Shimon


Viewing all articles
Browse latest Browse all 3131

Trending Articles