Errors on building the MySql JDBC driver from source - mysql

When I try to build the JDBC driver, from the source downloaded from here , I get many compilation errors. For example,
The type CallableStatement must implement the inherited abstract method CallableStatement.getCharacterStream(int)
in CallableStatement.java line 57
All these error indicate, I thought, that the driver is compatible with JDK 1.5, because the specified method wasn't part of the JDBC spec in JDK 1.5.
However, when I tried to build the driver with JDK 1.5, I got errors indicating that JDK 1.6 is required. For example,
The import java.sql.RowIdLifetime cannot be resolved
where RowIdLifetime is a class that wasn't part of JDK 1.5.
So, which one is it? JDK 1.5 or 1.6? Am I missing something when I try to build?

Having read the file connector-j.html that is bundled with the source, it looks like I need both:
If you are building Connector/J 5.1 make sure that you have both JDK 1.6.x installed and an older JDK such as JDK 1.5.x. This is because Connector/J supports both JDBC 3.0 (which was prior to JDK 1.6.x) and JDBC 4.0. Set your JAVA_HOME environment variable to the path of the older JDK installation.
Next time, I'll RTM before posting.

Related

org/apache/logging/log4j/util/Base64Util.class: Class Version Error Please recompile with supported JDK

/build/Debug/ant/pdm.jar!/META-INF/versions/9/org/apache/logging/log4j/util/Base64Util.class: Class Version Error. Please recompile with a supported JDK or check for an update to DashO which supports the new version.
We are using ant as build tool and Dasho as the code trimming tool.
We are migrating our code from log4j1.x to log4j2.x and we replaced old jar with new Jars(2.xapi & 2.xcore)
Since then after adding the libraries itself we are getting this error while building the project,as we are using java 8 and as per official log4j2 documentation any version of lof4j2 above 2.17.1 does support java8
Found this line when searched for this Base64Util.class in the official documentation of 2.x
link
Tried using 2.17.1 && 2.15 && 2.13 but no luck
Why this unsupported JDK is coming even after using java8 in project??
In order to support Java 8 and all later releases the log4j-api and log4j-core artifacts are multi-release jars. The class file that gives you problems uses Java 9 bytecode.
According to their web site DashO does not support multi-release jars.
Remark: removing the Java 9 classes from log4j-api and log4j-core will break logger context selection and location information on JDK 9 and later, so it is not an option.

Squirrel-SQL throws class not found exception

I am running Squirrel-SQL version 3.9.0 using JDK 10 on MS-Windows 10. I have configured the Microsoft SQL server JDBC driver sqljdbc42.jar along with it's native DDLs to enable native kerberos authentication. But when I try to connect to my database, I get the message JDBC Driver class not found class java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter. How do you fix this issue?
I was able to fix this issue by placing the jaxb-api-2.3.0.jar into squirrel-sql-3.9.0/lib folder and restarting the application.
had same problem . i updgrated everything to last version of Squirel 4.5.1 (janvier 2023) & last JDK 19 & last driver SqlServer , but problem continue to occur
i found another post on StackOverflow who asked which repository had this jaxb jar
How do I resolve Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)?
this is the link to jaxb jar, i added it in lib/ under squirell directory , then it worked
https://maven.java.net/#nexus-search;gav~javax.xml.bind~jaxb-api~2.3.0-b161121.1438~~

NuGet Package MySql.Data is not compatible UWP 10.0.10586

Seems like MySql.Data Package is not compatible with Windows 10 Novermber Update (10.0; Build 10586).
In order to run my application on emulators, I need to set minimum target to Windows 10 Novermber Update. But I need mysql connections too. What can I do?
Package MySql.Data 8.0.11 is not compatible with uap10.0.10586 (UAP,Version=v10.0.10586)
EDIT:
So I tried to install old version of Mysql.Data (6.10.6). It successfully installed but now, when I try to connect to Mysql database it gives this error below:
FileNotFoundException: Could not load file or assembly
'System.Diagnostics.Process, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
connString = "*********";
mcon = new MySqlConnection(connString);
cmd = mcon.CreateCommand();
mcon.Open();//error happens at this line
As the NuGet MySql.Data 6.10.6 Dependencies, it requires .NETStandard 2.0 witch is only supported in UWP app version 16299 now (see .NET Standard), so if you want to use this NuGet in UWP app, you should set both your app target version and min version on Fall Creators Update build 16299.
So as the MySql.Data 8.0.11, you also need to set both your app target version and min version on Fall Creators Update build 16299.

GlassFish 5.0 exception and port 4848 not responding

