# What is the accessDeclaredMembers error?

**URL:** <https://discuss.elastic.co/t/what-is-the-accessdeclaredmembers-error/165303>\
**Category:** Elasticsearch\
**Created:** [January 22, 2019, 10:16pm UTC](https://discuss.elastic.co/t/what-is-the-accessdeclaredmembers-error/165303 "2019-01-22T22:16:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninesalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninesalt/32/39981_2.png) [@ninesalt](https://discuss.elastic.co/u/ninesalt)\
**Post date:** [January 22, 2019, 10:16pm UTC](https://discuss.elastic.co/t/what-is-the-accessdeclaredmembers-error/165303/1 "2019-01-22T22:16:01Z")

</div>

I'm trying to write an plugin in for ES but I keep getting this annoying error whenever I try it and I don't know what's causing it. Below is the class that appears in the errors:

```
public class SentimentAnalyzer {

GoSentiment gs;
Map<Integer, String> lookup;

public interface GoSentiment extends Library {

    class GoString extends Structure {  
        public static class ByValue extends GoString implements Structure.ByValue {}
        public String p;
        public long n;
        protected List<String> getFieldOrder(){
            return Arrays.asList(new String[]{"p","n"});
        }
    }

    int ClassifySentiment(GoString.ByValue str);
}

public SentimentAnalyzer(){
    String path = "/usr/share/elasticsearch/config/ingest-opennlp/sentiment.so";
    gs = Native.loadLibrary(path, GoSentiment.class);
    lookup = new HashMap<>();
    lookup.put(0, "negative");
    lookup.put(1, "positive");
}

public int analyzeSentiment(String text){
    GoSentiment.GoString.ByValue str = new GoSentiment.GoString.ByValue();
    str.p = text;
    str.n = text.length();
    return gs.ClassifySentiment(str);
}

public String toSentimentWord(int value){
    if(lookup.containsKey(value)){
        return lookup.get(value);
    }
    return "null";
}

```

}

Specifically, the error points to the `GoString` class declaration. What is happening here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 19, 2019, 10:21pm UTC](https://discuss.elastic.co/t/what-is-the-accessdeclaredmembers-error/165303/2 "2019-02-19T22:21:27Z")

</div>

Closed on February 19, 2019, 10:21pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
