Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319248 - connection properties to database in Wizards
Summary: connection properties to database in Wizards
Status: REOPENED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Tran Le CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 06:02 EDT by Ignacio CLA
Modified: 2014-02-06 14:13 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio CLA 2010-07-08 06:02:53 EDT
Build Identifier: 20100617-1415

I've a database connection (in DataSource explorer) to Apache derby and the database is encrypted, therefore I need a bootPassword property (on connection chain) and I put it on Properties -> Optional -> Add.

The problem: When I use '(right click on project) -> JPA tools -> Generate Tables from Entities' the property (added on optional connection properties) isn't used (Not bootPassword for encrypted database => runtime error). 

I think the wizard doesn't take a complete address URL. I avoid this problem adding properties directly to database location.


Reproducible: Always

Steps to Reproduce:
// IT NEEDS SOME MANDATORY PROPERTY (example: a password on an encrypted database)
1.Right click on your project
2.Go to JPA Tools -> Generate Tables from Entities...
3.Accept/Yes Generating DDL
4. "Error o Exception..."
Comment 1 Neil Hauge CLA 2010-07-08 16:10:04 EDT
Investigate for 2.3.1.
Comment 2 Ignacio CLA 2010-07-12 07:00:04 EDT
OK, No problem. On persistence.xml editor (Connection tab) "Bind parameters" was unchecked. Maybe I didn't save at the first time, I think.

Excuse me.
Thx for all.
Comment 3 Ignacio CLA 2010-07-12 07:16:29 EDT
However, I think that somebody should see the persistence.xml changing "the bind parameter" value. It doesn't work fine.
Comment 4 Neil Hauge CLA 2010-07-12 11:01:42 EDT
We may have had a communication error here.  We need to investigate this bug to determine if it is something that we can fix, or something that needs to be reassigned.  I don't believe it to be invalid at this time.
Comment 5 Tran Le CLA 2010-07-14 11:50:00 EDT
I could not reproduce this problem.
The key thing I could see here, is to include the bootPassword in the Connection URL of the DTP New Driver Definition wizard. 
Feel free to reopen this bug if necessary, and please include the stack trace that you are getting.
Comment 6 Ignacio CLA 2010-07-15 04:28:02 EDT
Details project:
   - JPA Project, JDK 1.6, Apache Derby 10.5.3.0 (802917) JDBC 3.0 driver
   - JPA Implementation: EclipseLink, 2.1.0.v20100614-r7608
   - An encrypted database Derby

I checked again and I took another exception using "JPA Tools -> Generate Tables from Entities..." wizard. I thought the problem was in persistence.xml editor (on bind parameter but I think It's nonesense).

1. Config a database connection with some property.
2. Go to persistence.xml editor, select "Connection" tab.
3. Here we go: With "Local resource" as transaction type You want to populate from that connection. Then click the link "Populate from connection ..." and some fields are filled out. 

   I think the generated URL should have the properties and there are nothing (concerning properties) on the URL. Moreover, in my persistence.xml happens the same.

I'm busy but I'm seeing the problem in a few weeks. I can attach a sample project if you want.

I attach the trace exception:

[EL Info]: EclipseLink, version: Eclipse Persistence Services - 2.1.0.v20100614-r7608
Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.0.v20100614-r7608): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
Error Code: 40000
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:408)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:157)[EL Severe]: Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.0.v20100614-r7608): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
Error Code: 40000
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
	at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
	at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:579)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:380)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:157)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:214)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:202)
	at org.eclipse.jpt.eclipselink.core.ddlgen.Main.perform(Main.java:86)
	at org.eclipse.jpt.eclipselink.core.ddlgen.Main.execute(Main.java:77)
	at org.eclipse.jpt.eclipselink.core.ddlgen.Main.main(Main.java:64)
Caused by: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:154)
	at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
	... 10 more
Caused by: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
	... 23 more
Caused by: java.sql.SQLException: Startup failed. An encrypted database cannot be accessed without the correct boot password.  
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	... 20 more
Caused by: ERROR XBM06: Startup failed. An encrypted database cannot be accessed without the correct boot password.  
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactory.handleBootPassword(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactory.init(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactory.<init>(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactoryBuilder.createCipherFactory(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore.setupEncryptionEngines(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
	... 20 more


	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:214)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:202)
	at org.eclipse.jpt.eclipselink.core.ddlgen.Main.perform(Main.java:86)
	at org.eclipse.jpt.eclipselink.core.ddlgen.Main.execute(Main.java:77)
	at org.eclipse.jpt.eclipselink.core.ddlgen.Main.main(Main.java:64)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.0.v20100614-r7608): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
Error Code: 40000
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
	at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
	at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:579)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:380)
	... 6 more
Caused by: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:154)
	at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
	... 10 more
Caused by: java.sql.SQLException: Failed to start database 'C:\Documents and Settings\ignaciolozano.asist\Mis documentos\Descargas\structureDB', see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
	... 23 more
Caused by: java.sql.SQLException: Startup failed. An encrypted database cannot be accessed without the correct boot password.  
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	... 20 more
Caused by: ERROR XBM06: Startup failed. An encrypted database cannot be accessed without the correct boot password.  
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactory.handleBootPassword(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactory.init(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactory.<init>(Unknown Source)
	at org.apache.derby.impl.services.jce.JCECipherFactoryBuilder.createCipherFactory(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore.setupEncryptionEngines(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
	... 20 more
Comment 7 Neil Hauge CLA 2010-07-15 09:46:42 EDT
Okay...I think I get the problem you are having now.  The simple workaround is to simply edit the url in the persistence.xml via the editor or the source and add the properties that are needed to the url field.  The "Populate from connection" link is just a small usability feature to save you some typing.  You can always further edit these fields.  That said, if it makes sense on all DB's, we could add the copying of the properties to the URL as well.  I'll leave this bug open to address this issue.
Comment 8 Neil Hauge CLA 2011-07-01 16:26:21 EDT
Moving JPA specific bugs to new JPA component in bugzilla.