0

I want to return JSON object back to the client side.I add dependencies and it is not working again.What is the purpose of 'repackaged'?I can not find any documentation of this pacakge to add in pom.xml.It allows me to create a JSONObject but in my console appear this error?!

pom.xml

<dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-json-plugin</artifactId>
        <version>${struts.version}</version>
    </dependency>
<dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-labs</artifactId>
        <version>${appengine.app.version}</version>
        <scope>test</scope>
    </dependency>

I used Gson and works for me.It is easy to implement and convert Java object to JSON and vice versa!Here is GSON dependency:

<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.3.1</version>
</dependency>
Fation Hadri
  • 160
  • 2
  • 2
  • 20

2 Answers2

1

Treat the 'repackaged' package as internal GAE implementation choices that may change. Such classes have their package path surgically altered to include repackaged so that they won't conflict with your choices.

I've had problems with Eclipse offering repackaged classes up as viable options. How to hide some Eclipse autocomplete results shows a way to fix that.

Community
  • 1
  • 1
Dave W. Smith
  • 24,318
  • 4
  • 40
  • 46
  • And which package should I include on "Type Filters"?I have include com.google.appengine.labs.repackaged.org.json but it is not working. – Fation Hadri Apr 05 '15 at 11:54
  • Sadly, I don't have that Eclipse config available to consult. Perhaps this will prompt another Eclipse user to answer. – Dave W. Smith Apr 06 '15 at 15:13
0

Just a follow up on this for IntelliJ users. You can tell the IDE to not offer repackaged classes in: (for IntelliJ 2016.1)

Settings > Editor > General > Auto Import > Exclude from Import and Completion

Enter there the following and you are done.

com.google.appengine.labs.repackaged
com.google.appengine.repackaged