Code as follows,
@SuppressWarnings("serial")
public class CommonRpcServiceImpl extends RemoteServiceServlet implements
CommonRpcService {
static {
ObjectifyService.register(UserTravelExpComment.class);
ObjectifyService.register(UserSubscribed.class);
ObjectifyService.register(ContactUs.class);
}
public void addtask() {
DBMailTask dbmailTask = new DBMailTask();
dbmailTask.paramValues(mailSubject, bodyText, strEmail, list);
Queue taskQ = QueueFactory.getQueue("db-mail");
taskQ.add(TaskOptions.Builder.withPayload(dbmailTask));
}
public class DBMailTask implements DeferredTask {
Objectify objectify = ObjectifyService.begin();
String subject = null;
String body = null;
String receipents = null;
List<Object> list = null;
public void paramValues (final String subjectt, final String bodyy, final
String receipentss, final List<Object> listt) {
this.subject = subjectt;
this.body = bodyy;
this.receipents = receipentss;
this.list = listt;
System.out.println("CommonRpcServiceImpl.DBMailTask.paramValues() values
set");
}
@Override
public void run() {
if(object instanceof UserSubscribed) {
UserSubscribed user = (UserSubscribed) object;
objectify.put(user);
}
if(object instanceof UserTravelExpComment) {
UserTravelExpComment user = (UserTravelExpComment) object;
objectify.put(user);
}
if(object instanceof ContactUs) {
ContactUs user = (ContactUs) object;
objectify.put(user);
}
}
}
}
queue.xml is as follows,
<?xml version="1.0" encoding="UTF-8"?>
<queue-entries>
<!--<queue>
<name>default</name>
<rate>1/s</rate>
</queue>
-->
<queue>
<name>db-mail</name>
<rate>20/s</rate>
<bucket-size>40</bucket-size>
<max-concurrent-requests>10</max-concurrent-requests>
<retry-parameters>
<task-retry-limit>7</task-retry-limit>
<!-- <task-age-limit>2</task-age-limit>-->
</retry-parameters>
</queue>
</queue-entries>
And stacktrace is simply
java.io.NotSerializableException: com.googlecode.objectify.impl.ObjectifyImpl
Also,
it does not work in production mode as well. it was my mistake for earlier
i said that it works in production.
Same exception in development and production modes.
thanks
Deepak
On Fri, Nov 11, 2011 at 1:18 AM, Jeff Schnitzer <[email protected]> wrote:
> I don't believe you :-)
>
> Post a full stacktrace and it should indicate where you are trying to
> serialize something you shouldn't.
>
> Jeff
>
> On Thu, Nov 10, 2011 at 3:34 PM, Deepak Singh <[email protected]>
> wrote:
> > Hi Jeff,
> > I am not doing anything.
> > just Objectify obj = ObjectifyService.beginTransactioon();
> > obje.put(registered class);
> > Thats all i am doing.
> > but it works fine production mode.
> > Thanks
> > Deepak
> >
> > On Fri, Nov 11, 2011 at 12:30 AM, Jeff Schnitzer <[email protected]>
> > wrote:
> >>
> >> It looks like you're trying to serialize an ObjectifyImpl. Don't do
> >> that. It's not serializable.
> >>
> >> Jeff
> >>
> >> On Thu, Nov 10, 2011 at 2:46 PM, Deepak Singh <[email protected]
> >
> >> wrote:
> >> > Hi,
> >> > Objectify 3.0.1 with GWT 2.4 and GAE 1.5.5
> >> > In development mode i get this exception
> >> > java.io.NotSerializableException:
> >> > com.googlecode.objectify.impl.ObjectifyImpl
> >> > while the same code works fine in production mode.
> >> > pls let me know whats the problem.
> >> >
> >> > Thanks
> >> > Deepak Singh
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Google App Engine" group.
> >> > To post to this group, send email to
> [email protected].
> >> > To unsubscribe from this group, send email to
> >> > [email protected].
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/google-appengine?hl=en.
> >> >
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Google App Engine" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected].
> >> For more options, visit this group at
> >> http://groups.google.com/group/google-appengine?hl=en.
> >>
> >
> >
> >
> > --
> > Deepak Singh
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/google-appengine?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
--
Deepak Singh
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.