<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    In case this helps...<br>
    <br>
    I had a quick peek at the source - there were two issues that made
    Oracle choke in my environment. First the BigDecimal issue in the
    custom change JpaUpdate1_2_0_Beta1.java as initially reported.
    Secondly in the custom change JpaUpdate1_2_0_CR1.java there was a
    prepared statement that Oracle 10 doesn't like as it expects a
    boolean 'TRUE' to be represented by the numerical value '1'. <br>
    <br>
    I hacked the following two lines and that appears to fix the upgrade
    to 1.2.0.Final (for Oracle10 at least). The remaining liquibase
    scripts then ran without issue.<br>
    <br>
    best rgds,<br>
    <br>
    Steve F.<br>
    <br>
    <br>
    <br>
    diff --git
a/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_Beta1.javab/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_Beta1.java<br>
    index 89e7885..895a785 100644<br>
    ---
a/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_Beta1.java<br>
    +++
b/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_Beta1.java<br>
    @@ -293,7 +293,7 @@<br>
                         }<br>
     <br>
                         Object acmObj =
    resultSet.getObject("ALLOWED_CLAIMS_MASK");<br>
    -                    long mask = (acmObj != null) ? (Long) acmObj :
    ClaimMask.ALL;<br>
    +                    long mask = (acmObj != null) ? ((Number)
    acmObj).longValue() : ClaimMask.ALL;<br>
     <br>
                         MigrationProvider migrationProvider =
    this.kcSession.getProvider(MigrationProvider.class);<br>
                         List&lt;ProtocolMapperRepresentation&gt;
    protocolMappers = migrationProvider.getMappersForClaimMask(mask);<br>
    <br>
    <br>
    diff --git
a/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.javab/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java<br>
    index 5c8a2eb..dbeedf7 100644<br>
    ---
a/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java<br>
    +++
