Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using JAXB for classes extending third party objects

161271Feb 1 2013 — edited Feb 4 2013
I am trying to use JMX WS connector in my project. I have stuck with a problem I cannot solve. For example, I have class
public class TypedObjectName extends ObjectName

I do not know how to annotate this class. If I am trying to use @XmlRootElement annotation and provide no-arg default constructor for this class, JAXB throws an error
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
javax.management.ObjectName does not have a no-arg default constructor.
this problem is related to the following location:
at javax.management.ObjectName
at com.hp.usage.mgmt.naming.TypedObjectName
I am not able to modify ObjectName because it is a part of jdk, third party class from javax.management. I need to have this class in JAXB context since one my service has a method with this type, for example

*public interface PerformanceMeasurement {*
*...*
public TypedObjectName getJob();
*}*
Any ideas to make it workable?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2013
Added on Feb 1 2013
6 comments
3,926 views