Skip to main content

4 counts of IllegalAnnotationExceptions

2 replies [Last post]
sionut
Offline
Joined: 2006-04-19

Hi,
I'm getting the following error when deploying my ear file:

.......
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
There are two properties named "errorMessage"
this problem is related to the following location:
at public java.lang.String com.xxx.webservices.exception.UserErrorMessage.getErrorMessage()
at com.xxx.webservices.exception.UserErrorMessage
at private java.util.ArrayList com.xxx.webservices.jaxws.UserOperationExceptionBean.errors
at com.xxx.webservices.jaxws.UserOperationExceptionBean
this problem is related to the following location:
at private java.lang.String com.xxx.webservices.exception.UserErrorMessage.errorMessage
at com.xxx.webservices.exception.UserErrorMessage
at private java.util.ArrayList com.xxx.webservices.jaxws.UserOperationExceptionBean.errors
at com.xxx.webservices.jaxws.UserOperationExceptionBean

.......

Here are my annotated classes:

@XmlType(name = "userErrorMessage", propOrder = {"userId","errorMessage"})
public class UserErrorMessage {
@XmlElement
private String userId;
@XmlElement
private String errorMessage;
....
//getters and setters for the above fields
}

@XmlRootElement(name = "UserOperationFault", namespace = "..")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UserOperationException",
namespace = "..",
propOrder = {"errors", "message"})
public class UserOperationExceptionBean {
@XmlElement
private String message;
@XmlElement
private ArrayList errors;
....
//getters and setters for the above fields
}

I don't understand what I'm doing wrong.. Can you help, please ?

Message was edited by: sionut

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sionut
Offline
Joined: 2006-04-19

I found the problem.. The deployment error was caused by an @XmlRootElement declared for the second class.

kohsuke
Offline
Joined: 2003-06-09

I like it when the reporter resolves the problem by himself :-)