[
https://issues.apache.org/jira/browse/ARIES-317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872148#action_12872148
]
zoe slattery commented on ARIES-317:
------------------------------------
I have a possible solution for the blog sample. I believe that we only require
a Derby installation to run the script which sets up the database. So, I have
modified the JPA version of the sample to create the database on the fly - it
infers the structure from the persistence entities.
There are commented changes in
blog-datasource/src/main/resources/OSGI-INF/datasource.xml and in
blog-persistence-jpa/src/main/resources/META-INF/persistence.xml.
I also had to make a minor code change in the author persistence entity (see
https://issues.apache.org/jira/browse/OPENJPA-756 for an explanation).
I believe it should now be possible to run the JPA version of the blog sample
without the user having to install Derby.
The only problem with this solution is that what I'm doing should really not be
done in production.
> Samples fail to work with the latest version of Derby DB
> --------------------------------------------------------
>
> Key: ARIES-317
> URL: https://issues.apache.org/jira/browse/ARIES-317
> Project: Aries
> Issue Type: Bug
> Components: Samples
> Affects Versions: 0.1
> Environment: Windows, DerbyDB 10.6.x)
> Reporter: Bartosz Kowalewski
> Assignee: zoe slattery
>
> Samples shipped with Aries recommend following installation instructions from
> http://db.apache.org/derby/papers/DerbyTut/install_software.html#derby when
> installing Derby.
> The issue is that this guide suggests installing the latest version of Derby
> DB. A new version of Derby (v10.6.x) was released in May 2010 and it is
> incompatible with version of Derby client library (bundle) used in Aries
> (v10.5.3.0_1).
> When running the Blog sample, in the browser I get:
> java.lang.IllegalArgumentException: Failed to start database 'blogDB', see
> the next exception for details.
> at
> org.apache.aries.samples.blog.persistence.jdbc.BlogPersistenceServiceImpl.createAuthor(BlogPersistenceServiceImpl.java:84)
> And in the logs I can see:
> C:\svn_checkouts\aries\samples\blog\blog-assembly\target\blogDB has an
> incompatible format with the current version of the software. The database
> was created by or upgraded by version 10.6.
> 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)
> ... 45 more
> Caused by: ERROR XSLAN: Database at
> C:\svn_checkouts\aries\samples\blog\blog-assembly\target\blogDB has an
> incompatible format with the current version of the software. The database
> was created by or upgraded by version 10.6.
> 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)
> ... 45 more
> Version 10.5.3.0_1 is hardcoded inside pom.xml files in many Aries
> subprojects. Changing the version of Derby in all of these files does not
> really make sense and would not bring a lot of value.
> I think that a better approach is to just add a short note to all samples
> that use Derby and explicitly specify the recommended version of Derby to be
> installed when preparing env for running Aries samples.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.