Hi I am using annotation to map the servlet instead of web.xml, I am trying to retrive the entities from the datastore using objectify, (I am using java8 version of google app engine) and I am using static block to register the entity(class).
I got this error:
java.lang.IllegalStateException: You have not started an Objectify context. You are probably missing the ObjectifyFilter. If you are not running in the context of an http request, see the ObjectifyService.run() method.
at com.googlecode.objectify.ObjectifyService.ofy(ObjectifyService.java:44)
I know that, need have to objectify filter in the web.xml:(as below code) in my case I am not using web.xml
<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>
Question:
How can I do this objectify filter in the annotation?