After upgrading from Resteasy 2.4 to 3.0.5, none of my client calls work 
anymore. The entity which I am expecting (as simple as a String) is always 
null. In debug mode I can see it being set in the Response object on the server 
side, but on the client side the entity in the Response is null.
Here is an example call:

The interface:

   * @return all expired licenses
  @ClientResponseType(entityType = LicenseList.class)
  public Response getExpiredLicenses();

The implementation:

   * @return all expired licenses
  public Response getExpiredLicenses() {
    try {
      LicenseList list = LicensesDBUtil.getExpiredLicenses();
      Response resp = Response.ok().entity(list).build();
      return resp;
    } catch (SQLException e) {
      LOG.error("Error getting expired licenses : " + e.getMessage());

The test call :

  public void testGetExpiredLicenses() throws Exception {
        ResteasyClientBuilder rsb = new ResteasyClientBuilder();
    ResteasyClient rsc =;
    ResteasyWebTarget target =;
    return target.proxy(RiskScapeLicenseService.class);
    Response response = client.getExpiredLicenses();
    assertTrue(HttpResponseCodes.SC_OK == response.getStatus());
    JAXBElement<LicenseList> element = (JAXBElement<LicenseList>) 
    LicenseList list = element.getValue();
    assertEquals(4, list.getLicenses().size());
    for (License lic : list.getLicenses()) {
      assertTrue((new Date()).after(DateUtils.parseDate(lic.getValidTo(), new 
String[] { "yyyy-MM-dd" })));

My web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi=""; 
xsi:schemaLocation=""; version="2.5">

The LicenseList class:

@XmlRootElement(name = "LicenseList")
@XmlType(name = "licenseList", propOrder = {
public class LicenseList {

    @XmlElement(name = "Licenses", required = true)
    protected List<License> licenses;

     * Gets the value of the licenses property.
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the licenses 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getLicenses().add(newItem);
     * </pre>
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link License }
    public List<License> getLicenses() {
        if (licenses == null) {
            licenses = new ArrayList<License>();
        return this.licenses;


I am using JDK 1.7, Tomcat 7.0.47
Dr Gabriella Turek
Sr. Software Engineer, Systems Development Team
NIWA Auckland, New Zealand
Tel: +64 9 3754645
NIWA - Enhancing the benefit of New Zealand’s natural resources.
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric 
Research Ltd.
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
Resteasy-users mailing list

Reply via email to