Yesterday i downloaded GlassFish 5.0 and JDK9. When I'm trying to run server with asadmin start-domain GlassFish send to me exception
When I try to use "asadmin start-domainAfter" I got respond: "Remote server does not listen request on [localhost 4848]. Is the serwer up?"
Any can help me with this? I looked for solution at google, I tried kill process using port 4848, change port 4848 in domain.xml on another one, nothing helps.
It's my firts time with glassfish I don't know what to do. Anyone can help me?
I'm working at windows 7, InteliJ Ultimate 2017.2.4, JRE 1.8 and JDK 9.
GlassFish 5.0 not starting on JDK 9 is a known issue.
GlassFish 5.0 is certified only on JDK 8 (u144) as stated in the release notes:
https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf
I use Windows 10 and I have installed JDK and JRE for version 9 and 8u141, 8u151, 8u144 (installed for test about this problem)
For exception I had had the same problem : the command "asadmin start-version" throw an exception.
Just check the version from CMD console :
C:\Users\xxxxx>**java -version**
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
Problem JAVA_HOME and PATH environment viariables are JDK8u151 ???
To solve the problem, the documentation advice that :
Alternatively, you can specifically set the Java path with the AS_JAVA property in the in the as-install/config/asenv.conf file.
C:\DEVENV\glassfish5\glassfish\config>dir
Le volume dans le lecteur C s’appelle OS
Le numéro de série du volume est 10BF-2BBE
Répertoire de C:\DEVENV\glassfish5\glassfish\config
08/09/2017 07:27 <DIR> .
08/09/2017 07:27 <DIR> ..
12/01/2018 17:44 3 516 asenv.bat
...
Consequently, I add the last line below :
set AS_IMQ_LIB=..\..\mq\lib
set AS_IMQ_BIN=..\..\mq\bin
set AS_CONFIG=..\config
set AS_INSTALL=..
set AS_DEF_DOMAINS_PATH=..\domains
set AS_DEF_NODES_PATH=..\nodes
set AS_DERBY_INSTALL=..\..\javadb
**set AS_JAVA=C:\Program Files\Java\jdk1.8.0_151**
Relaunch CMD console and start server with asadmin start-domain : it works properly....enjoy.
As mentioned above GlassFish 5.0 leverages new features in Java SE 8,
and is certified today on Java SE 8. Even though we have a lot of work
in front of us with the transition to the Eclipse Foundation, our
current intent is to certify Java SE 9 in an upcoming GlassFish 5
release.
JDK 9 should be supported in the next update, i.e. GlassFish 5.0.1
See end of https://blogs.oracle.com/theaquarium/java-ee-8-is-final-and-glassfish-50-is-released
If you are on a mac or linux machine, add the following to config/asenv.conf in your glassfish installation directory.
set AS_JAVA="path to your jdk 8"
For example, in Mac OS it will be
AS_JAVA="/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home"
Anyone having problems with NullPointerException, look out for your system PATH Variables. Be sure that they point to an acceptable JDK (As it was said before: GlassFish 5.0 is certified only to work on JDK 8u144). This NullPointerException is caused by using an incompartible JDK as mentioned here: https://docs.oracle.com/cd/E19226-01/820-7688/gipqi/index.html
In my case the PATH variable was correctly pointing to java8u144 bin, but my PATH also contained a pointer to C:\ProgramData\Oracle\Java\javapath. And someway an old version of java SDK was stored on \ProgramData\Oracle so GlassFish was using this old version of java as SDK.

Grails IncompatibleClassChangeError

I deploy a war made with "grails war" to a jetty server.
As far as I can determine, Grails builds with Sun JDK 1.6.0_17-b04 and jetty runs on Sun JDK 1.6.0.16 (both on linux).
2010-08-18 07:33:47.018:WARN::Nested in org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.ClassLoader do not match. Expected 3 but got 2:
java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.ClassLoader do not match. Expected 3 but got 2
at grails.plugin.scopedproxy.AlwaysReloadableSmartClassLoader.<init>(AlwaysReloadableSmartClassLoader.groovy:28)
at grails.plugin.scopedproxy.ScopedProxyUtils.wrapInSmartClassLoader(ScopedProxyUtils.groovy:154)
How can this problem be solved or debugged further?
Run grails clean before you run grails war.
According to another post, Groovy code that uses exceptions that was compiled with a version of Java prior to 7 is not compatible with Java 7.
More information can be found here.
You are probably running into a JAR conflict. Namely your build environment is using one jar, and runtime (Jetty) is using a conflicting jar. This used to often happen with various XML parsing stacks.
Try looking at the Jars used by jetty and compare them to the ones in your project.