databases/mysql-connector-java: Looks broken to me
matthew at FreeBSD.org
Mon Apr 6 10:31:24 UTC 2015
On 01/04/2015 17:52, Matthew Seaman wrote:
> On 04/01/15 15:31, Beeblebrox via freebsd-ports wrote:
>> I was getting indications that mysql connections through the com.mysql.jdbc driver was not working. So I searched for a test method (included below) and here are the results.
>> * Server: mariadb100--10.0.17, jailed, tcp connection. Able to connect through other drivers & using same params.
>> * Client: mysql-connector-java-5.1.35
>> * Test code compiled with javac, $ java -cp . jdbc >
>> Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver # I compile with OPTIONS_UNSET= NLS
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:191)
>> at jdbc.main(jdbc.java:15)
> Thank you for the report. Unfortunately, I'm at a loss to fix this. The
> driver is supplied pre-compiled by Oracle -- we used to compile it, long
> ago, but then it grew some compatibility shims that meant bits of it
> needed compiling with different JDKs, something that couldn't be
> supported in the ports. I guess it's time to try recompiling it
> ourselves since java has moved on quite a lot since those days. Give me
> a while to test that please.
> Given that it's basically a .jar file downloaded from the net and copied
> into position, the OPTIONS_USET=NLS thing will have absolutely no effect
> on mysql-connector-java itself
Having managed to find time to test this out, the situation is still the
same: compiling this .jar requires a java-1.5 JDK to be installed
alongside a more current JDK:
> lucid-nonsense:/tmp/mysql-connector-java-5.1.35:% ant compile
> Buildfile: /tmp/mysql-connector-java-5.1.35/build.xml
> [exec] Execute failed: java.io.IOException: Cannot run program "/usr/lib/jvm/jdk1.5/bin/java": error=2, No such file or directory
> BUILD FAILED
> /tmp/mysql-connector-java-5.1.35/build.xml:240: Java 5 is required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk5'. Default: '/usr/lib/jvm/jdk1.5'). Java 6 (for JDBC4+ implementation) is also required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk6'. Default: '/usr/lib/jvm/jdk1.6'.
> Total time: 1 second
Given there is no longer any support in the ports for java-1.5 I'm
afraid we're stuck with using the pre-compiled .jar file.
Dr Matthew J Seaman MA, D.Phil.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 971 bytes
Desc: OpenPGP digital signature
More information about the freebsd-ports