Friday, October 20, 2017

GWT 2.8.2 release => [ERROR] ... XmlRootElement ... XmlElement ... cannot be resolved to a type

Eh...

I changed my gradle build config to use 2.8.2 and started getting import annotation errors (below).

Switching back 2.8.1 and the errors go away.

The annotations are imports from:

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

> Task :compileGwt
Compiling module selenium.RestyGwtCodecTester
   Tracing compile failure path for type 'me.pubz.sitemap.SitemapIndex'
      [ERROR] Errors in 'jar:file:/home/michael/git/SHARED-POJOS/SHARED-POJOS/build/libs/SHARED-POJOS-20170711.jar!/me/pubz/sitemap/SitemapIndex.java'
         [ERROR] Line 15: XmlRootElement cannot be resolved to a type
         [ERROR] Line 45: XmlElement cannot be resolved to a type
         [ERROR] Line 22: XmlAttribute cannot be resolved to a type
         [ERROR] Line 8: The import javax.xml.bind cannot be resolved
         [ERROR] Line 32: XmlAttribute cannot be resolved to a type
         [ERROR] Line 7: The import javax.xml.bind cannot be resolved
         [ERROR] Line 9: The import javax.xml.bind cannot be resolved
         [ERROR] Line 27: XmlAttribute cannot be resolved to a type

offending code:

package me.pubz.sitemap;


import java.util.Date;
import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Created by AmitG on 20-03-2014.
 */

@XmlRootElement(name = "sitemapindex")
public class SitemapIndex {

    private String xmlns;
    private List<SitemapindexEntry> sitemaps;
    private String elapsed;
   
    @XmlAttribute()
    public Date getGenerated(){
        return new java.util.Date();
    }

    @XmlAttribute()
    public String getXmlns() {
        return xmlns;
    }
   
    @XmlAttribute()
    public String getElapsed(){
        return elapsed;
    }
   
    public void setElapsed(String elapsed){
        this.elapsed=elapsed;
    }

    public void setXmlns(String xmlns) {
        this.xmlns = xmlns;
    }

    @XmlElement(name = "sitemap")
    public List<SitemapindexEntry> getSitemaps() {
        return sitemaps;
    }

    public void setSitemaps(List<SitemapindexEntry> sitemaps) {
        this.sitemaps = sitemaps;
    }
}

No comments:

Post a Comment