Unsuccessfull.
Persistence.generateSchema()
uses an EntityManager too, and that one wants to have a JDBC
driver and connection...
Not sure, if
using an in-memory DB is the appropriate solution, as I
think there might be slight differences to a target-database
"Oracle". What do you think?
cheers
Leo
[DEBUG]
javax.persistence.validation.mode=NONE
javax.persistence.transactionType=RESOURCE_LOCAL
eclipselink.target-database=Oracle
eclipselink.create-ddl-jdbc-file-name=createDDL.sql
eclipselink.ddl-generation.output-mode=sql-script
eclipselink.logging.level=FINEST
javax.persistence.jtaDataSource=null
javax.persistence.schema-generation.scripts.action="">
eclipselink.ddl-generation=drop-and-create-tables
eclipselink.drop-ddl-jdbc-file-name=dropDDL.sql
javax.persistence.nonJtaDataSource=null
javax.persistence.schema-generation.database.action="">
eclipselink.logging.logger=JavaLogger
[INFO]
Generating schema for persistence unit pu-test
Jan
08, 2015 1:44:24 AM
org.eclipse.persistence.session.file:/C:/devel/workspace_DLP/test-eclispelink-ddlgeneration-maven-plugin/src/main/resources/_pu-test_transactionType=RESOURCE_LOCAL
INFO:
EclipseLink, version: Eclipse Persistence Services -
2.5.1.v20130918-f2b9fc5
Jan
08, 2015 1:44:24 AM
org.eclipse.persistence.session.file:/C:/devel/workspace_DLP/test-eclispelink-ddlgeneration-maven-plugin/src/main/resources/_pu-test_transactionType=RESOURCE_LOCAL.ejb
SEVERE:
Local
Exception Stack:
Exception
[EclipseLink-4021] (Eclipse Persistence Services -
2.5.1.v20130918-f2b9fc5):
org.eclipse.persistence.exceptions.DatabaseException
Exception
Description: Unable to acquire a connection from driver
[null], user [null] and URL [null]. Verify that you have
set the expected driver class and URL. Check your login,
persistence.xml or sessions.xml resource. The jdbc.driver
property
should
be set to a class that is compatible with your database
platform
at
org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:383)
at
org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:91)
at
org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:204)
at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setDatasourceAndInitialize(DatabaseSessionImpl.java:171)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:233)
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:182)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getDatabaseSession(EntityManagerFactoryImpl.java:527)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:140)
at
org.eclipse.persistence.jpa.PersistenceProvider.generateSchema(PersistenceProvider.java:209)
at
org.eclipse.persistence.jpa.PersistenceProvider.generateSchema(PersistenceProvider.java:241)
at
javax.persistence.Persistence.generateSchema(Persistence.java:114)
at
ch.lbreuss.mojo.eclipselink.DDLGeneratorThread.run(DDLGeneratorThread.java:50)
Exception
in thread "Thread-1" javax.persistence.PersistenceException:
Exception [EclipseLink-4021] (Eclipse Persistence Services -
2.5.1.v20130918-f2b9fc5):
org.eclipse.persistence.exceptions.DatabaseException
Exception
Description: Unable to acquire a connection from driver
[null], user [null] and URL [null]. Verify that you have
set the expected driver class and URL. Check your login,
persistence.xml or sessions.xml resource. The jdbc.driver
property
should
be set to a class that is compatible with your database
platform
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:766)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:182)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getDatabaseSession(EntityManagerFactoryImpl.java:527)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:140)
at
org.eclipse.persistence.jpa.PersistenceProvider.generateSchema(PersistenceProvider.java:209)
at
org.eclipse.persistence.jpa.PersistenceProvider.generateSchema(PersistenceProvider.java:241)
at
javax.persistence.Persistence.generateSchema(Persistence.java:114)
at
ch.lbreuss.mojo.eclipselink.DDLGeneratorThread.run(DDLGeneratorThread.java:50)
Caused
by: Exception [EclipseLink-4021] (Eclipse Persistence
Services - 2.5.1.v20130918-f2b9fc5):
org.eclipse.persistence.exceptions.DatabaseException
Exception
Description: Unable to acquire a connection from driver
[null], user [null] and URL [null]. Verify that you have
set the expected driver class and URL. Check your login,
persistence.xml or sessions.xml resource. The jdbc.driver
property
should
be set to a class that is compatible with your database
platform
at
org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:383)
at
org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:91)
at
org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:204)
at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setDatasourceAndInitialize(DatabaseSessionImpl.java:171)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:233)
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
... 8 more
Thanks, I'll give it a try.
Eventually,
I'll incorporate it into
https://github.com/lbreuss/eclipselink-ddlgeneration-maven-plugin/
cheers
Leo
In Eclipselink 2.5 try newly defined in JPA
2.1 Persistence.generateSchema(String persistenceUnitName, Map
map)
including into the map ddl generation properties as well as
eclipselink.target-database property.
Hi
is it possible to generate the DDLs
without an actual DB connection?
If not, for what is the DB connection
needed?
regards
Leo
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users