Aries
  1. Aries
  2. ARIES-317

Samples fail to work with the latest version of Derby DB

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.1
    • Fix Version/s: None
    • Component/s: Samples
    • Labels:
      None
    • Environment:

      Windows, DerbyDB 10.6.x)

      Description

      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.

        Activity

        Hide
        Jeremy Hughes added a comment -

        Hi, thanks for highlighting this. Since the instructions on the aries web site describe how to run 0.1-incubating release against 10.5.3.0_1 I think we need to capture the derby instructions for running against that version - I haven't checked to see whether the linked-to derby doc has changes other than the version. Then we should make a change to the trunk to see if we can run against BOTH 10.5.3.0_1 and 10.6.1 ... if not then we're going to need an instruction page for each version of derby we can run against.

        Show
        Jeremy Hughes added a comment - Hi, thanks for highlighting this. Since the instructions on the aries web site describe how to run 0.1-incubating release against 10.5.3.0_1 I think we need to capture the derby instructions for running against that version - I haven't checked to see whether the linked-to derby doc has changes other than the version. Then we should make a change to the trunk to see if we can run against BOTH 10.5.3.0_1 and 10.6.1 ... if not then we're going to need an instruction page for each version of derby we can run against.
        Hide
        zoe slattery added a comment -

        Hi - I've added a note to the Web page linking to this defect and suggesting that users install Derby 10.5.3, which is available from the Derby site. I'll update the web page again when we have a better solution.

        Show
        zoe slattery added a comment - Hi - I've added a note to the Web page linking to this defect and suggesting that users install Derby 10.5.3, which is available from the Derby site. I'll update the web page again when we have a better solution.
        Hide
        Joe Bohn added a comment -

        This same issue affects the AriesTrader sample too. So, I've made comparable changes in the AriesTrader wiki to add this note. We should update both samples when we have a better solution.

        Show
        Joe Bohn added a comment - This same issue affects the AriesTrader sample too. So, I've made comparable changes in the AriesTrader wiki to add this note. We should update both samples when we have a better solution.
        Hide
        zoe slattery added a comment -

        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.

        Show
        zoe slattery added a comment - 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.
        Hide
        zoe slattery added a comment -

        Hi Bartek/Joe - I think this defect is fixed for the blog sample (in the current development stream) because we don't need to people to create a database any more - therefore they don't need to install Derby. There remains a problem with the released samples which do still require Derby 5.3 to be installed but this is covered by warnings and documentation on the wiki. I'd like to close this defect - if you agree?

        Show
        zoe slattery added a comment - Hi Bartek/Joe - I think this defect is fixed for the blog sample (in the current development stream) because we don't need to people to create a database any more - therefore they don't need to install Derby. There remains a problem with the released samples which do still require Derby 5.3 to be installed but this is covered by warnings and documentation on the wiki. I'd like to close this defect - if you agree?
        Hide
        Bartosz Kowalewski added a comment -

        Hi Zoe,

        I fully agree, this issue could be closed. I also think that the prereqs section of the guide (http://incubator.apache.org/aries/blog-sample.html#BlogSample-Prereqs) could be updated, so that it contains up-to-date information. As you said:

        ... they don't need to install Derby. There remains a problem with the released samples which do still require Derby 5.3 to be installed ...

        Thanks,
        Bartek

        Show
        Bartosz Kowalewski added a comment - Hi Zoe, I fully agree, this issue could be closed. I also think that the prereqs section of the guide ( http://incubator.apache.org/aries/blog-sample.html#BlogSample-Prereqs ) could be updated, so that it contains up-to-date information. As you said: ... they don't need to install Derby . There remains a problem with the released samples which do still require Derby 5.3 to be installed ... Thanks, Bartek
        Hide
        Joe Bohn added a comment -

        This issue is also resolved for the AriesTrader sample via a slightly different mechanism (which doesn't use the in-memory DB and gives the user a little more control - this is how things originally worked in the Daytrader sample that was the origin of AriesTrader). So I too believe that we can close this issue.

        Show
        Joe Bohn added a comment - This issue is also resolved for the AriesTrader sample via a slightly different mechanism (which doesn't use the in-memory DB and gives the user a little more control - this is how things originally worked in the Daytrader sample that was the origin of AriesTrader). So I too believe that we can close this issue.
        Hide
        zoe slattery added a comment -

        Fixed by using in memory DB

        Show
        zoe slattery added a comment - Fixed by using in memory DB

          People

          • Assignee:
            zoe slattery
            Reporter:
            Bartosz Kowalewski
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development