Using JAXB with JDK1.5 - Fix for ContextFactory not found issue

This article talks about integrating JAXB with JDK 1.5 version.

What is JAXB?

Java Architecture for XML Binding(JAXB) is a fast and convenient way to bind Java Objects and XML. JAXB makes Marshalling and UnMarshalling easy for the developers.

Starting from JDK 6, JAXB is integrated with JDK itself. Below given the versions available in each JDK version:

JDK6 - JAXB 2.0.3
JDK6 u4 - JAXB 2.1.3
JDK6 u14 - JAXB 2.1.10
JDK7 first release - JAXB 2.2.4-1

JAXB with JDK 1.5

To use JAXB with JDK 1.5 include the maven dependency:

javax.xml.bind jaxb-api 2.1 com.sun.xml.bind jaxb-impl 2.1.12

You may get the below exception if the implementation jars are not included:

javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]

Comments

Popular posts from this blog

Induction Cooker Showing an Error Code? Induction Cooker Error Codes Explained

HDFC Bank introduces Missed Call Service to know Account Balance

LICHFL - Generating Home Loan Statements Online