users@jaxb.java.net

unmarshal generates null field

From: Luis Pinto <luispinto_at_ua.pt>
Date: Thu, 19 May 2011 14:05:14 +0100

Hi, I have a Web Service created in java (1.6), with metro (2.0), using
maven, under Tomcat 6. In all web methods the return type is a generic
class:

public class WsResult<T> {
     protected T result; // the actual result
     protected Code requestState; // 0K, or some error code if needed
     protected String message; // if error, instead of result, insert
a message
}

In some web methods it is working, but in others even in case of success
the result field is null.

The cases this happens is when the result type is a class with a single
attribute of type List<? class>.

This project is part of a biggest one. So for test purposes I created a
new one, simpler, just the project, with the same data model, and copy
one of the web methods, in this case it worked, and after unmarshal, I
had a result that i could cast to the expected type.

What could be happening?