B4J Question after B4J update: java.lang.NoClassDefFoundError at connect MSSQLSERVER

Gnappo jr

Active Member
Licensed User
Longtime User
Hello everybody
in migrating to the new version of java sdk jdk1.8.0_91 at the recent jdk-11.0.1 I am encountering a series of problems.
The code below with sdk jdk1.8.0_91 works while using jdk-11.0.1 from error at sql1.Initialize:
java.lang.NoClassDefFoundError: javax / xml / bind / DatatypeConverter
I imagine it's an up-to-date library to look for, but sorry, I'm lost.


'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#AdditionalJar: sqljdbc42.jar
#End Region

Sub Process_Globals
End Sub

Sub AppStart (Args() As String)
Dim sql1 As SQL, stringa_connessione As String
stringa_connessione="jdbc:sqlserver://localhost:1433;databaseName=dbora;user=sa;password=Peppe;"
sql1.Initialize("com.microsoft.sqlserver.jdbc.SQLServerDriver",stringa_connessione)
End Sub


'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
 

OliverA

Expert
Licensed User
Longtime User
If that code above is the all the code you are running and you are getting the error message you posted, then update your MS SQL JDBC driver. The one you are using (version 4.2) is ancient and may use Java features that have been deprecated. Actually, 4.2 only supports Java 7 and 8 (see https://docs.microsoft.com/en-us/sq...c-driver-for-sql-server?view=sql-server-ver15), so you don't have a choice but to update it in order for your program to work properly under 11.
 
Upvote 0

Gnappo jr

Active Member
Licensed User
Longtime User
If that code above is the all the code you are running and you are getting the error message you posted, then update your MS SQL JDBC driver. The one you are using (version 4.2) is ancient and may use Java features that have been deprecated. Actually, 4.2 only supports Java 7 and 8 (see https://docs.microsoft.com/en-us/sq...c-driver-for-sql-server?view=sql-server-ver15), so you don't have a choice but to update it in order for your program to work properly under 11.
Thanks mate, the link you entered is exactly what I needed
Thanks again
 
Upvote 0
Top