Skip to content

JDBC Glue Test Connection fails with `java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter`, Crawler fails too

0

I have 3 JDBC Glue Connections to SQL Server DBs spanning 2 isolated AWS accounts that suddenly stopped working when run via Test Connection and in Glue Crawlers. Glue Jobs that use this connection are still working as expected. No changes were made to the connections/crawlers or supporting resources.

As recently as 2025-06-30 16:56 UTC I was able to:

  1. Test the connection in the Connection panel
  2. Run a Glue Crawler using this connection (succeeded, created expected tables)

Without having made any changes to the connection or source DB:

  1. The Test connection fails and produces the following java stack trace:
Exception in thread "main" 
java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4128) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3188) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:61) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3151) 
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7535) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2438) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1973) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1616) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1447) 
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:788) 
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1187) 
at com.amazonaws.glue.jdbc.commons.JdbcConnection.connect(JdbcConnection.java:81) 
at com.amazonaws.glue.jdbc.commons.JdbcConnection.connect(JdbcConnection.java:48) 
at com.amazonaws.glue.jobexecutor.commands.jdbc.JdbcCommandExecutor.connect(JdbcCommandExecutor.java:45) 
at com.amazonaws.glue.jobexecutor.commands.jdbc.JdbcCommandExecutor.execute(JdbcCommandExecutor.java:87) 
at com.amazonaws.glue.jobexecutor.commands.main.MainStartup.main(MainStartup.java:46) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter 
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) 
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592) 
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) 
... 16 more 
  1. Glue Crawler fails with ERROR : Test connection failed for connection <my connection>

Other details:

  • region: ca-central-1
  • connection:
    • database: SQL Server
    • driver: unspecified (whatever the default is from Glue for sqlserver)

Have also tried providing my own JDBC driver .jar to the connection but:

  • Testing connections with custom drivers is not supported
  • The Glue Crawler logs only reveal Internal Service Exception (afaik there's no way for me to get more verbose/useful logs to disambiguate if this is an issue with how I've configured the driver or and underlying issue like the above)
  • Logs in Cloud Trail don't t reveal any clear issues either

Many thanks for any help.

asked a year ago186 views
2 Answers
2
Accepted Answer

You're not alone,this issue has been popping up recently for many using Glue connections to SQL Server. The stack trace tells the core story:

java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

What's going on in the background? This class (DatatypeConverter) is part of the javax.xml.bind module that was deprecated and then removed in Java 11+. AWS Glue has recently migrated to a Java 11 runtime (especially for Glue version 4.0+ and for test connection logic), and this is causing unexpected compatibility issues when using JDBC drivers that rely on those older Java 8 packages.

Why do Glue Jobs still work? Glue Jobs often run in a different context (e.g., using older Glue versions or having different classpath/jar handling). The test connection and Crawler logic, however, seems to rely on newer Java 11–based runtimes.

Options to Fix or Work Around: 1)Switch to a compatible JDBC driver a) Use the latest SQL Server JDBC driver from Microsoft (e.g., version 12.x+), which no longer depends on javax.xml.bind. b) Upload it to S3 and configure the Glue connection or job with a custom .jar file.

  1. Use Glue Version 3.0 for Crawlers and Jobs a) you're using Glue 4.0, try reverting to Glue 3.0, which still uses Java 8 and has the javax.xml.bind classes.

  2. Modify connection behavior (advanced): a) If you're managing connections at runtime in your job script, you could add a shaded jar or include JAXB via dependency if needed (but this won’t help test connection or Crawler GUI unless AWS changes backend logic).

4).Raise a support case with AWS a) Since this seems tied to a backend update, raising a support ticket may help push for a hotfix or rollback if it's unintentional.

Additionally: Yes, this is due to the recent Java 11 runtime shift in AWS Glue components. To fix it: Use the latest SQL Server JDBC driver that’s Java 11 compatible. If needed, stick with Glue 3.0 for now to avoid the JAXB class issue. And yes, this isn’t something you broke; it’s an AWS-side change surfacing new runtime incompatibilities.

answered a year ago
  • Many thanks Manvitha. The issue seems to have resolved (broken connections + crawlers are now working). Maybe a patch was pushed or AWS reverted the upgrade? I opened a support ticket w/ AWS on Friday - have asked them to confirm that a JRE upgrade was at root, as well as:

    Will accept your answer once AWS support confirms.

0

The error you're experiencing with your AWS Glue JDBC connections to SQL Server databases appears to be related to a compatibility issue with the JDBC driver and the Java runtime environment used by AWS Glue.

The specific error java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter indicates that the SQL Server JDBC driver is trying to use a Java class that's not available in the current Java runtime. This typically happens when there's a mismatch between the Java version the driver was built for and the one being used to run it.

Here are some troubleshooting steps you can take:

  1. Check for AWS Glue updates or changes: Since this happened suddenly without you making any changes, it's possible that AWS updated the Glue environment or Java runtime version. This could have created an incompatibility with the SQL Server JDBC driver.

  2. Use the AWSSupport-TroubleshootGlueConnection runbook: This automated tool in AWS Systems Manager can help identify common connection issues between Glue and your data source. It performs various checks including network connectivity, IAM roles, and database credentials.

  3. Try a different JDBC driver version: Although you mentioned testing connections with custom drivers isn't supported, you can still use a custom driver with your Glue Crawler. Try using a different version of the SQL Server JDBC driver that's compatible with newer Java versions (Java 11+).

  4. Check security group configurations: Verify that the security groups associated with your RDS instance allow inbound traffic on the appropriate port from the security group used by Glue. Also ensure there's a self-referencing inbound rule to allow connectivity between Glue workers.

  5. Verify network configuration: If your Glue job is running in a private subnet, ensure you have a NAT Gateway or VPC endpoints configured correctly. Check that route tables for your private subnets are correctly configured.

  6. Review IAM permissions: Ensure the IAM role associated with your Glue connection has the necessary permissions to access both the Glue service and the RDS instance.

  7. Check database authentication: Verify that the credentials used in the JDBC connection are still valid and have the necessary permissions.

It's interesting that your Glue Jobs using the same connection are still working while the Test Connection and Crawlers are failing. This suggests that the jobs might be using a different runtime environment or driver configuration than what's used for testing connections and crawlers.

If these steps don't resolve the issue, you may need to contact AWS Support for further assistance, as there could be an account-specific issue or a temporary service problem affecting your connections.
Sources
AWS Glue Connection to RDS SQL Server Fails – "Failed status due to failed connection" | AWS re:Post
AWS Glue Test Connection: Failed with ''InvalidInputException: Unable to resolve any valid connection" | AWS re:Post
Troublehsoot AWS Glue connection to a JDBC data source | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.