B4J Question MSSQL on Ubuntu

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I installed MSSQL on ubuntu 16.04 and am trying to connect to it in B4J.

On my Windows PC I can connect to the Ubuntu server.
- I downloaded sqljdbc42.jar and put it in my B4J libraries folder
- I added #AdditionalJar: sqljdbc42.jar
This connection works.

Than I uploaded the release JAR to my Ubuntu environment and ran the (test) application to receive a:

B4X:
java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4098)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3160)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3123)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1981)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1168)
        at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:678)
        at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
        at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:56)
        at anywheresoftware.b4j.objects.SQL.Initialize(SQL.java:45)
        at b4j.example.main._appstart(main.java:55)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
        at b4j.example.main.main(main.java:29)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        ... 23 more

thanks
 

wl

Well-Known Member
Licensed User
Longtime User
This problem occurs when using JDK 9. I found some references on this topic in Java fora but I can seem to figure out what exactly I need to do ?

In JDK 8 it is not a problem.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…