2

While trying to run a JPA application, I get:

[EL Fine]: 2014-07-09   16:55:52.532--Thread(Thread[http-bio-8080-exec-6,5,main])--Detected database platform: org.eclipse.persistence.platform.database.HSQLPlatform

Which is NOT the correct platform. (should be an Oracle thin client). The same project when checked out on a different machine works fine. Only difference that we can detect is the jdk version (13 versus 60 on mine).

My Persistance.xml looks like:


<?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 http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="JPA_DatabasePU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <non-jta-data-source>wellsDB</non-jta-data-source>
    <class>my.domain.jpaDatabase.entities.Fred.Feature</class>
    <properties>
      <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
      <property name="javax.persistence.jdbc.url"     value="jdbc:oracle:thin:user@//db.domain.my:1521/inst"/>
      <property name="javax.persistence.jdbc.user" value="username"/>
      <property name="javax.persistence.jdbc.password" value="password"/>
      <property name="eclipselink.logging.level" value="FINEST"/>
    </properties>
  </persistence-unit>
</persistence>

What am I missing??

Scaddenp
  • 67
  • 11
  • What app server is this running against? Using the eclipselink default persistence provider is telling it to connect using however the app server is setup. Is it running against a different server, or has the server this is deployed against been configured differently than the other machines? – Flare Star Jul 09 '14 at 23:20
  • Check, if you don't have wellsDB datasource configured on the application server pointing to the hsql database. – Gas Jul 09 '14 at 23:49
  • Thanks for responding. I am running it on Tomee. And no, dont have wellsDB pointing to hsql – Scaddenp Jul 10 '14 at 04:13
  • How are you obtaining your EntityManagerFactory instances? Are you passing in properties such that you might inadvertently be overriding persistence.xml properties? The comment to one of the answers shows that when you remove the non-jta-data-source tag, a datasource is still used, so I believe a property or datasource is somehow being injected – Chris Jul 10 '14 at 14:37

2 Answers2

1

You could try to set the target database?

<property name="eclipselink.target-database" value="Oracle"/>
Rick
  • 3,830
  • 1
  • 18
  • 16
  • Okay, take out the non-jta-source line and add that. Same error EXCEPT in logs I see: – Scaddenp Jul 10 '14 at 04:22
  • [EL Config]: 2014-07-10 16:18:56.998--ServerSession(216742744)--Connection(1982790477)--Thread(Thread[http-bio-8080-exec-5,5,main])--connecting(DatabaseLogin( platform=>OraclePlatform user name=> "username" connector=>JNDIConnector datasource name=>null )) [EL Config]: 2014-07-10 16:18:57.335--ServerSession(216742744)--Connection(2127675725)--Thread(Thread[http-bio-8080-exec-5,5,main])--Connected: jdbc:hsqldb:file:data/hsqldb/hsqldb User: SA Database: HSQL Database Engine Version: 2.2.8 Driver: HSQL Database Engine Driver Version: 2.2.8 – Scaddenp Jul 10 '14 at 04:24
  • on machines that work, I get line instead which says Oracle 10 etc etc. – Scaddenp Jul 10 '14 at 04:24
  • That is really odd... I don't know have a clue. Please be sure to update the post as you dig deeper into this issue. – Rick Jul 10 '14 at 12:56
  • What happens if you keep the non-jta-data-source tag? – Chris Jul 10 '14 at 14:38
  • After I look a bit closer, this certain is related to the TomEE default datasource (which is HSQL) – Rick Jul 10 '14 at 14:55
  • Thanks Rick. this is my conclusion too as the War it produces looks identical to the War produced on a machine that works. Now just have to figure what is different about my tomee installation... – Scaddenp Jul 10 '14 at 20:56
  • Okay, careful examination of the Tomee installation between machines that work and those that dont is helping. The production server has resources in context.xml and context parameters in web.xml. Oddly, they were ONCE in a working development tomee machine, but removed and the war still works. However, setting up the resources in the tomee install is the key. – Scaddenp Jul 10 '14 at 21:27
0

Well the answer was to replace the Tomee 1.5 install with a fresh install of Tomee 1.6. I cant see difference in the conf files but there you are. From my point of view, the important thing is that this fixed the issue. The created war deploys without a problem on the production Tomee as well.

Scaddenp
  • 67
  • 11