DefaultJAXBContextImpl does not have a no-arg default constructor

Posted on 2011-10-16
Medium Priority
Last Modified: 2013-11-23
I have generated my JAXB classes using XJC Jars with the following version.

xjc version "1.0.6-01/24/2006 06:08 PM(kohsuke)-fcs"
JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build 1.0.6
-01/24/2006 06:08 PM(kohsuke)-fcs)

I am trying to deploy the application in Websphere application server 6.1. While trying to access the jaxb related classes for unmarshalling the data from database, I am getting the following errors.

[10/16/11 4:48:28:849 MST] 00000033 SystemErr     R com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
com.amex.ctcms.jaxb.impl.runtime.DefaultJAXBContextImpl does not have a no-arg default constructor.
        this problem is related to the following location:
                at com.xyz.learning.jaxb.impl.runtime.DefaultJAXBContextImpl
                at com.xyz.learning.jaxb.ObjectFactory

[10/16/11 4:48:28:850 MST] 00000033 SystemErr     R     at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:78)
[10/16/11 4:48:28:850 MST] 00000033 SystemErr     R     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:383)
[10/16/11 4:48:28:850 MST] 00000033 SystemErr     R     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContext

I think WAS 6.1 supports JAXB 2.0, but also it should be backward compatible.
I am able to run the same application code on my local machinem but getting the above error when I am deploying it on the WAS 6.1 server in Dev environment.

Any clues ??


Question by:satishkunchala
  • 2
  • 2
LVL 47

Expert Comment

ID: 36977473
Look at this piece of code (taken from
somewhere close to the point where you are getting the error

Class cls = DefaultJAXBContextImpl.class;
ProtectionDomain pDomain = cls.getProtectionDomain();
CodeSource cSource = pDomain.getCodeSource();
URL loc = cSource.getLocation(); 
// prints something like "c:/jars/MyFoo.jar"

Open in new window

If you add such code for DefaultJAXBContextImpl.class
it will print form which .jar is this class coming from

So you can make sure that it comes form the right jar

This trick helped us to find the solution in similar case:


Author Comment

ID: 36979570
Thanks for the information.
DefaultJAXBContextImpl is the source file which is
I have checked the JAXBContext class and the DefaultJAXBContextImpl.class and both classes are getting picked from the expected locations.
JAXBContext is coming from opt/websphere/Appserver/plugins/com.ibm.jaxb.tools_6.1.0.jar
and the DefaultJAXBContextImpl.class is picking from the project jar file.
 The issue remains the same and not sure what is going wrong.

The classloader is also showing up fine.
this.jaxbContext = JAXBContext.newInstance("com.xyz.learning.jaxb", this.getClass().getClassLoader());

The root cause is, I am unable to get this JAXBContext which is leading to the error.

There is not even a single annotation in those JAXB generated classes as I am using JAXB 1.0 XJC.
I am surprised to see that illegalAnnotationException there. Any pointers are greatly appreciated.
LVL 47

Expert Comment

ID: 36980640
Do you know what is the source of this  class:

Is it a new application which you are debugging or it has already been working before?

Accepted Solution

satishkunchala earned 0 total points
ID: 36980795
This is a new application. Never mind. The issue is with the jaxb.properties entries and I am able to solve the issue now. Thanks for all your help.
LVL 60

Expert Comment

by:Kevin Cross
ID: 37505677
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question