[libreoffice/f17] Resolves: rhbz#836827 Connection to datasource could not be established using gcj

sbergmann sbergmann at fedoraproject.org
Mon Sep 24 13:44:27 UTC 2012


commit f760053f7a60a9ec0b51494c60292467e4dd3edc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 24 15:42:54 2012 +0200

    Resolves: rhbz#836827 Connection to datasource could not be established using gcj

 ...-SQLFeatureNotSupportedException-only-in-.patch |   69 ++++++++++++++++++++
 libreoffice.spec                                   |    4 +
 2 files changed, 73 insertions(+), 0 deletions(-)
---
diff --git a/0001-rhbz-836827-SQLFeatureNotSupportedException-only-in-.patch b/0001-rhbz-836827-SQLFeatureNotSupportedException-only-in-.patch
new file mode 100644
index 0000000..376e214
--- /dev/null
+++ b/0001-rhbz-836827-SQLFeatureNotSupportedException-only-in-.patch
@@ -0,0 +1,69 @@
+From 93a0d9eee0f4dced348b040961f44f977e9504a7 Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman at redhat.com>
+Date: Mon, 24 Sep 2012 09:35:56 +0200
+Subject: [PATCH] rhbz#836827: SQLFeatureNotSupportedException only in Java 6
+
+...so if the patched hsqldb.jar is compiled with Java 7, it creates instances of
+SQLFeatureNotSupportedException, and when at LO runtime a Java 5 gcj is used,
+loading the relevant hsqldb.jar classes will fail with a NoClassDefFoundError
+caused by a ClassNotFoundException.
+
+Adding java.sql.Driver.getParentLogger in Java 7 was an incompatible change, but
+it appears that the java.sql framework is prepared to handle old implementations
+(for which the JVM will throw AbstractMethodError), so it appears that it works
+to fake that AbstractMethodError here.
+
+Change-Id: Id1fddc9cbdd8c88cd68fb5877ec59fe8d61e1562
+---
+ hsqldb/patches/jdbc-4.1.patch | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/hsqldb/patches/jdbc-4.1.patch b/hsqldb/patches/jdbc-4.1.patch
+index 4c4eb85..68180a2 100644
+--- a/hsqldb/patches/jdbc-4.1.patch
++++ b/hsqldb/patches/jdbc-4.1.patch
+@@ -231,7 +231,7 @@
+  // boucherb at users 20040411 - doc 1.7.2 - javadoc updates toward 1.7.2 final
+  
+  /**
+-@@ -323,4 +328,12 @@
++@@ -323,4 +328,15 @@
+      }
+  
+  //#endif JAVA6
+@@ -239,7 +239,10 @@
+ +//#ifdef JAVA7
+ +    public Logger getParentLogger() throws SQLFeatureNotSupportedException
+ +    {
+-+        throw new SQLFeatureNotSupportedException("Not supported yet.");
+++        throw new AbstractMethodError(
+++            "org.hsqldb.jdbc.jdbcDataSource.getParentLogger should throw" +
+++            " SQLFeatureNotSupportedException, but that is not yet available" +
+++            " in Java 5");
+ +    }
+ +
+ +//#endif JAVA7
+@@ -299,7 +302,7 @@
+  // fredt at users 20011220 - patch 1.7.0 by fredt
+  // new version numbering scheme
+  // fredt at users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
+-@@ -321,4 +326,12 @@
++@@ -321,4 +326,15 @@
+              DriverManager.registerDriver(new jdbcDriver());
+          } catch (Exception e) {}
+      }
+@@ -307,7 +310,10 @@
+ +//#ifdef JAVA7
+ +    public Logger getParentLogger() throws SQLFeatureNotSupportedException
+ +    {
+-+        throw new SQLFeatureNotSupportedException("Not supported yet.");
+++        throw new AbstractMethodError(
+++            "org.hsqldb.jdbcDriver.getParentLogger should throw" +
+++            " SQLFeatureNotSupportedException, but that is not yet available" +
+++            " in Java 5");
+ +    }
+ +
+ +//#endif JAVA7
+-- 
+1.7.11.4
+
diff --git a/libreoffice.spec b/libreoffice.spec
index d983746..e6ba967 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -154,6 +154,7 @@ Patch36: 0001-Resolves-rhbz-842292-crash-in-calling-callback-whose.patch
 Patch37: 0001-Resolves-rhbz-855972-crash-on-switching-to-outline-v.patch
 Patch38: 0001-Do-not-check-the-stored-DIFAT-sector-count.patch
 Patch39: 0001-Resolves-rhbz-855541-XIOError-handler-multithread-wo.patch
+Patch40: 0001-rhbz-836827-SQLFeatureNotSupportedException-only-in-.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1023,6 +1024,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch37 -p1 -b .rhbz-855972-crash-on-switching-to-outline-v.patch
 %patch38 -p1 -b .Do-not-check-the-stored-DIFAT-sector-count.patch
 %patch39 -p1 -b .rhbz-855541-XIOError-handler-multithread-wo.patch
+%patch40 -p1 -b .rhbz-836827-SQLFeatureNotSupportedException-only-in-.patch
 
 # TODO: check this
 # these are horribly incomplete--empty translations and copied english
@@ -2311,6 +2313,8 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %changelog
 * Wed Sep 12 2012 Caolán McNamara <caolanm at redhat.com> - 1:3.5.6.2-5-UNBUILT
 - Resolves: rhbz#855541 XIOError handler multithread woes
+- Resolves: rhbz#836827 Connection to datasource could not be established using
+  gcj
 
 * Tue Sep 11 2012 Caolán McNamara <caolanm at redhat.com> - 1:3.5.6.2-4
 - Resolves: rhbz#855507 large ole2 compound files fail to load


More information about the scm-commits mailing list