Bug 818206

Summary: DB upgrade failure fails on Oracle as of schema version 2.122
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: DatabaseAssignee: Lukas Krejci <lkrejci>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 4.4CC: fbrychta, hrupp
Target Milestone: ---   
Target Release: JON 3.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 11:17:07 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 782579    

Description Lukas Krejci 2012-05-02 08:58:32 EDT
Description of problem:
$SUBJECT

Version-Release number of selected component (if applicable):
4.4.0-SNAPSHOT

How reproducible:
always

Steps to Reproduce:
1.Try to upgrade to RHQ 4.4.0/JON 3.1.0 using Oracle database
  
Actual results:
Upgrade fails on schema version 2.122

Expected results:
Upgrade should succeed

Additional info:
java.lang.RuntimeException: Cannot run ANT on script [/tmp/db-upgrade.xml]. Cause: /tmp/db-upgrade.xml:27: Failed to upgrade - error in spec version [2.122]. Cause: Error executing the task [org.rhq.core.db.ant.dbupgrade.SST_JavaTask] in schema spec version [2.122]. Cause: Java Task Error: class=[java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer]
	at org.rhq.enterprise.installer.ServerInformation.startAnt(ServerInformation.java:769)
	at org.rhq.enterprise.installer.ServerInformation.upgradeExistingDatabaseSchema(ServerInformation.java:283)
	at org.rhq.enterprise.installer.DBInstallationTest.upgradeJON300Schema(DBInstallationTest.java:102)
	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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:701)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:893)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1218)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:758)
	at org.testng.TestRunner.run(TestRunner.java:613)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1170)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1095)
	at org.testng.TestNG.run(TestNG.java:1007)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:70)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:111)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:115)
	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.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
Caused by: /tmp/db-upgrade.xml:27: Failed to upgrade - error in spec version [2.122]. Cause: Error executing the task [org.rhq.core.db.ant.dbupgrade.SST_JavaTask] in schema spec version [2.122]. Cause: Java Task Error: class=[java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer]
	at org.rhq.core.db.ant.dbupgrade.DBUpgrader.execute(DBUpgrader.java:314)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	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.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at org.rhq.enterprise.installer.ServerInformation.startAnt(ServerInformation.java:767)
	... 35 more
Caused by: Failed to upgrade - error in spec version [2.122]. Cause: Error executing the task [org.rhq.core.db.ant.dbupgrade.SST_JavaTask] in schema spec version [2.122]. Cause: Java Task Error: class=[java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer]
	at org.rhq.core.db.ant.dbupgrade.DBUpgrader.execute(DBUpgrader.java:300)
	... 47 more
Caused by: Error executing the task [org.rhq.core.db.ant.dbupgrade.SST_JavaTask] in schema spec version [2.122]. Cause: Java Task Error: class=[java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer]
	at org.rhq.core.db.ant.dbupgrade.SchemaSpec.execute(SchemaSpec.java:154)
	at org.rhq.core.db.ant.dbupgrade.DBUpgrader.execute(DBUpgrader.java:288)
	... 47 more
Caused by: Java Task Error: class=[java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer]
	at org.rhq.core.db.ant.dbupgrade.SST_JavaTask.execute(SST_JavaTask.java:91)
	at org.rhq.core.db.ant.dbupgrade.SchemaSpec.execute(SchemaSpec.java:149)
	... 48 more
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer
	at org.rhq.core.db.upgrade.ContentSourceConfigurationObfuscationUpgradeTask.getConfigurationIdConfigurationDefinitionIdPairs(ContentSourceConfigurationObfuscationUpgradeTask.java:44)
	at org.rhq.core.db.upgrade.AbstractConfigurationObfuscationUpgradeTask.execute(AbstractConfigurationObfuscationUpgradeTask.java:196)
	at org.rhq.core.db.ant.dbupgrade.SST_JavaTask.execute(SST_JavaTask.java:89)
	... 49 more
Comment 1 Lukas Krejci 2012-05-02 10:54:50 EDT
Note that due to renumbering of the upgrade tasks, the version that was actually failing in the code prior to this commit was 2.121.

commit 833f007535c2d2ebd7fe95390e199a7b7df55732
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Wed May 2 15:24:51 2012 +0200

    [BZ 818206] - make sure to use generic number type to prevent different
    number types used by different databases.
Comment 2 Lukas Krejci 2012-05-28 08:43:43 EDT
This is included in JON 3.1.0 codebase and because it seems rather important to have QE coverage, I'm adding the JON 3.1.0 target release.
Comment 3 Filip Brychta 2012-05-29 02:34:40 EDT
Verified on jon-server-3.1.0.ER4
Comment 4 Heiko W. Rupp 2013-09-03 11:17:07 EDT
Bulk closing of old issues in VERIFIED state.