b/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java<br>
    @@ -17,7 +17,7 @@<br>
             String realmClientTableName =
    database.correctObjectName("REALM_CLIENT", Table.class);<br>
     <br>
             try {<br>
    -            PreparedStatement statement =
    jdbcConnection.prepareStatement("select CLIENT.REALM_ID, CLIENT.ID
    CLIENT_ID from CLIENT where CLIENT.CONSENT_REQUIRED = true");<br>
    +            PreparedStatement statement =
    jdbcConnection.prepareStatement("select CLIENT.REALM_ID, CLIENT.ID
    CLIENT_ID from CLIENT where CLIENT.CONSENT_REQUIRED = 1");<br>
                 try {<br>
                     ResultSet resultSet = statement.executeQuery();<br>
                     try {<br>
    <br>
    <br>
    <div class="moz-signature">===================================================

      <p><b>Stephen Flynn</b></p>
      <p><b>Director, JF Technology (UK) Ltd</b></p>
      <div>
        <table style="font-size:smaller; font-family:monospace;">
          <tbody>
            <tr>
              <td style="font-style:italic;text-align:right;">Cell (UK)
                : </td>
              <td>+44 7768 003 882</td>
            </tr>
            <tr>
              <td style="font-style:italic;text-align:right;">Phone : </td>
              <td>+44 20 7833 8346</td>
            </tr>
            <tr>
              <td style="font-style:italic;text-align:right;">IM : </td>
              <td><a class="moz-txt-link-abbreviated"
                  href="mailto:xmpp:stephen.flynn@jftechnology.com">xmpp:stephen.flynn@jftechnology.com</a></td>
            </tr>
            <tr>
              <td style="font-style:italic;text-align:right;">IM : </td>
              <td><a class="moz-txt-link-abbreviated"
                  href="mailto:aim:stephen.flynn@jftechnology.com">aim:stephen.flynn@jftechnology.com</a></td>
            </tr>
            <tr>
              <td style="font-style:italic;text-align:right;">Website :
              </td>
              <td><a href="http://www.jftechnology.com">http://www.jftechnology.com</a></td>
            </tr>
            <tr>
              <td style="font-style:italic;text-align:right;">Tech
                support : </td>
              <td><a href="mailto:support@jftechnology.com">support@jftechnology.com</a></td>
            </tr>
          </tbody>
        </table>
        ===================================================
        <table>
        </table>
      </div>
    </div>
    <div class="moz-cite-prefix">On 03/08/2015 15:53, Bill Burke wrote:<br>
    </div>
    <blockquote cite="mid:55BF8078.9090908@redhat.com" type="cite">I
      could do a 1.4.1 when you fix it. <br>
      <br>
      On 8/3/2015 10:51 AM, Marek Posolda wrote: <br>
      <blockquote type="cite">Thanks for the detailed report. I've
        created JIRA for this and will be <br>
        fixed for next release <a class="moz-txt-link-freetext"
          href="https://issues.jboss.org/browse/KEYCLOAK-1725">https://issues.jboss.org/browse/KEYCLOAK-1725</a>
        . <br>
        <br>
        Marek <br>
        <br>
        On 2.8.2015 15:11, Bill Burke wrote: <br>
        <blockquote type="cite">You probably have to export your
          database to json and re-import it until <br>
          we track this down. <br>
          <br>
          On 8/1/2015 11:19 AM, Stephen Flynn wrote: <br>
          <blockquote type="cite">Hi all, <br>
            <br>
            I'm trying to upgrade Keycloak from 1.1.0.Final to
            1.4.0.Final. <br>
            <br>
            The liquibase db scripts are failing. The particular script
            that is <br>
            failing is 'jpa-changelog-1.2.0.Beta1.xml' with the
            exception 'Caused <br>
            by: java.lang.ClassCastException: java.math.BigDecimal
            cannot be cast to <br>
            java.lang.Long'. More stack trace below. <br>
            <br>
            Any ideas as to why this might be happening ? Is there
            anything else I <br>
            can provide to give more insight ? <br>
            <br>
            best rgds, <br>
            <br>
            Steve F. <br>
            <br>
            <br>
                     Environment is... <br>
            <br>
               * wildfly-9.0.1.Final + keycloak-overlay-1.4.0.Final <br>
               * jdk1.7.0_51 <br>
               * Oracle 10 + odbcj6.jar (11.2.0.2.0) <br>
            <br>
            <br>
                     Liquibase change log from the DB <br>
            <br>
               *   1.0.0.Final <a class="moz-txt-link-abbreviated"
              href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>
            <br>
                 META-INF/jpa-changelog-1.0.0.Final.xml 2014-12-04 <br>
                 00:55:28.95072              1 EXECUTED <br>
               *   1.1.0.Beta1 <a class="moz-txt-link-abbreviated"
              href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>
            <br>
                 META-INF/jpa-changelog-1.1.0.Beta1.xml 2014-12-04 <br>
                 00:55:30.070692             2 EXECUTED <br>
               *   1.1.0.Final <a class="moz-txt-link-abbreviated"
              href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>
            <br>
                 META-INF/jpa-changelog-1.1.0.Final.xml 2015-01-30 <br>
                 00:55:27.065618             3 EXECUTED <br>
            <br>
            <br>
                     Error message in log... <br>
            <br>
            15:12:31,238 INFO
            [org.keycloak.services.resources.KeycloakApplication] <br>
            (ServerService Thread Pool -- 69) Load config from <br>
            /apps/wildfly/wildfly-9.0.1.Final/standalone/configuration/keycloak-server.json

            <br>
            <br>
            15:12:34,416 INFO <br>
            [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider]

            <br>
            <br>
            (ServerService Thread Pool -- 69) Updating database <br>
            15:12:35,982 ERROR <br>
            [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider]

            <br>
            <br>
            (ServerService Thread Pool -- 69) Change Set <br>
            <a class="moz-txt-link-abbreviated"
href="mailto:META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com">META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com</a>
            <br>
            failed.  Error: liquibase.exception.CustomChangeException:
            Update <br>
            1.2.0.Beta1: Exception when updating data from previous
            version: <br>
            liquibase.exception.UnexpectedLiquibaseException: <br>
            liquibase.exception.CustomChangeException: Update
            1.2.0.Beta1: Exception <br>
            when updating data from previous version <br>
                      at <br>
            liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:185)

            <br>
            <br>
                      at <br>
            liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1208)

            <br>
            <br>
                      at
            liquibase.changelog.ChangeSet.execute(ChangeSet.java:550) <br>
                      at <br>
            liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)

            <br>
                      at <br>
            liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)

            <br>
                      at liquibase.Liquibase.update(Liquibase.java:200)
            <br>
                      at liquibase.Liquibase.update(Liquibase.java:181)
            <br>
                      at <br>
            org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:84)

            <br>
            <br>
            [keycloak-connections-jpa-liquibase-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      at <br>
            org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:150)

            <br>
            <br>
            [keycloak-connections-jpa-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:39)

            <br>
            <br>
            [keycloak-connections-jpa-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:27)

            <br>
            <br>
            [keycloak-connections-jpa-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)

            <br>
            <br>
            [keycloak-services-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:34)

            <br>
            <br>
            [keycloak-model-jpa-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:16)

            <br>
            <br>
            [keycloak-model-jpa-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)

            <br>
            <br>
            [keycloak-services-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.models.cache.DefaultCacheRealmProvider.getDelegate(DefaultCacheRealmProvider.java:70)

            <br>
            <br>
            [keycloak-invalidation-cache-model-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      at <br>
            org.keycloak.models.cache.DefaultCacheRealmProvider.getRealm(DefaultCacheRealmProvider.java:163)

            <br>
            <br>
            [keycloak-invalidation-cache-model-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      at <br>
            org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:40)

            <br>
            <br>
            [keycloak-services-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:31)

            <br>
            <br>
            [keycloak-services-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.services.resources.KeycloakApplication.setupDefaultRealm(KeycloakApplication.java:158)

            <br>
            <br>
            [keycloak-services-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            org.keycloak.services.resources.KeycloakApplication.&lt;init&gt;(KeycloakApplication.java:88)

            <br>
            <br>
            [keycloak-services-1.4.0.Final.jar:1.4.0.Final] <br>
                      at <br>
            sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native

            Method) <br>
            [rt.jar:1.7.0_51] <br>
                      at <br>
            sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

            <br>
            <br>
            [rt.jar:1.7.0_51] <br>
                      at <br>
            sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

            <br>
            <br>
            [rt.jar:1.7.0_51] <br>
                      at <br>
            java.lang.reflect.Constructor.newInstance(Constructor.java:526)

            <br>
            [rt.jar:1.7.0_51] <br>
                      at <br>
            org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)

            <br>
            <br>
            [resteasy-jaxrs-3.0.11.Final.jar:] <br>
                      at <br>
            org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)

            <br>
            <br>
            [resteasy-jaxrs-3.0.11.Final.jar:] <br>
                      at <br>
            org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295)

            <br>
            <br>
            [resteasy-jaxrs-3.0.11.Final.jar:] <br>
                      at <br>
            org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236)

            <br>
            <br>
            [resteasy-jaxrs-3.0.11.Final.jar:] <br>
                      at <br>
            org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)

            <br>
            <br>
            [resteasy-jaxrs-3.0.11.Final.jar:] <br>
                      at <br>
            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)

            <br>
            <br>
            [resteasy-jaxrs-3.0.11.Final.jar:] <br>
                      at <br>
            io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)

            <br>
            <br>
            [undertow-servlet-1.2.9.Final.jar:1.2.9.Final] <br>
                      at <br>
            org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)

            <br>
            <br>
                      at <br>
            io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)

            <br>
            <br>
            [undertow-servlet-1.2.9.Final.jar:1.2.9.Final] <br>
                      at <br>
            io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)

            <br>
            <br>
            [undertow-servlet-1.2.9.Final.jar:1.2.9.Final] <br>
                      at <br>
            io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:131)

            <br>
            <br>
            [undertow-servlet-1.2.9.Final.jar:1.2.9.Final] <br>
                      at <br>
            io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:511)

            <br>
            <br>
            [undertow-servlet-1.2.9.Final.jar:1.2.9.Final] <br>
                      at <br>
            org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)

            <br>
            <br>
                      at <br>
            org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)

            <br>
            <br>
                      at <br>
            java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

            <br>
            [rt.jar:1.7.0_51] <br>
                      at
            java.util.concurrent.FutureTask.run(FutureTask.java:262) <br>
            [rt.jar:1.7.0_51] <br>
                      at <br>
            java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

            <br>
            <br>
            [rt.jar:1.7.0_51] <br>
                      at <br>
            java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

            <br>
            <br>
            [rt.jar:1.7.0_51] <br>
                      at java.lang.Thread.run(Thread.java:744)
            [rt.jar:1.7.0_51] <br>
                      at
            org.jboss.threads.JBossThread.run(JBossThread.java:320) <br>
            Caused by: liquibase.exception.CustomChangeException: Update
            <br>
            1.2.0.Beta1: Exception when updating data from previous
            version <br>
                      at <br>
            org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:43)

            <br>
            <br>
            [keycloak-connections-jpa-liquibase-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      at <br>
            org.keycloak.connections.jpa.updater.liquibase.custom.CustomKeycloakTask.generateStatements(CustomKeycloakTask.java:79)

            <br>
            <br>
            [keycloak-connections-jpa-liquibase-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      at <br>
            liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:178)

            <br>
            <br>
                      ... 44 more <br>
            Caused by: java.lang.ClassCastException:
            java.math.BigDecimal cannot be <br>
            cast to java.lang.Long <br>
                      at <br>
            org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.addDefaultProtocolMappers(JpaUpdate1_2_0_Beta1.java:296)

            <br>
            <br>
            [keycloak-connections-jpa-liquibase-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      at <br>
            org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:41)

            <br>
            <br>
            [keycloak-connections-jpa-liquibase-1.4.0.Final.jar:1.4.0.Final]

            <br>
                      ... 46 more <br>
            <br>
            -- <br>
            =================================================== <br>
            <br>
            *Stephen Flynn* <br>
            <br>
            *Director, JF Technology (UK) Ltd* <br>
            <br>
            Cell (UK) :     +44 7768 003 882 <br>
            Phone :     +44 20 7833 8346 <br>
            IM :     <a class="moz-txt-link-abbreviated"
              href="mailto:xmpp:stephen.flynn@jftechnology.com">xmpp:stephen.flynn@jftechnology.com</a>
            <br>
            IM :     <a class="moz-txt-link-abbreviated"
              href="mailto:aim:stephen.flynn@jftechnology.com">aim:stephen.flynn@jftechnology.com</a>
            <br>
            Website :     <a class="moz-txt-link-freetext"
              href="http://www.jftechnology.com">http://www.jftechnology.com</a>
            <br>
            Tech support :     <a class="moz-txt-link-abbreviated"
              href="mailto:support@jftechnology.com">support@jftechnology.com</a>
            <br>
            <a class="moz-txt-link-rfc2396E"
              href="mailto:support@jftechnology.com">&lt;mailto:support@jftechnology.com&gt;</a>
            <br>
            <br>
            =================================================== <br>
            <br>
            <br>
            <br>
            _______________________________________________ <br>
            keycloak-user mailing list <br>
            <a class="moz-txt-link-abbreviated"
              href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
            <br>
            <a class="moz-txt-link-freetext"
              href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a>
            <br>
            <br>
          </blockquote>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>