openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Wellmann <hwellmann...@gmail.com>
Subject Re: Error using derby embebed
Date Fri, 05 Apr 2013 13:30:04 GMT
> You may have specified an invalid URL.

Backslashes are invalid in URLs.

Try jdbc:derby:/C:/Users/... or get a decent operating system ;-)

Best regards,
Harald




2013/4/5 aitor <laudio.info@gmail.com>

> hello
>
> i have one embebed derby database into my project and i have this
> persistence.xml file.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence 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"
> version="2.0">
>   <persistence-unit name="example" transaction-type="RESOURCE_LOCAL">
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>     <class>com.mio.db.jpa.entities.Wssrvtrackrequest</class>
>     <class>com.mio.db.jpa.entities.Wssrvtrackresponse</class>
>     <properties>
>
>             <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)"/>
>                 <property name="openjpa.ConnectionDriverName"
> value="org.apache.derby.jdbc.EmbeddedDriver" />
>                 <property name="openjpa.ConnectionURL"
>
> value="jdbc:derby:C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB;create=true"
> />
>                 <property name="openjpa.ConnectionUserName" value="" />
>                 <property name="openjpa.ConnectionPassword" value="" />
>     </properties>
>   </persistence-unit>
> </persistence>
>
> but when i try from one main class to use this database with JPA (openJPA)
> always appears the bellow error.
> The database is into C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB and
> i
> access to the database from one derby browser
>
> can you help me?
>
> thanks
>
> 91  example  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a
> validation provider.
> 106  example  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.1.1
> 157  example  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> "org.apache.openjpa.jdbc.sql.DerbyDictionary".
> Exception in thread "main" <openjpa-2.1.1-r422266:1148538 nonfatal general
> error> org.apache.openjpa.persistence.PersistenceException: There were
> errors initializing your configuration: <openjpa-2.1.1-r422266:1148538
> fatal
> user error> org.apache.openjpa.util.UserException: A connection could not
> be
> obtained for driver class "org.apache.derby.jdbc.EmbeddedDriver" and URL
> "jdbc:derby:C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB;create=true".
> You may have specified an invalid URL.
>         at
>
> org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261)
>         at
>
> org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247)
>         at
>
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)
>         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.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:295)
>         at
>
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1652)
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:645)
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
>         at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>         at myclasses.ll.main(ll.java:14)
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (Failed to start database
> 'C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB', see the next exception
> for details.)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>         at
>
> org.apache.openjpa.jdbc.schema.DBCPDriverDataSource.getDBCPConnection(DBCPDriverDataSource.java:89)
>         at
>
> org.apache.openjpa.jdbc.schema.AutoDriverDataSource.getConnection(AutoDriverDataSource.java:58)
>         at
>
> org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:88)
>         at
>
> org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139)
>         at
>
> org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
>         at
>
> org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
>         ... 14 more
> Caused by: java.sql.SQLException: Failed to start database
> 'C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB', 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
>
> org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
>         at
>
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
>         ... 22 more
> Caused by: java.sql.SQLException: Failed to start database
> 'C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB', 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)
>         ... 36 more
> Caused by: java.sql.SQLException: Database at
> C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB has an incompatible
> format
> with the current version of the software.  The database was created by or
> upgraded by version 10.9.
>         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)
>         ... 33 more
> Caused by: ERROR XSLAN: Database at
> C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB has an incompatible
> format
> with the current version of the software.  The database was created by or
> upgraded by version 10.9.
>         at
> org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
>         at
> org.apache.derby.impl.store.raw.log.LogToFile.readControlFile(Unknown
> Source)
>         at org.apache.derby.impl.store.raw.log.LogToFile.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.raw.data.BaseDataFileFactory.bootLogFactory(Unknown
> Source)
>         at
>
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.setRawStoreFactory(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)
>         ... 33 more
>
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:219)
>         at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>         at myclasses.ll.main(ll.java:14)
> Caused by: java.lang.RuntimeException: There were errors initializing your
> configuration: <openjpa-2.1.1-r422266:1148538 fatal user error>
> org.apache.openjpa.util.UserException: A connection could not be obtained
> for driver class "org.apache.derby.jdbc.EmbeddedDriver" and URL
> "jdbc:derby:C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB;create=true".
> You may have specified an invalid URL.
>         at
>
> org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261)
>         at
>
> org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247)
>         at
>
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)
>         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.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:295)
>         at
>
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1652)
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:645)
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
>         at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
>         at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>         at myclasses.ll.main(ll.java:14)
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (Failed to start database
> 'C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB', see the next exception
> for details.)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>         at
>
> org.apache.openjpa.jdbc.schema.DBCPDriverDataSource.getDBCPConnection(DBCPDriverDataSource.java:89)
>         at
>
> org.apache.openjpa.jdbc.schema.AutoDriverDataSource.getConnection(AutoDriverDataSource.java:58)
>         at
>
> org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:88)
>         at
>
> org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139)
>         at
>
> org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
>         at
>
> org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
>         ... 14 more
> Caused by: java.sql.SQLException: Failed to start database
> 'C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB', 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
>
> org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
>         at
>
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
>         at
>
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
>         ... 22 more
> Caused by: java.sql.SQLException: Failed to start database
> 'C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB', 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)
>         ... 36 more
> Caused by: java.sql.SQLException: Database at
> C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB has an incompatible
> format
> with the current version of the software.  The database was created by or
> upgraded by version 10.9.
>         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)
>         ... 33 more
> Caused by: ERROR XSLAN: Database at
> C:\Users\user\Dropbox\Curro\mio\mioProDB\mioProDB has an incompatible
> format
> with the current version of the software.  The database was created by or
> upgraded by version 10.9.
>         at
> org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
>         at
> org.apache.derby.impl.store.raw.log.LogToFile.readControlFile(Unknown
> Source)
>         at org.apache.derby.impl.store.raw.log.LogToFile.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.raw.data.BaseDataFileFactory.bootLogFactory(Unknown
> Source)
>         at
>
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.setRawStoreFactory(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)
>         ... 33 more
>
>         at
>
> org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:309)
>         at
>
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1652)
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:645)
>         at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
>         ... 5 more
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Error-using-derby-embebed-tp7583367.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message