Archiva

SQLSyntaxErrorException is thrown when browsing for artifacts after upgrading from 1.3.1 to 1.2

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2
  • Fix Version/s: 1.2.1
  • Component/s: Web Interface
  • Labels:
    None
  • Environment:
    App Server: Sun Java System Application Server 9.1_01 (aka Glassfish v2), Database: Apache Derby 10.2.2, Java: 1.6.0_03, OS: Red Hat Enterprise Linux Server release 5.3 (i686)
  • Number of attachments :
    0

Description

I upgraded from Archiva 1.3.1 to 1.2 by replacing the existing 1.3.1 war file with the new 1.2 war file. When I browse for a file, I can see the group ID's and package ID's with no problem but when I click on a version link the following error is thrown:

Exception

javax.servlet.ServletException: org.apache.maven.archiva.database.ArchivaDatabaseException: Error in JDO during get of Database object id [com.miginfocom:migcalendarbean:6.6.3] of type org.apache.maven.archiva.model.ArchivaProjectModel using no fetch-group

Root Cause

org.apache.maven.archiva.database.ArchivaDatabaseException: Error in JDO during get of Database object id [com.miginfocom:migcalendarbean:6.6.3] of type org.apache.maven.archiva.model.ArchivaProjectModel using no fetch-group

Root Cause

javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception.
NestedThrowables:
java.sql.SQLSyntaxErrorException: In an ALTER TABLE statement, the column 'ARCHIVA_INDIVIDUAL_ID' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.
java.sql.SQLSyntaxErrorException: In an ALTER TABLE statement, the column 'ARCHIVA_ISSUE_MANAGEMENT_ID' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.
java.sql.SQLSyntaxErrorException: In an ALTER TABLE statement, the column 'ARCHIVA_ORGANIZATION_ID' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.
java.sql.SQLSyntaxErrorException: In an ALTER TABLE statement, the column 'ARCHIVA_CIMANAGEMENT_ID' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.
java.sql.SQLException: Constraint 'ARCHIVA_PROJTY_FK7' is invalid: there is no unique or primary key constraint on table 'APP.ARCHIVA_CIMANAGEMENT' that matches the number and types of the columns in the foreign key.
java.sql.SQLException: Constraint 'ARCHIVA_PROJTY_FK8' is invalid: there is no unique or primary key constraint on table 'APP.ARCHIVA_ORGANIZATION' that matches the number and types of the columns in the foreign key.
java.sql.SQLException: Constraint 'ARCHIVA_PROJTY_FK9' is invalid: there is no unique or primary key constraint on table 'APP.ARCHIVA_ISSUE_MANAGEMENT' that matches the number and types of the columns in the foreign key.

Root Cause

java.sql.SQLSyntaxErrorException: In an ALTER TABLE statement, the column 'ARCHIVA_INDIVIDUAL_ID' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.

Root Cause

org.apache.derby.client.am.SqlException: In an ALTER TABLE statement, the column 'ARCHIVA_INDIVIDUAL_ID' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.

Issue Links

Activity

Hide
Brett Porter added a comment -

this sounds like your database was corrupted. Note also that Archiva still ships with Derby 10.1.

If it is problematic, you can delete the Archiva database - your repositories will be rescanned on startup.

Show
Brett Porter added a comment - this sounds like your database was corrupted. Note also that Archiva still ships with Derby 10.1. If it is problematic, you can delete the Archiva database - your repositories will be rescanned on startup.
Hide
Brian Schlining added a comment -

Could've been some corruption. Also, older versions of Derby might be using a non-standard ALTER syntax. I recall seeing a comment in the release notes in Derby 10.5.1.1 (the latest release) that stated that the ALTER TABLE syntax was brought in-line with SQL standards (Can't recall if it was SQL-99 or SQL-2003). So older version of Derby might be choking when the Archiva upgrade tries to update the database tables.

In any case, I had dropped the Archiva database and everything started up again with no issues. Thanks for the tip.

Show
Brian Schlining added a comment - Could've been some corruption. Also, older versions of Derby might be using a non-standard ALTER syntax. I recall seeing a comment in the release notes in Derby 10.5.1.1 (the latest release) that stated that the ALTER TABLE syntax was brought in-line with SQL standards (Can't recall if it was SQL-99 or SQL-2003). So older version of Derby might be choking when the Archiva upgrade tries to update the database tables. In any case, I had dropped the Archiva database and everything started up again with no issues. Thanks for the tip.
Hide
Brett Porter added a comment -

will double check upgrade to see if we can reproduce

Show
Brett Porter added a comment - will double check upgrade to see if we can reproduce
Hide
Maria Odea Ching added a comment -

See comments in MRM-1157

Show
Maria Odea Ching added a comment - See comments in MRM-1157
Hide
Maria Odea Ching added a comment -

Fixed in trunk -r778118. See MRM-1157 for details on the fix..

Show
Maria Odea Ching added a comment - Fixed in trunk -r778118. See MRM-1157 for details on the fix..

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: