Reputation: 10631
In Android Studio 1.0 when we generate Cloud Endpoints from Java Class then it adds necessary things in web.xml automatically,
the changes made by Android Studio in web.xml files are,
1.
<filter>
<filter-name>ObjectifyFilter</filter-name>
<filter-class>com.googlecode.objectify.ObjectifyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ObjectifyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
2.
<param-value>ADDS ENDPOINTS HERE AUTOMATICALLY</param-value>
Which wasn't done before (In Android Studio 0.8.6). The problem is it fails to start the local server. It says ERROR 503 SERVICE_UNAVAILABLE. Now I checked the build log. Then I saw that it was throwing java.lang.ClassNotFoundException: com.googlecode.objectify.ObjectifyFilter
exception.
So I added the line compile 'com.googlecode.objectify:objectify:5.0.3'
in build.gradle.
It worked fine then.
Also I noticed if I remove the following portion from web.xml, it also works fine.
<filter>
<filter-name>ObjectifyFilter</filter-name>
<filter-class>com.googlecode.objectify.ObjectifyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ObjectifyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Now is that a bug? Or am I missing something? Also what are the Objectify and ObjectifyFilters? Why do we need them?
Upvotes: 0
Views: 665
Reputation: 440
This is a bug. Thank you for letting us know. Objectify is a framework for persisting data to the cloud datastore, as you noticed, if you aren't using it you can simply remove the filter declaration and it should work fine.
Upvotes: 1
Reputation: 13556
Objectify is an API for the GAE datastore:
https://code.google.com/p/objectify-appengine/
Upvotes: 0