"java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter" connecting to Microsoft SQL Server in JBoss EAP

Solution Verified - Updated -

Issue

  • Using Microsoft SQL Server JDBC 4.1 (or later) driver deployed in a JBoss module:

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.0" name="com.microsoft.sqlserver">
        <resources>
                <resource-root path="sqljdbc41.jar"/>
        </resources>
        <dependencies>
                <module name="javax.api"/>
                <module name="javax.transaction.api"/>
         </dependencies>
    </module>
    
  • Login fails with a NoClassDefFoundError:

    ... java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2758)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2244)
        ...
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
        at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:323)
        ... 41 more
    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter from [Module "com.microsoft.sqlserver:main" from local module loader ...
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:211)
        ...
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6
  • Microsoft SQL Server JDBC driver 4.1 or later

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.