Eclipse 2020-06 JDK 11, GWT project cannot connect to Oracle Database

Skip to first unread message

Yibin Li

Aug 13, 2021, 2:53:45 PM8/13/21
to GWT Users
I just upgrade my Eclipse to 2020-06 and Java JDK 11

My Oracle client on my PC is Oracle 11.2. There is ojdbc6_g.jar is in C:\Oracle\product\11.2.0\client_1\jdbc\lib

I created a new GWT Web Application

In Data connection module, I copied or Java 8 DB Connection code here

1. I tried
OracleDataSource ods2 = new OracleDataSource();
String url = "jdbc:oracle:thin:@/server:port/service";
  ods2.setPassword( appsettings.getString("pwd")  );

It can compile. But when I debug the connection
Line : OracleDataSource ods2 = new OracleDataSource(); throws exception
[ERROR] Found resouce but unrecognized URL format: 'jrt:/java.sql/javax/sql/DataSource.class'.

2. Then I try another way to connect to t DB
Connection con=DriverManager.getConnection(  "jdbc:oracle:thin:@server:port","username","pwd");  

It throws :
java.lang.NoClassDefFoundError: org/ietf/jgss/GSSException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(
at Source)
at oracle.jdbc.driver.T4CConnection.connect(
at oracle.jdbc.driver.T4CConnection.logon(
at oracle.jdbc.driver.PhysicalConnection.<init>(
at oracle.jdbc.driver.T4CConnection.<init>(
at oracle.jdbc.driver.T4CDriverExtension.getConnection(
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql/java.sql.DriverManager.getConnection(
at java.sql/java.sql.DriverManager.getConnection(

Any suggestions or comments

Thank you for your help

Yibin Li

Yibin Li

Aug 13, 2021, 2:59:28 PM8/13/21
to GWT Users
Also Console prints

[WARN] Server class 'org.ietf.jgss.GSSException' could not be found in the web app, but was found on the system classpath
   [ERROR] Found resouce but unrecognized URL format: 'jrt:/'


Aug 16, 2021, 6:45:40 AM8/16/21
to GWT Users
[WARN] Server class 'org.ietf.jgss.GSSException' could not be found in the web app, but was found on the system classpath
   [ERROR] Found resouce but unrecognized URL format: 'jrt:/'

JRT urls are available since Java 9 and the embedded Jetty 9.2.x that GWT provides does not understand these kinds of URLs.

For complex GWT apps the recommendation is to not use the embedded Jetty provided by GWT. Instead use GWT CodeServer to serve GWT client code during development and your own Jetty server to deploy your server side code to. You need at least Jetty 9.4.7 and not higher than Jetty 10.x because Jetty 11.x uses the new Jakarta EE namespace which GWT server side code does not support.

Yibin Li

Aug 19, 2021, 9:36:00 AM8/19/21
to GWT Users

I will try this approach

Almost each UI is working as GWT 2.5. But not DB connection. I deployed the code to my test server and use DB datasource on server, everything is working. The only obstacle is DB connection.

Thank you for your reply.

Yibin Li

Aug 19, 2021, 9:43:41 AM8/19/21
to GWT Users
I changed the JDK to Java 8 and everything is working. 

The same DB connection code can connect to DB

Eclipse 2020-06

    Java11 can connect to DB

2. With GWT
   Java 11 cannot connection to DB

Reply all
Reply to author
0 new messages