[appengine-java] Re: need comment on using @transactional on service layer

2009-11-30 Thread Nacho Coloma
Your code looks OK. BTW, you do not need to explicitely open/close
your EntityManager, nor is the getEntityManager() method required.

As far as I know, as long as Spring is using interceptors and not
weaving (should be your case), you should be OK.

On Nov 28, 5:49 pm, asianCoolz  wrote:
> @transactional is supported right? or do i need to use aop-
> transactional?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: redirect /file.jsp

2009-11-30 Thread Nacho Coloma
You most probably have modified your local server default install. If
the JSP servlet is in place, the file will be served OK.

Your web.xml snippet should not be needed.

On Nov 27, 7:49 pm, Don  wrote:
> Hi,
>
> Trivial question for the gurus here,
>
> if i do:
>     response.redirect("bla.jsp")
> I get
> "WARNING: Can not serve /bla.jsp directly.  You need to include it in
>  in your appengine-web.xml." on development server
> (localhost)
>
> Everything is ok when it is run on the cloud.
> Why??
>
> I know I have to do this below so it works on localhost...
> "
>         blajsp
>         /bla.jsp
>     
>
>     
>         blajsp
>         /blajsp
>     
> "

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Transaction Error with No Transactions

2009-11-30 Thread datanucleus
You obviously made an update for it to think there is a "dirty"
object. The log would tell you this, and what the object state is.
Closing the pm causes a flush of any outstanding non-tx changes, as
per the JDO spec

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] jdo on app engine

2009-11-30 Thread asianCoolz
1.any tool to generate jdo pojo?
2. any impact of using primary key as long and autoincrement it rather
than using jdo 's key ? I do understand that max autoincrement for
sequence is e+27,  how about KEY ?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Processing incoming email

2009-11-30 Thread Jeremy Blythe
I think this is a bug in app engine - it doesn't seem to be following the
standard. I've blogged the solution here:
http://jeremyblythe.blogspot.com/2009/11/receiving-email-in-google-app-engine.html

J.

On Mon, Nov 30, 2009 at 2:34 PM, Peter Ondruska wrote:

> I am following instructions on
> http://code.google.com/appengine/docs/java/mail/receiving.html
> to process incoming mail but failing on retrieving content (headers
> are fine).
>
> "The getContent() method returns an object that implements the
> Multipart interface. You can then call getCount() to determine the
> number of parts and getBodyPart(int index) to return a particular body
> part."
>
> MimeMultipart mmp = (MimeMultipart) message.getContent();
>
> Error:
> java.lang.ClassCastException: java.io.ByteArrayInputStream cannot be
> cast to javax.mail.internet.MimeMultipart
>
> And when I check at runtime what class is returned by getContent() it
> really is java.io.ByteArrayInputStream.
>
> Am I doing something wrong?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: My indexes are stuck in "BUILDING" state after deploying my app for the first time (i.e. on an empty datastore)

2009-11-30 Thread Tim Cooper
As you both said, I just needed to wait - they're all good now.  But I
find this a little worrying:  is this a common thing, that AppEngine
goes down for 2 hours?  Is this classified as "going down"?  Because
it shouldn't take 2 hours to build indexes on 34K worth of data (just
5 entities).


On Dec 1, 4:43 am, david ruescas  wrote:
> A similar thing happened to me yesterday. The problem resolved itself
> overnight, cant tell you exactly how long it took.
>
> On 11/30/09, Jeffrey Goetsch  wrote:
>
>
>
> > I was having about 2 hour index build times.  I think a lot of people were
> > launching over the weekend.
>
> > --Jeff
>
> > On Sun, Nov 29, 2009 at 8:36 PM, Tim Cooper  wrote:
>
> >> I've just deployed my AppEngine application for the first time.  It
> >> was working perfectly when running in the development environment on
> >> my laptop, but doesn't work in its deployed state.  I'm getting "500
> >> Server Error", "DatastoreNeedIndexException: no matching index
> >> found".   The dashboard says that all my 7 indexes are still in the
> >> BUILDING state and have been for about an hour.   The datastore was
> >> empty before I did this, and it now has a total size of 34K...(somehow
> >> 2 entities managed to get half created).
>
> >> The documentation says to mail this group if it appears that the
> >> indexes are stuck.  I haven't been able to get useful information from
> >> the group threads from the other people who have reported this
> >> problem.
>
> >> The application-id is "edvaltt".
>
> >> I'm unable to continue my work.  Can anyone help?
>
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "Google App Engine for Java" group.
> >> To post to this group, send email to
> >> google-appengine-j...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-appengine-java+unsubscr...@googlegroups.com >>  unsubscr...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: oid is not instanceof javax.jdo.identity.ObjectIdentity

2009-11-30 Thread bcottam
no one has any ideas on this?

I'd really like to know if this is just a bug that will be resolved
(in which case I'll continue to use this data model) or if there is a
flaw in my data model/JDO usage.

thanks!
-bryce



On Nov 30, 1:21 am, bcottam  wrote:
> I'm trying to save some data in my app, quite similar to almost all
> other data I've previously saved.  However, I'm now getting this stack
> trace:
>
> java.lang.ClassCastException: oid is not instanceof
> javax.jdo.identity.ObjectIdentity
>         at com.resmark.client.model.RatePlan.jdoCopyKeyFieldsFromObjectId
> (RatePlan.java)
>         at
> org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObjectAsValue
> (PersistenceCapableMapping.java:657)
>         at
> org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObject
> (PersistenceCapableMapping.java:364)
>         at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $1.setObjectViaMapping(DatastoreRelationFieldManager.java:132)
>         at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $1.apply(DatastoreRelationFieldManager.java:108)
>         at
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
> (DatastoreRelationFieldManager.java:80)
>         at
> org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
> (DatastoreFieldManager.java:795)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
> (DatastorePersistenceHandler.java:288)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
> (DatastorePersistenceHandler.java:241)
>         at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
> (DatastorePersistenceHandler.java:225)
>         at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent
> (JDOStateManagerImpl.java:3185)
>         at org.datanucleus.state.JDOStateManagerImpl.makePersistent
> (JDOStateManagerImpl.java:3161)
>         at org.datanucleus.ObjectManagerImpl.persistObjectInternal
> (ObjectManagerImpl.java:1298)
>         at org.datanucleus.ObjectManagerImpl.persistObject
> (ObjectManagerImpl.java:1175)
>         at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent
> (JDOPersistenceManager.java:669)
>         at org.datanucleus.jdo.JDOPersistenceManager.makePersistent
> (JDOPersistenceManager.java:694)
>         at com.resmark.server.model.service.BaseDataService.create
> (BaseDataService.java:227)
>         at com.resmark.server.SetupServiceImpl.updateOrCreate
> (SetupServiceImpl.java:120)
>         at com.resmark.server.SetupServiceImpl.updateOrCreateBundle
> (SetupServiceImpl.java:67)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at com.google.appengine.tools.development.agent.runtime.Runtime.invoke
> (Runtime.java:100)
>         at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
> (RPC.java:527)
>         at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
> (RemoteServiceServlet.java:166)
>         at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
> (RemoteServiceServlet.java:86)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> 487)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1093)
>         at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
> (TransactionCleanupFilter.java:43)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1084)
>         at com.google.appengine.tools.development.StaticFileFilter.doFilter
> (StaticFileFilter.java:121)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1084)
>         at org.mortbay.jetty.servlet.ServletHandler.handle
> (ServletHandler.java:360)
>         at org.mortbay.jetty.security.SecurityHandler.handle
> (SecurityHandler.java:216)
>         at org.mortbay.jetty.servlet.SessionHandler.handle
> (SessionHandler.java:181)
>         at org.mortbay.jetty.handler.ContextHandler.handle
> (ContextHandler.java:712)
>         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 405)
>         at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle
> (DevAppEngineWebAppContext.java:54)
>         at org.mortbay.jetty.handler.HandlerWrapper.handle
> (HandlerWrapper.java:139)
>         at com.google.appengine.tools.development.JettyContainerService
> $ApiProxyHandler.handle(JettyContainerService.java:342)
>         at org.m

[appengine-java] Re: Spring MVC with annotations

2009-11-30 Thread Rafael Reuber
Hi Toby,

 The error only happens when I try to access the application
through the GAE. It's funny, In my computer it work!
 The GAE throws erro, when I do deploy with  these tag
""
in my spring-context.xml


On Nov 29, 11:23 am, Toby  wrote:
> Hi Rafael,
>
> What kind of error do you get, what annotations do you use?
> I used @Autowired and @Ressource and it worked fined. My main problem
> is that appengine unloads the webapp after short idle time. Whenever
> it is needed again it is reloaded which takes long and costs a lot of
> cpu time.  I found that stripping annotations accelerated the process.
>
> Cheers,
> Tobias
>
> On Nov 28, 9:31 pm, Rafael Reuber  wrote:
>
> > I developed an program with Spring MVC + annotations. He done in my
> > computer. But when I make deploy and try acess the application, the GAE
> > throws an error. Someone got use annotations with Spring MVC?
>
> > --
> > Rafael Reuber
> > MSN/Gtalk: psico.in...@gmail.com

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] First Request High CPU

2009-11-30 Thread Jess Evans
Will there be a way to separate start up activity from request activity, so
that initial requests will not be killed prematurely with a deadline
exceeded error?

On Nov 30, 2009 5:15 PM, "Toby Reyelts"  wrote:

Hi Jeff,

First, it's definitely a net win for us to spin down an application if it
doesn't receive much traffic, even if the loading requests are significantly
more expensive. This is one of the main reasons why we're able to offer
everyone free quota on App Engine - it doesn't cost us extra money to host
your app when it's not actually receiving traffic.

Second, as far as your free quota goes, it should be very difficult
(impossible?) to use it up with just loading requests. The number of loading
requests you get is inversely proportional to the traffic your app receives.
The more CPU you chew up due to incoming traffic, the less CPU you chew up
due to loading requests.

Third, as Ikai says, we're continuously and aggressively working on
optimizations for reducing both the latency of and the amount of CPU spent
on loading requests. Keep a lookout for announcements in upcoming releases.

Finally, I've filed a feature
requestin
the issue tracker for reserving JVMs. If you'd like to be able to pay
to
reserve a JVM, please star the issue. Feel free to leave a comment about
what you feel would be a reasonable pricing scheme.

On Mon, Nov 30, 2009 at 3:50 PM, Jeffrey Goetsch 
wrote: > > The billing opti...

-- You received this message because you are subscribed to the Google Groups
"Google App Engine for...

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Transaction Error with No Transactions

2009-11-30 Thread Jeffrey Goetsch
Yes, no place in my code do I call tx.begin().I don't believe I even
made an update, but it is possible that I did some clean up updates when I
accessed some of the data.  But definitely don't have any transaction code.

Thanks,
Jeffrey

On Mon, Nov 30, 2009 at 1:48 PM, James H  wrote:

> So, you are saying that your code did NOT perform a tx.begin() yet the
> exception is complaining that Multiple Entity Groups have been
> accessed during the course of a transaction?  Note that only a query
> (not an update) of an entity outside the currently Entity Group update
> triggers this error.
>
> I assume if a transaction is NOT active then NO read locks occur and
> all updates are considered Singleton updates.  Note that updates in
> JDO are triggered by simply using a setter on a persisted Entity
> attribute.
>
> On Nov 30, 11:26 am, Jeffrey Goetsch  wrote:
> > I am getting an exception that I pasted below.  It describes a
> transaction
> > error, but I have not programmed any transactions.  On top of that, the
> > request that I made should not have changed any data.  Has anyone else
> been
> > getting errors like this?
> >
> > Caused by: java.lang.IllegalArgumentException: can't operate on multiple
> > entity groups in a single transaction.
> >
> > at
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(Datast­oreApiHelper.java:33)
> > at
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(Datastor­eApiHelper.java:60)
> > at
> com.google.appengine.api.datastore.DatastoreServiceImpl$1.run(DatastoreServ­iceImpl.java:113)
> > at
> com.google.appengine.api.datastore.TransactionRunner.runInTransaction(Trans­actionRunner.java:30)
> > at
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:99)
> > at
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:72)
> > at
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:60)
> > at
> org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.ge
> ­t(RuntimeExceptionWrappingDatastoreService.java:63)
> > at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePe­rsistenceHandler.java:81)
> > at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePe­rsistenceHandler.java:91)
> > at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(Da­tastorePersistenceHandler.java:487)
> > at
> org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:45­76)
> > at
> org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814­)
> > at
> org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754)
> > at
> org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2893)
> > at
> org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:369)
> > at
> org.datanucleus.TransactionImpl.commit(TransactionImpl.java:256)
> > at
> org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:801)
> > at
> org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:­271)
> > ... 51 more
> >
> > Thanks,
> >
> > Jeffrey
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Pay to Reserve JVM

2009-11-30 Thread Jeffrey Goetsch
There is a feature request to allow you to Pay to Reserve a JVM.  They are
wanting to see if people would be willing to pay, and how much they are will
to pay.

If you are interested in this feature, please vote on the ticket and comment
how much you are willing to pay.

http://code.google.com/p/googleappengine/issues/detail?id=2456#makechanges


Thanks,
Jeffrey

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Datanucleus Exception - deletePersistent() called recursively

2009-11-30 Thread Jeffrey Goetsch
Update:  This appears to happen when I remove the last entry in the Set.

--Jeff

On Mon, Nov 30, 2009 at 2:21 PM, Jeffrey Goetsch wrote:

> I am getting this exception when I try and remove an Owned object from a
> Set.   Let me know if you need more then the stack trace.
>
> Thanks,
> Jeffrey
>
>
> Caused by: org.datanucleus.exceptions.NucleusUserException:
> deletePersistent() called recursively
>  at
> org.datanucleus.state.JDOStateManagerImpl.internalDeletePersistent(JDOStateManagerImpl.java:4184)
> at
> org.datanucleus.state.JDOStateManagerImpl.deletePersistent(JDOStateManagerImpl.java:4166)
>  at
> org.datanucleus.ObjectManagerImpl.deleteObjectInternal(ObjectManagerImpl.java:1470)
> at
> org.datanucleus.store.mapped.scostore.FKSetStore.remove(FKSetStore.java:527)
>  at
> org.datanucleus.store.appengine.DatastoreFKSetStore.remove(DatastoreFKSetStore.java:78)
> at org.datanucleus.sco.backed.Set.remove(Set.java:712)
>  at org.datanucleus.sco.backed.Set.remove(Set.java:672)
> at
> org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.preDelete(PersistenceCapableMapping.java:1308)
>  at
> org.datanucleus.store.appengine.DependentDeleteRequest.execute(DependentDeleteRequest.java:71)
> at
> org.datanucleus.store.appengine.DatastorePersistenceHandler.deleteObject(DatastorePersistenceHandler.java:533)
>  at
> org.datanucleus.state.JDOStateManagerImpl.internalDeletePersistent(JDOStateManagerImpl.java:4198)
> at
> org.datanucleus.state.JDOStateManagerImpl.deletePersistent(JDOStateManagerImpl.java:4166)
>  at
> org.datanucleus.ObjectManagerImpl.deleteObjectInternal(ObjectManagerImpl.java:1470)
> at
> org.datanucleus.store.mapped.scostore.FKSetStore.remove(FKSetStore.java:527)
>  at
> org.datanucleus.store.appengine.DatastoreFKSetStore.remove(DatastoreFKSetStore.java:78)
> at org.datanucleus.sco.backed.Set.remove(Set.java:712)
>  at org.datanucleus.sco.backed.Set.remove(Set.java:672)
> at
> com.slowplay.mobworld.commons.server.domain.Player.unhireTroops(Player.java:456)
>  at
> com.slowplay.mobworld.citywars.server.CityWarsServiceImpl.unhire(CityWarsServiceImpl.java:146)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:592)
> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
>  ... 27 more
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Datanucleus Exception - deletePersistent() called recursively

2009-11-30 Thread Jeffrey Goetsch
I am getting this exception when I try and remove an Owned object from a
Set.   Let me know if you need more then the stack trace.

Thanks,
Jeffrey


Caused by: org.datanucleus.exceptions.NucleusUserException:
deletePersistent() called recursively
at
org.datanucleus.state.JDOStateManagerImpl.internalDeletePersistent(JDOStateManagerImpl.java:4184)
at
org.datanucleus.state.JDOStateManagerImpl.deletePersistent(JDOStateManagerImpl.java:4166)
at
org.datanucleus.ObjectManagerImpl.deleteObjectInternal(ObjectManagerImpl.java:1470)
at
org.datanucleus.store.mapped.scostore.FKSetStore.remove(FKSetStore.java:527)
at
org.datanucleus.store.appengine.DatastoreFKSetStore.remove(DatastoreFKSetStore.java:78)
at org.datanucleus.sco.backed.Set.remove(Set.java:712)
at org.datanucleus.sco.backed.Set.remove(Set.java:672)
at
org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.preDelete(PersistenceCapableMapping.java:1308)
at
org.datanucleus.store.appengine.DependentDeleteRequest.execute(DependentDeleteRequest.java:71)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.deleteObject(DatastorePersistenceHandler.java:533)
at
org.datanucleus.state.JDOStateManagerImpl.internalDeletePersistent(JDOStateManagerImpl.java:4198)
at
org.datanucleus.state.JDOStateManagerImpl.deletePersistent(JDOStateManagerImpl.java:4166)
at
org.datanucleus.ObjectManagerImpl.deleteObjectInternal(ObjectManagerImpl.java:1470)
at
org.datanucleus.store.mapped.scostore.FKSetStore.remove(FKSetStore.java:527)
at
org.datanucleus.store.appengine.DatastoreFKSetStore.remove(DatastoreFKSetStore.java:78)
at org.datanucleus.sco.backed.Set.remove(Set.java:712)
at org.datanucleus.sco.backed.Set.remove(Set.java:672)
at
com.slowplay.mobworld.commons.server.domain.Player.unhireTroops(Player.java:456)
at
com.slowplay.mobworld.citywars.server.CityWarsServiceImpl.unhire(CityWarsServiceImpl.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
... 27 more

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] How Do I Use appcfg.cmd rollback

2009-11-30 Thread Prashant
appcfg.cmd rollback "C:\Documents and Settings\Darren\workspace\Sandpit\war"
-- put path between double quotes

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] simultaneous active request limit error

2009-11-30 Thread Ikai L (Google)
What is your application ID?

On Sat, Nov 28, 2009 at 1:59 PM, Rock  wrote:

> Hi,
> I just uploaded my app and I have not enabled billing for this. No
> traffic is running on my applicaition but when I open the application
> the servlet throws error.
>
> I am constantly getting this error in the logs for my application
> hosted on GAE:
>
> Request was aborted after waiting too long to attempt to service your
> request. Most likely, this indicates that you have reached your
> simultaneous active request limit. This is almost always due to
> excessively high latency in your app. Please see
> http://code.google.com/appengine/docs/quotas.html for more details.
>
> But if I go to Quota Details, I can see that maximum usage of all
> resources is either 0% or 1%.
>
> If I see my "request only" logs, I can see one entry which is taking
> 2527 cpu_ms and a warning is shown which says "This request used high
> amount of CPU and may soon exceed its quota".
>
> Please Help
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] First Request High CPU

2009-11-30 Thread Toby Reyelts
Hi Jeff,

First, it's definitely a net win for us to spin down an application if it
doesn't receive much traffic, even if the loading requests are significantly
more expensive. This is one of the main reasons why we're able to offer
everyone free quota on App Engine - it doesn't cost us extra money to host
your app when it's not actually receiving traffic.

Second, as far as your free quota goes, it should be very difficult
(impossible?) to use it up with just loading requests. The number of loading
requests you get is inversely proportional to the traffic your app receives.
The more CPU you chew up due to incoming traffic, the less CPU you chew up
due to loading requests.

Third, as Ikai says, we're continuously and aggressively working on
optimizations for reducing both the latency of and the amount of CPU spent
on loading requests. Keep a lookout for announcements in upcoming releases.

Finally, I've filed a feature
requestin
the issue tracker for reserving JVMs. If you'd like to be able to pay
to
reserve a JVM, please star the issue. Feel free to leave a comment about
what you feel would be a reasonable pricing scheme.

On Mon, Nov 30, 2009 at 3:50 PM, Jeffrey Goetsch wrote:

> The billing option sounds like a great solution allow people to keep an
> instance up and running.  I would pay $5 a month to keep servers up, but I
> would suggest pricing the feature as a free feature if you spend $5 a month.
>
> As for the cron job, I was doing work every 5 minutes, but I found that was
> using about 10% of my free CPU time.  Once I moved the cron down to a
> minute, I don't even use 0.1%.  This seems like it is better performance for
> your servers, but I understand needing to turn off non active sites.
>
> -Jeff
>
> On Mon, Nov 30, 2009 at 11:38 AM, Ikai L (Google) wrote:
>
>> Yes. This is an issue we are working on. Basically, what happens is that
>> instances of your application are elastic and loaded up upon demand. As your
>> application grows, we will grow with you, but one of the consequences of
>> this is that if your application is not receiving many requests, we may
>> cycle you out to allocate more instances for an application with higher
>> resource requirements.
>>
>> We discourage running cron jobs to reduce startup time because ultimately,
>> this will result in more aggressive cycling for all of our users. We're
>> looking at several techniques to speed up Java application startup time.
>> It's also been suggested that we should look at a billing enabled option for
>> keeping a certain number of instances warm at all times.
>>
>> On Sun, Nov 29, 2009 at 11:22 PM, Jeffrey Goetsch wrote:
>>
>>> I have noticed that the first request to a server instance has really
>>> high CPU usage (7000+ milliseconds).  After the server is up, the same
>>> request takes only 20 milliseconds.  I am not using Spring or any other
>>> framework.  It appears that the time is used during the first execute call
>>> on a Datastore query.
>>>
>>> Is this a normal behavior?
>>>
>>> I have a cron job that I was running every 2 minutes, but that alone was
>>> using 15% of my free quota.  I have moved the cron to every minute, and I'm
>>> seeing huge improvement on performance and quota.  The cron used to take
>>> 7000+ ms  and now I am getting 20ms.  Does this mean you should make sure
>>> you have at least on cron running every minute?
>>>
>>> Thanks,
>>> Jeffrey
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine for Java" group.
>>> To post to this group, send email to
>>> google-appengine-j...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>
>>
>>
>> --
>> Ikai Lan
>> Developer Programs Engineer, Google App Engine
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@go

[appengine-java] How Do I Use appcfg.cmd rollback

2009-11-30 Thread redboffin
hello :-)

I am using the Google Apps Plugin for Eclipse.

I can't deploy my app as there is another deployment which hasn't
completed - not sure why.

I read the docs at 
http://code.google.com/appengine/docs/java/tools/uploadinganapp.html#Command_Line_Arguments
in order to use the appcfg.cmd rollback and it asks for the location
of the  and this is confusing me - what is the war
location.

I have tried: C:\Documents and Settings\Darren\My Documents\Java API's
\Google API's\appengine-java-sdk-1.2.6\bin>appcfg.cmd rollback C:
\Documents and Settings\Darren\workspace\Sandpit\war

and: C:\Documents and Settings\Darren\My Documents\Java API's\Google
API's\appengine-java-sdk-1.2.6\bin>appcfg.cmd rollback C:\Documents
and Settings\Darren\workspace\Sandpit\war\

but it says: Unable to find the webapp directory C:\Documents

Can someone explain what I am doing wrong?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] (JDOQL) Is this a bug? (repost)

2009-11-30 Thread Prashant
yeah, sure.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] (JDOQL) Is this a bug? (repost)

2009-11-30 Thread Max Ross (Google)
It's definitely an odd problem.  Please let us know if you see it with you
new classes.

Max

On Mon, Nov 30, 2009 at 1:56 PM, Prashant  wrote:

> And, I am using java sdk 1.2.6
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] (JDOQL) Is this a bug? (repost)

2009-11-30 Thread Prashant
And, I am using java sdk 1.2.6

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] (JDOQL) Is this a bug? (repost)

2009-11-30 Thread Prashant
Sorry Max, I Just changed my class design and moved all data to new one. I
guess there was some problem with indexes -
http://groups.google.com/group/google-appengine-java/browse_thread/thread/ce4ccf6fbc62d397/14bc40f42c99f100#14bc40f42c99f100

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Transaction Error with No Transactions

2009-11-30 Thread James H
So, you are saying that your code did NOT perform a tx.begin() yet the
exception is complaining that Multiple Entity Groups have been
accessed during the course of a transaction?  Note that only a query
(not an update) of an entity outside the currently Entity Group update
triggers this error.

I assume if a transaction is NOT active then NO read locks occur and
all updates are considered Singleton updates.  Note that updates in
JDO are triggered by simply using a setter on a persisted Entity
attribute.

On Nov 30, 11:26 am, Jeffrey Goetsch  wrote:
> I am getting an exception that I pasted below.  It describes a transaction
> error, but I have not programmed any transactions.  On top of that, the
> request that I made should not have changed any data.  Has anyone else been
> getting errors like this?
>
> Caused by: java.lang.IllegalArgumentException: can't operate on multiple
> entity groups in a single transaction.
>
>         at 
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(Datast­oreApiHelper.java:33)
>         at 
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(Datastor­eApiHelper.java:60)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl$1.run(DatastoreServ­iceImpl.java:113)
>         at 
> com.google.appengine.api.datastore.TransactionRunner.runInTransaction(Trans­actionRunner.java:30)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:99)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:72)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:60)
>         at 
> org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.ge­t(RuntimeExceptionWrappingDatastoreService.java:63)
>         at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePe­rsistenceHandler.java:81)
>         at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePe­rsistenceHandler.java:91)
>         at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(Da­tastorePersistenceHandler.java:487)
>         at 
> org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:45­76)
>         at 
> org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814­)
>         at 
> org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754)
>         at 
> org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2893)
>         at 
> org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:369)
>         at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:256)
>         at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:801)
>         at 
> org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:­271)
>         ... 51 more
>
> Thanks,
>
> Jeffrey

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] (JDOQL) Is this a bug? (repost)

2009-11-30 Thread Max Ross (Google)
Which SDK are you using?  Also, are you seeing this locally or in prod?  If
you're seeing it in prod can you reproduce the behavior locally?

Thanks,
Max

On Wed, Nov 25, 2009 at 1:15 AM, Prashant  wrote:

> following is my JDO class:
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class _Contact{
>
> @Persistent(primaryKey = "true")
> private String EmailID;
>
> @Persistent
> private String Name;
>
> @Persistent
> private List Groups;
> }
>
>
>
> following is my test case:
>
>
> PersistenceManager pm = pmf.getPersistenceManager();
>
> Query query = pm.newQuery(_Contact.class);
>
> query.setOrdering("EmailID");
> query.setFilter("Groups.contains(\"mygroup\")");
>
> int i = 1;
> for(_Contact cont : (List<_Contact>) query.execute()){
> resp.getWriter().print(i++ + " " + cont.getID() + "");
> }
>
> pm.close();
>
>
> above code printed 23 contacts and when I replaced  *
> query.setOrdering("EmailID"); *by *query.setOrdering("EmailID desc"); *it
> printed 18 contacts only. Is it a bug or I am missing something?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: load-on-startup not working for a generic servlet

2009-11-30 Thread Tahir Akram
Thanks Don :) it works as you suggest.

On Dec 1, 1:51 am, Don Schwarz  wrote:
> You want to override init(), not service().
>
> On Mon, Nov 30, 2009 at 2:49 PM, Tahir Akram  wrote:
> > I want to initialize a generic servlet on load-on-startup = 1. I read
> > on GAE docs that this feature is supported but happen only when first
> > request comes, not prior to it. But its not working. I dont know
> > whether on local and production it has same behavior.
>
> > Will anyone please guide me if I can do that?
>
> > My Generic servlet code:
>
> > public class StartupServlet extends GenericServlet {
> >        public void service(ServletRequest arg0, ServletResponse arg1)
> >                        throws ServletException, IOException {
> >                 String serverInfo = getServletContext().getServerInfo();
> >         if (serverInfo.contains("Development")) {
> >                 FFConstants.DEV_MODE = true;
> >         }else {
> >                 FFConstants.DEV_MODE = false;
> >         }
> >        }
> > }
>
> > Web.xml enteries
>
> >  
> >    StartupServlet
> >    com.servlet.StartupServlet
> >    1
> >  
>
> >  
> >    StartupServlet
> >    /Startup
> >  
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Any rules product that works on AppEngine?

2009-11-30 Thread Jess Evans
I'm still waiting on defect 2430 wrt drools.  I haven't had the opportunity
yet to pull down the gae codebase and attempt to divine the root cause.
Star the defect if it's important to you.

On Nov 30, 2009 2:16 PM, "niraj"  wrote:

Based on query on this forum on Drools seems like DROOLS does not work
on AppEngine.

Is there any other Rule Engine that works on AppEngine

--

You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: load-on-startup not working for a generic servlet

2009-11-30 Thread Tahir Akram
Thanks Don :) it works as you suggest.

On Dec 1, 1:51 am, Don Schwarz  wrote:
> You want to override init(), not service().
>
> On Mon, Nov 30, 2009 at 2:49 PM, Tahir Akram  wrote:
> > I want to initialize a generic servlet on load-on-startup = 1. I read
> > on GAE docs that this feature is supported but happen only when first
> > request comes, not prior to it. But its not working. I dont know
> > whether on local and production it has same behavior.
>
> > Will anyone please guide me if I can do that?
>
> > My Generic servlet code:
>
> > public class StartupServlet extends GenericServlet {
> >        public void service(ServletRequest arg0, ServletResponse arg1)
> >                        throws ServletException, IOException {
> >                 String serverInfo = getServletContext().getServerInfo();
> >         if (serverInfo.contains("Development")) {
> >                 FFConstants.DEV_MODE = true;
> >         }else {
> >                 FFConstants.DEV_MODE = false;
> >         }
> >        }
> > }
>
> > Web.xml enteries
>
> >  
> >    StartupServlet
> >    com.servlet.StartupServlet
> >    1
> >  
>
> >  
> >    StartupServlet
> >    /Startup
> >  
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] load-on-startup not working for a generic servlet

2009-11-30 Thread Don Schwarz
You want to override init(), not service().

On Mon, Nov 30, 2009 at 2:49 PM, Tahir Akram  wrote:

> I want to initialize a generic servlet on load-on-startup = 1. I read
> on GAE docs that this feature is supported but happen only when first
> request comes, not prior to it. But its not working. I dont know
> whether on local and production it has same behavior.
>
> Will anyone please guide me if I can do that?
>
> My Generic servlet code:
>
> public class StartupServlet extends GenericServlet {
>public void service(ServletRequest arg0, ServletResponse arg1)
>throws ServletException, IOException {
> String serverInfo = getServletContext().getServerInfo();
> if (serverInfo.contains("Development")) {
> FFConstants.DEV_MODE = true;
> }else {
> FFConstants.DEV_MODE = false;
> }
>}
> }
>
>
> Web.xml enteries
>
>  
>StartupServlet
>com.servlet.StartupServlet
>1
>  
>
>  
>StartupServlet
>/Startup
>  
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] First Request High CPU

2009-11-30 Thread Jeffrey Goetsch
The billing option sounds like a great solution allow people to keep an
instance up and running.  I would pay $5 a month to keep servers up, but I
would suggest pricing the feature as a free feature if you spend $5 a month.

As for the cron job, I was doing work every 5 minutes, but I found that was
using about 10% of my free CPU time.  Once I moved the cron down to a
minute, I don't even use 0.1%.  This seems like it is better performance for
your servers, but I understand needing to turn off non active sites.

-Jeff

On Mon, Nov 30, 2009 at 11:38 AM, Ikai L (Google)  wrote:

> Yes. This is an issue we are working on. Basically, what happens is that
> instances of your application are elastic and loaded up upon demand. As your
> application grows, we will grow with you, but one of the consequences of
> this is that if your application is not receiving many requests, we may
> cycle you out to allocate more instances for an application with higher
> resource requirements.
>
> We discourage running cron jobs to reduce startup time because ultimately,
> this will result in more aggressive cycling for all of our users. We're
> looking at several techniques to speed up Java application startup time.
> It's also been suggested that we should look at a billing enabled option for
> keeping a certain number of instances warm at all times.
>
> On Sun, Nov 29, 2009 at 11:22 PM, Jeffrey Goetsch wrote:
>
>> I have noticed that the first request to a server instance has really high
>> CPU usage (7000+ milliseconds).  After the server is up, the same request
>> takes only 20 milliseconds.  I am not using Spring or any other framework.
>>  It appears that the time is used during the first execute call on a
>> Datastore query.
>>
>> Is this a normal behavior?
>>
>> I have a cron job that I was running every 2 minutes, but that alone was
>> using 15% of my free quota.  I have moved the cron to every minute, and I'm
>> seeing huge improvement on performance and quota.  The cron used to take
>> 7000+ ms  and now I am getting 20ms.  Does this mean you should make sure
>> you have at least on cron running every minute?
>>
>> Thanks,
>> Jeffrey
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] load-on-startup not working for a generic servlet

2009-11-30 Thread Tahir Akram
I want to initialize a generic servlet on load-on-startup = 1. I read
on GAE docs that this feature is supported but happen only when first
request comes, not prior to it. But its not working. I dont know
whether on local and production it has same behavior.

Will anyone please guide me if I can do that?

My Generic servlet code:

public class StartupServlet extends GenericServlet {
public void service(ServletRequest arg0, ServletResponse arg1)
throws ServletException, IOException {
 String serverInfo = getServletContext().getServerInfo();
 if (serverInfo.contains("Development")) {
 FFConstants.DEV_MODE = true;
 }else {
 FFConstants.DEV_MODE = false;
 }
}
}


Web.xml enteries

  
StartupServlet
com.servlet.StartupServlet
1
  

  
StartupServlet
/Startup
  

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java]CPU quota problem

2009-11-30 Thread Ikai L (Google)
Calvin, only one instance of PersistenceManagerFactory will exist per
application instance. The expensive part of application loading isn't the
PersistenceManagerFactory. It's the virtual machine instance. If your
application isn't receiving requests, we will cycle it out. The first
request that comes in will cause us to reinstantiate a virtual machine.
We're looking at different ways of addressing this by speeding up startup
time.

On Sat, Nov 28, 2009 at 8:03 PM, Calvin  wrote:

> Hi, everyone
>
> I just wrote simple app using java. As the guide said to instance a
> PersistenceManagerFactory takes times, I use a very single instance in
> my app. But it seems the app will stop if no requests in few minutes.
> When another request comes the app will restart again and re-instance
> PersistenceManagerFactory. It not just take a few seconds to wait app
> response, the worse is it report critical warning as "this request
> used a high amount of CPU and may soon exceed its quota".
>
> Did anyone know how to fix this problem?
>
> thanks a lot!
>
> - Calvin Zhao
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Any workaround to send email from dev server?

2009-11-30 Thread Ikai L (Google)
You can use SMTP to send the emails:

http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274

To do this, though, you'd need to download and load the JavaMail classes and
change your code to use an SMTP server. You might be better off creating a
development version of the application on appspot.com and sending mail from
there if all you need to do is verify formats in clients.

On Fri, Nov 27, 2009 at 11:19 AM, James Cooper wrote:

> Hi,
>
> I understand that the dev server logs all outbound emails and does not
> actually send them.
>
> Is there a way to workaround this so the dev server actually sends the
> email?  I want to verify that the generated HTML content looks correct
> in various email clients before deploying to production.
>
> My only current way of doing this is from a JUnit test, but it would
> be ideal to test it from the web app as well.
>
> Any ideas?
>
> thanks
>
> -- James
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Can't send mail with attachment using JavaMail API

2009-11-30 Thread Ikai L (Google)
Interesting, so this did not work?

attachment.setDataHandler(new DataHandler(mimePartDataSource));
attachment.setFileName("ticker.png");

I'll need to do some research into the Java mail spec to see if we are
matching it. Could be a bug if we aren't.

On Thu, Nov 26, 2009 at 12:48 PM, Don  wrote:

> Thanks Ikai.
>
> It did NOT work before because I set the dataHandler before I set the
> FileName.
>
> Just have to set the FileName and then set the DataHandler.
> attachment.setFileName("ticker.png");
> attachment.setDataHandler(new DataHandler(mimePartDataSource));
>
> Is this behaviour intentional?
>
> Many thanks
> Don
>
>
> On Nov 24, 10:15 am, "Ikai L (Google)"  wrote:
> > Don,
> >
> > First, a word of caution: you'll probably want to contact the creators of
> > the site you are trying to fetch the image from if you haven't done so
> > already. Their terms of service prohibit the use of automatic downloading
> of
> > images:http://support.stockcharts.com/forums/31090/entries/20485
> >
> > To fetch an image from a URL and send it via the Mail Service, this what
> you
> > need to do:
> >
> > 1. Fetch your URL
> > 2. Find the content type
> > 3. Read the stream into a byte[]
> > 4. Create a message and a data handler
> > 5. Pass the byte[] into the data source, then into the data handler
> >
> > Example code:http://pastie.org/712159
> >
> > import javax.servlet.http.HttpServlet;
> > import javax.servlet.http.HttpServletRequest;
> > import javax.servlet.http.HttpServletResponse;
> > import javax.servlet.ServletException;
> > import javax.mail.*;
> > import javax.mail.util.ByteArrayDataSource;
> > import javax.mail.internet.MimeMultipart;
> > import javax.mail.internet.MimeBodyPart;
> > import javax.mail.internet.MimeMessage;
> > import javax.mail.internet.InternetAddress;
> > import javax.activation.DataHandler;
> > import java.io.IOException;
> > import java.io.InputStream;
> > import java.io.ByteArrayOutputStream;
> > import java.net.URL;
> > import java.util.Properties;
> >
> > public class GetStockServlet extends HttpServlet {
> > private static final String SENDER = "your.sen...@domain.com";
> > private static final String RECIPIENT = "your.recipi...@domain.com";
> >
> > protected void doGet(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException {
> >
> > URL url = new URL("http://yoururl.com/image.png";);
> > InputStream in = url.openStream();
> >
> > byte[] rawData;
> > int len;
> > byte[] buffer = new byte[8192];
> > ByteArrayOutputStream output = new ByteArrayOutputStream();
> >
> > try {
> > while ((len = in.read(buffer, 0, buffer.length)) != -1)
> > output.write(buffer, 0, len);
> > rawData = output.toByteArray();
> > } finally {
> > output.close();
> > }
> >
> > response.setContentType("image/png");
> > response.getOutputStream().write(rawData);
> > response.getOutputStream().flush();
> >
> > String htmlBody = "Here is the quote you wanted";
> >
> > Properties props = new Properties();
> > Session session = Session.getDefaultInstance(props, null);
> >
> > Message message = new MimeMessage(session);
> >
> > Multipart mp = new MimeMultipart();
> >
> > MimeBodyPart htmlPart = new MimeBodyPart();
> >
> > try {
> > message.setFrom(new InternetAddress(SENDER, "Stock
> Service"));
> > message.addRecipient(Message.RecipientType.TO, new
> > InternetAddress(RECIPIENT));
> > message.setSubject("Stock Quote: " + symbol);
> >
> > htmlPart.setContent(htmlBody, "text/html");
> > mp.addBodyPart(htmlPart);
> >
> > ByteArrayDataSource dataSource = new
> > ByteArrayDataSource(rawData, "image/png");
> >
> > MimeBodyPart attachment = new MimeBodyPart();
> > attachment.setFileName(symbol + ".png");
> > attachment.setDataHandler(new
> > DataHandler(dataSource));
> > mp.addBodyPart(attachment);
> >
> > message.setContent(mp);
> > Transport.send(message);
> > } catch (MessagingException e) {
> > throw new IOException(e);
> > }
> >
> > }
> >
> > }
> > On Sun, Nov 22, 2009 at 9:04 AM, Don  wrote:
> > > Hi Ikai,
> >
> > > I tried your example code, but I cannot attach an image on the email
> > > that I send.
> > > There is no conversion error either.
> >
> > > Here is snippets of the code, please help..
> >
> > > //Retrieving image:
> > > URL url = new URL("http://stockcharts.com/c-sc/sc?s="; + ticker +
> > > "&p=DAILY&b=5&g=0&i=0&r=3528");
> > > //Sending mail
> > > SendMail sendmail = new SendMail(customerEmail, url.openStream());
> >
> > > // send mail function
> > > public SendMail(String recipient, InputStream imagestream) {
> > > msg.setFrom( new InternetAddress("lydonchan...@gmail.com", "dons
> > > s

Re: [appengine-java] Change of Attribute in an object wasn't saved in datastore sometimes.

2009-11-30 Thread Ikai L (Google)
Ray,

My suspicion is that usernames is not being fetched when you retrieve your
object. Collections are lazy loaded, though usernames must be getting
instantiated somewhere, otherwise you'd be getting a NullPointerException.
Can you try this version of addUsername and let me know what happens?

public void addUsername(String username) {
this.usernames.size(); // Should not be required, but this will
force this collection to load if the PersistenceManager is still open
if(!this.usernames.contains(
username)) {
this.usernames.add(username);
}
}


We are changing the behavior of collections, blobs, text fields and other
lazily loaded objects in 1.2.8 so that they are always eager loaded.

On Thu, Nov 26, 2009 at 8:00 AM, Ray  wrote:

> I am developing my App with GWT + GAE. today i met a strange thing.
>
> I am using Eclipse Galileo with GWT 1.7 and Google plugin 1.26.
> i have a class A, which is defined like the following one;
>
> public Class A {
> protected Long id;
> protected ArrayList usernames;
>
> public ArrayList getUsernames()
> return usernames;
> }
>
> public void setUsernames(ArrayList usernames) {
> this.usernames = usernames;
> }
>
> public void addUsername(String username) {
> if(!this.usernames.contains(username)) {
> this.usernames.add(username);
> }
> }
> }
>
> on the Server side i have method called share.
>
> public void share(A a, String username) {
>  PersistenceManager pm = PMF.get().getPersistenceManager();
> try {
> A a1 = pm.getObjectById(A.class, a.getId());
> a1.addUsername(username);
> System.out.println(tag.getUsernames());
> } catch (Exception e) {
> LOG.logp(Level.FINE, "WorkitemServiceImpl", "save",
> e.toString());
> } finally {
> pm.close();
> }
> }
>
> public void share(A a, String username) {
>  PersistenceManager pm = PMF.get().getPersistenceManager();
> try {
> A a1 = pm.getObjectById(A.class, a.getId());
> a1.getUsernames().add(username);
> System.out.println(tag.getUsernames());
> } catch (Exception e) {
> LOG.logp(Level.FINE, "WorkitemServiceImpl", "save",
> e.toString());
> } finally {
> pm.close();
> }
> }
>
> when i call the method share on the client side, like share(a, "test"); the
> first one prints "[]", the second one prints "[test]". can anybody explain
> why this happens?
>
> thanks in advance!
>
> ray
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: XMPP Message not being received

2009-11-30 Thread Ravi Sharma
Hi,
Thanks for looking into it.I am sending the small code which i am using. I
am using smack library.
This behaviour is not consistant. Once i was able to send messges at every 5
seconds(and sent around 4000) and once i had to make it 15 seconds for each
message.


i use the following class as
GaeClientMessanger m = new GaeClientMessanger();
m.initConnection();
for(some loop condiiton)
{
..
m.sendToGae(message);
}
m.disconnect();




public class GaeClientMessanger{
private ConnectionConfiguration config;
private XMPPConnection connection;
private static LocalDefaultMessageController messgageHandler;
protected Logger logger = Logger.getLogger(this.getClass());

public void initConnection() throws XMPPException
{
config = new ConnectionConfiguration("talk.google.com",
5222,
"gmail.com");

connection = new XMPPConnection(config);
connection.connect();
connection.login("gmailu...@gmail.com", "password");

Roster roster = connection.getRoster();



roster.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
Collection entries = roster.getEntries();


}
public void sendToGae(String message) throws XMPPException, MessageException
{



Chat chat = connection.getChatManager().createChat("
ap...@appspot.com", messgageHandler);
//messageHandler will receive the message back from server, if i receive the
same mesage back that means my message did not reach server.If i receive
success, that means my message reached

chat.sendMessage(messageXml);


}
public void disconnect() throws XMPPException
{
connection.disconnect();

}
}
On Mon, Nov 30, 2009 at 8:00 PM, Ikai L (Google)  wrote:

> Ravi,
>
> Do you have any sample code? I'd like to take a look at this.
>
>
> On Fri, Nov 27, 2009 at 2:43 AM, Ravi  wrote:
>
>> Hi Googlers,
>> Did you get a chance to look at my problem
>> Quota page says 3000 calls/min can be handled by App Engine.
>> But when I send a message every 5 second from a client(outside app
>> engine), it stop responding after 10 messages.
>> I increased the time one second each time and now for 10 seconds
>> difference between each call is working fine. That is really really a
>> big problem. I need to make almost 2 calls now and then may be
>> more, so to do that I might need
>> 2/6 =  minutes(6 calls per minutes) or 55 hours or two and
>> half day. Am I suppose to keep running my program for 2 and half days
>> to make those 2 calls.
>> I really need some help here.
>>
>>
>> Thanks in Advance
>> Ravi.
>>
>>
>>
>>
>>
>>
>> On Nov 25, 9:50 pm, Ravi Sharma  wrote:
>> > Hi Googlers,
>> > Can i have some reply on my problem, its really a stopper for our
>> > application.
>> >
>> > *Now one bigger problem we are seeing.*
>> > I send 25(testing with 25 just a number) XMPP message to GAE Application
>> > from my desktop XMPP client
>> > First 10 messages goes and delivered to GAE Application and GAE
>> application
>> > reply it by saying Mesage delivered.
>> >
>> > but 11th and onwards message never reach to GAE application(i can see it
>> in
>> > my logs, that my XMPP controller never received the messgae), and but my
>> > client do get a reply from GAE(my application i...@appspot.com) which
>> is same
>> > message as what i sent. This is really weird and big problem. Why my
>> > messages are being returned back to me?. Usally in chat client it
>> happens
>> > when someone is offline. So does it mean that my GAE chat bot has gone
>> > offline? or too busy to respond? or any other problem?
>> >
>> > And i ran this test now almost 7-8 times and everytime only first 10
>> > messages are getting delivered.
>> >
>> > Then i thought may be its the number of request per seconds, so i
>> started
>> > sending one message per 5 seconds but still no success.Still only 10
>> > messages reaching GAE.
>> >
>> > Can any one from google check this problem and give some guidence what
>> is
>> > wrong here
>> >
>> > Thanks in advance,
>> > Ravi.
>> >
>> >
>> >
>> > On Wed, Nov 25, 2009 at 9:33 AM, Ravi Sharma 
>> wrote:
>> > > Hi,
>> > > I am trying to write a XMPP Client. When i send a mesage from Client
>> to GAE
>> > > application, it always reach the server and then server reply back.
>> When i
>> > > ran the client first time it worked for 3-4 times. but then now i am
>> not
>> > > receiving any message on client side. I checked the server logs and it
>> says
>> > > that Message sent succesfully.
>> >
>> > > I am using my gmail id on client side to connect to
>> talk.google.comserver.And i logged out my self from all google client like
>> gmail, gtalk
>> > > etc, as i was thinking may be message is being sent to another client.
>> > > Intrestingky when i am logged in to Gtalk at the time when i am
>> running my
>> > > client, Gtalk recive the response from server. I am using smack
>> libraries
>> > > forXMPP client.
>> >
>> 

Re: [appengine-java] storing Set in datastore

2009-11-30 Thread Ikai L (Google)
Collections are lazy loaded. You will need to access the collection before
adding items to it. You can do this by doing something like this:

public void addToSet(Key what) {
   if(mySet != null) {
   mySet.size(); // This forces the set to be loaded
   mySet.add(what);
 } else {
   mySet = new HashSet();
 }
}

Let me know if that works for you.

We're changing the behavior of the default fetch groups so that everything
except child objects are eager loaded (blobs, text, collections).

On Mon, Nov 30, 2009 at 12:12 PM, Ikai Lan  wrote:

> Collections are lazy loaded. You will need to access the collection before
> adding items to it. You can do this by doing something like this:
>
>
> public void addToSet(Key what) {
>if(mySet != null) {
>
>mySet.add(what);
>
> }
>
> On Thu, Nov 26, 2009 at 4:04 AM, Benedykt wrote:
>
>> Hello,
>>
>> In my application I have a class which has a field of type
>> Set. I want to store objects
>> of that class in datastore, but I can't make it work.
>>
>> At first my class looked like this:
>> @PersistenceCapable(identityType=IdentityType.APPLICATION)
>> public class Kuku {
>>@PrimaryKey
>>@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
>>protected Key id;
>>public Key getId() {
>>return id;
>>}
>>@Persistent
>>protected Set mySet = new HashSet();
>>public int getMySetSize() {
>>return mySet.size();
>>}
>>public void addToSet(Key what) {
>>mySet.add(what);
>>}
>> }
>>
>> In some JSP page I tried to create a new object of that class, then
>> store it in a datastore, then fetch it back from datastore and add
>> some elements to its mySet, the fetch it again and see how many
>> elements there are in mySet:
>> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
>> <%@ page import="psobolewski.Kuku" %>
>> <%@ page import="psobolewski.PMF" %>
>> <%@ page import="javax.jdo.PersistenceManager" %>
>> <%@ page import="com.google.appengine.api.datastore.Key" %>
>> 
>> 
>> <%
>> Kuku kuku;
>> javax.jdo.PersistenceManager pm;
>> Key kukuId;
>> String result;
>> kuku = new Kuku();
>> pm = PMF.get().getPersistenceManager();
>> pm.makePersistent(kuku);
>> kukuId = kuku.getId();
>> pm.close();
>> %>
>> <%
>> pm = PMF.get().getPersistenceManager();
>> kuku = pm.getObjectById(Kuku.class, kukuId);
>> kuku.addToSet(kukuId.getChild(kukuId.getKind(), 0));
>> kuku.addToSet(kukuId.getChild(kukuId.getKind(), 1));
>> kuku.addToSet(kukuId.getChild(kukuId.getKind(), 2));
>> pm.close();
>> pm = PMF.get().getPersistenceManager();
>> kuku = pm.getObjectById(Kuku.class, kukuId);
>> result = "size: " + kuku.getMySetSize();
>> pm.close();
>> %>
>> <%= result %>
>> 
>> 
>>
>> However, when I try to run it, I get java.lang.NullPointerException in
>> this place:
>> public void addToSet(Key what) {
>>mySet.add(what);
>> }
>>
>> Then I decided to change my class this way:
>> @Persistent(defaultFetchGroup = "true")
>> protected Set mySet = new HashSet();
>>
>> However, this didn't help - I still get this NullPointerException. So
>> I decided to change my class this way:
>> @Persistent(defaultFetchGroup = "true", serialized = "true")
>> protected Set mySet = new HashSet();
>>
>> Now I don't get NullPointerException any more, but the reported size
>> of mySet is zero, as if I haven't added any elements to it.
>>
>> What do I do wrong? How can I keep such field in a datastore?
>>
>>
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>>
>
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: XMPP Message not being received

2009-11-30 Thread Ikai L (Google)
Ravi,

Do you have any sample code? I'd like to take a look at this.

On Fri, Nov 27, 2009 at 2:43 AM, Ravi  wrote:

> Hi Googlers,
> Did you get a chance to look at my problem
> Quota page says 3000 calls/min can be handled by App Engine.
> But when I send a message every 5 second from a client(outside app
> engine), it stop responding after 10 messages.
> I increased the time one second each time and now for 10 seconds
> difference between each call is working fine. That is really really a
> big problem. I need to make almost 2 calls now and then may be
> more, so to do that I might need
> 2/6 =  minutes(6 calls per minutes) or 55 hours or two and
> half day. Am I suppose to keep running my program for 2 and half days
> to make those 2 calls.
> I really need some help here.
>
>
> Thanks in Advance
> Ravi.
>
>
>
>
>
>
> On Nov 25, 9:50 pm, Ravi Sharma  wrote:
> > Hi Googlers,
> > Can i have some reply on my problem, its really a stopper for our
> > application.
> >
> > *Now one bigger problem we are seeing.*
> > I send 25(testing with 25 just a number) XMPP message to GAE Application
> > from my desktop XMPP client
> > First 10 messages goes and delivered to GAE Application and GAE
> application
> > reply it by saying Mesage delivered.
> >
> > but 11th and onwards message never reach to GAE application(i can see it
> in
> > my logs, that my XMPP controller never received the messgae), and but my
> > client do get a reply from GAE(my application i...@appspot.com) which is
> same
> > message as what i sent. This is really weird and big problem. Why my
> > messages are being returned back to me?. Usally in chat client it happens
> > when someone is offline. So does it mean that my GAE chat bot has gone
> > offline? or too busy to respond? or any other problem?
> >
> > And i ran this test now almost 7-8 times and everytime only first 10
> > messages are getting delivered.
> >
> > Then i thought may be its the number of request per seconds, so i started
> > sending one message per 5 seconds but still no success.Still only 10
> > messages reaching GAE.
> >
> > Can any one from google check this problem and give some guidence what is
> > wrong here
> >
> > Thanks in advance,
> > Ravi.
> >
> >
> >
> > On Wed, Nov 25, 2009 at 9:33 AM, Ravi Sharma 
> wrote:
> > > Hi,
> > > I am trying to write a XMPP Client. When i send a mesage from Client to
> GAE
> > > application, it always reach the server and then server reply back.
> When i
> > > ran the client first time it worked for 3-4 times. but then now i am
> not
> > > receiving any message on client side. I checked the server logs and it
> says
> > > that Message sent succesfully.
> >
> > > I am using my gmail id on client side to connect to
> talk.google.comserver.And i logged out my self from all google client like
> gmail, gtalk
> > > etc, as i was thinking may be message is being sent to another client.
> > > Intrestingky when i am logged in to Gtalk at the time when i am running
> my
> > > client, Gtalk recive the response from server. I am using smack
> libraries
> > > forXMPP client.
> >
> > > 1) Can you please suggest what can be a problem here.
> > > 2) Is XMPP communication is 100% delivery system. Is there chance that
> my
> > > message will get lost once on server or client i see that message has
> been
> > > sent.
> >
> > > Thanks,
> > > Ravi.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Why is it called "Google App Engine for Java" ?

2009-11-30 Thread Nicolas Melendez
if we are going to collaborate each other, we need the right names because
communication is critical.

On Mon, Nov 30, 2009 at 4:37 PM, Jess Evans  wrote:

> There are innovators who "attempt" to advance the field and be the first.
> They appeal to the desperate and the early adopters with nothing to loose
> and much to gain.
>
> There are guardians with deep experience who strive to ensure reliability
> and predictability.  They appeal to those upon whom many are dependent;
> those with everything to lose and little to gain.
>
> Both camps are invaluable.
>
> Incorrectly categorizing a technology, or failing to understand who you're
> employed to represent, are personal problems.
>
> On Nov 30, 2009 12:22 PM, "Jeff Schnitzer"  wrote:
>
> I, for one, am sick and tired of Sun's domineering, suffocating
> stranglehold on what is and isn't Java.  GAE is a breath of fresh air.
>
> JavaME and JavaEE also impose a variety of limitations on Java.
> What's the difference between those and GAE?  The difference is that
> Sun got a committee of big company representatives with their own
> vested interests in a closed room and argued about how "the official
> specs" should work for years... and ultimately produced a bunch of
> crap that is barely useful to anyone.  Just *try* out Websphere
> sometime, I dare you.
>
> For the first time ever, someone has produced a shared application
> service model for Java that's even easier than PHP.  This could never
> have come out of the JCP.
>
> If this is "destroying java", then GOOD RIDDANCE!
>
> Jeff
>
> -- You received this message because you are subscribed to the Google
> Groups "Google App Engine fo...
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] AppEngine needs an AppStore

2009-11-30 Thread Ikai L (Google)
David,

We have a solutions marketplace for Google Apps:
http://www.google.com/enterprise/marketplace/

On Mon, Nov 30, 2009 at 11:43 AM, David Chandler wrote:

> as in iPhone AppStore, not to be confused with DataStore
>
> AppEngine is fantastic. Even though AppEngine for Java is still a
> preview release, are there any thoughts of giving it an AppStore so I
> could easily make my AppEngine applications available for others to
> purchase? I'm thinking especially of Google Apps users, as
> authentication and custom domain hosting are already in place.
>
> Further elaboration:
> http://turbomanage.wordpress.com/2009/11/30/appengine-needs-an-appstore/
>
> Regards,
> David Chandler
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] AppEngine needs an AppStore

2009-11-30 Thread Nicolas Melendez
Thats a very good idea.
NM

On Mon, Nov 30, 2009 at 4:43 PM, David Chandler wrote:

> as in iPhone AppStore, not to be confused with DataStore
>
> AppEngine is fantastic. Even though AppEngine for Java is still a
> preview release, are there any thoughts of giving it an AppStore so I
> could easily make my AppEngine applications available for others to
> purchase? I'm thinking especially of Google Apps users, as
> authentication and custom domain hosting are already in place.
>
> Further elaboration:
> http://turbomanage.wordpress.com/2009/11/30/appengine-needs-an-appstore/
>
> Regards,
> David Chandler
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Changing Log Format

2009-11-30 Thread Ikai L (Google)
Jeffrey, you'll want to add all feature requests here:
http://code.google.com/p/googleappengine/issues/list?can=2&q=log+format

On Mon, Nov 30, 2009 at 10:21 AM, Jeffrey Goetsch wrote:

> I know that it is not possible to change the log format currently, but I
> wanted to make a request for this feature.
>
> Currently the default logging prints the class and method that makes the
> call to the logging API.  For me this always the same method, because I use
> a utility method that adds the Login Name of the user making the request.
>  Also the Logger Name is not anywhere in the Log message, which describes
> where the real log came from.
>
> Thanks,
> Jeffrey
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] AppEngine needs an AppStore

2009-11-30 Thread David Chandler
as in iPhone AppStore, not to be confused with DataStore

AppEngine is fantastic. Even though AppEngine for Java is still a
preview release, are there any thoughts of giving it an AppStore so I
could easily make my AppEngine applications available for others to
purchase? I'm thinking especially of Google Apps users, as
authentication and custom domain hosting are already in place.

Further elaboration:
http://turbomanage.wordpress.com/2009/11/30/appengine-needs-an-appstore/

Regards,
David Chandler

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] First Request High CPU

2009-11-30 Thread Ikai L (Google)
Yes. This is an issue we are working on. Basically, what happens is that
instances of your application are elastic and loaded up upon demand. As your
application grows, we will grow with you, but one of the consequences of
this is that if your application is not receiving many requests, we may
cycle you out to allocate more instances for an application with higher
resource requirements.

We discourage running cron jobs to reduce startup time because ultimately,
this will result in more aggressive cycling for all of our users. We're
looking at several techniques to speed up Java application startup time.
It's also been suggested that we should look at a billing enabled option for
keeping a certain number of instances warm at all times.

On Sun, Nov 29, 2009 at 11:22 PM, Jeffrey Goetsch wrote:

> I have noticed that the first request to a server instance has really high
> CPU usage (7000+ milliseconds).  After the server is up, the same request
> takes only 20 milliseconds.  I am not using Spring or any other framework.
>  It appears that the time is used during the first execute call on a
> Datastore query.
>
> Is this a normal behavior?
>
> I have a cron job that I was running every 2 minutes, but that alone was
> using 15% of my free quota.  I have moved the cron to every minute, and I'm
> seeing huge improvement on performance and quota.  The cron used to take
> 7000+ ms  and now I am getting 20ms.  Does this mean you should make sure
> you have at least on cron running every minute?
>
> Thanks,
> Jeffrey
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Why is it called "Google App Engine for Java" ?

2009-11-30 Thread Jess Evans
There are innovators who "attempt" to advance the field and be the first.
They appeal to the desperate and the early adopters with nothing to loose
and much to gain.

There are guardians with deep experience who strive to ensure reliability
and predictability.  They appeal to those upon whom many are dependent;
those with everything to lose and little to gain.

Both camps are invaluable.

Incorrectly categorizing a technology, or failing to understand who you're
employed to represent, are personal problems.

On Nov 30, 2009 12:22 PM, "Jeff Schnitzer"  wrote:

I, for one, am sick and tired of Sun's domineering, suffocating
stranglehold on what is and isn't Java.  GAE is a breath of fresh air.

JavaME and JavaEE also impose a variety of limitations on Java.
What's the difference between those and GAE?  The difference is that
Sun got a committee of big company representatives with their own
vested interests in a closed room and argued about how "the official
specs" should work for years... and ultimately produced a bunch of
crap that is barely useful to anyone.  Just *try* out Websphere
sometime, I dare you.

For the first time ever, someone has produced a shared application
service model for Java that's even easier than PHP.  This could never
have come out of the JCP.

If this is "destroying java", then GOOD RIDDANCE!

Jeff

-- You received this message because you are subscribed to the Google Groups
"Google App Engine fo...

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Any rules product that works on AppEngine?

2009-11-30 Thread niraj
Based on query on this forum on Drools seems like DROOLS does not work
on AppEngine.

Is there any other Rule Engine that works on AppEngine

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] google app engine exception affected app's performance

2009-11-30 Thread Don Schwarz
http://xkcd.com/552/

The FinalizableReferenceQueue exception is indeed harmless, but happens
during the first request on a particular JVM.  These requests are slow
because they need to perform class loading, hotspot compilation, etc.  We
are working on ways of better reporting and speeding up these requests, so
stay tuned for some announcements very shortly.

On Mon, Nov 30, 2009 at 11:46 AM, Jeffrey Goetsch wrote:

> I am seeing the same error.  I believe this happens when appengine shuts
> down your server and then restarts the server.  I have read the exception is
> harmless, but the slow start seems to indicate different.  My startup time
> takes about 8 seconds.
>
> I have created cron, that runs every minute.  This seems to prevent
> appengine from shutting down my server very often.  I probably still have
> the appengine shut down my server about 20+ times a day, but that is better
> than every request.  I still have some delays on the first request after a
> cron restarts, but it about 3 seconds.
>
> I have also thread talking about these issues.
>
> --Jeffrey
>
>
>
> On Sat, Nov 28, 2009 at 9:00 AM, Donny  wrote:
>
>> I use JPA in my servlet in my app, but some times when I query data
>> google app engine will report some exception(following is my log from
>> app engine's admin log. ResultServlet is my servlet), the exception is
>> about:
>>
>> "com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
>> 
>> INFO: Failed to start reference finalizer thread. Reference cleanup
>> will only occur when new references are created."
>>
>> this exception was discussed in this group and i found no one gave the
>> solution, every one said it
>> is not affect the performance of application. but from my log i found
>> it affected my performance.
>>
>> 11-28 08:37AM 44.050 survey.ResultServlet doGet: begin query data
>> I 11-28 08:37AM 44.703
>>
>> com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
>> $SystemLoader loadFinalizer: Not allowed to access system class loader
>> I 11-28 08:37AM 44.718
>> com.google.appengine.repackaged.com.google.common.base.internal.Finalizer
>> getInheritableThreadLocalsField: Couldn't access
>> Thread.inheritableThreadLoc
>> I 11-28 08:37AM 44.721
>>
>> com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
>> : Failed to start reference finalizer thread. Reference
>> cleanup...
>> I 11-28 08:37AM 45.242 survey.ResultServlet doGet: query data used
>> time :1188
>> I 11-28 08:37AM 45.617 survey.ResultServlet doGet: render page used
>> time : 375
>>
>> some times this exception will disappear, every thing go well, here is
>> the log:
>>
>> 11-28 08:30AM 33.170 survey.ResultServlet doGet: begin query data
>> I 11-28 08:30AM 33.206 survey.ResultServlet doGet: query data used
>> time :36
>> I 11-28 08:30AM 33.212 survey.ResultServlet doGet: render page used
>> time : 6
>>
>> if the exception occurs, my page will be rendered to client very slowly
>> (it will costs >3s), but without the exception page render is less
>> than 1s. And I found this exception occurs after some minute when my
>> application has no incoming request from client. because my
>> application is not in very high concurrency environment, so the
>> problem occurs in 50%  time.
>>
>>
>> my code is like this:
>>
>> public class ResultServlet extends HttpServlet {
>>
>>private static final Logger log = Logger.getLogger
>> (ResultServlet.class.getName());
>>
>>public void doGet(HttpServletRequest req, HttpServletResponse resp)
>> throws IOException, ServletException {
>>
>>List list = null;
>>EntityManager em = EMF.get().createEntityManager();
>>
>>log.info("begin query  data");
>>long start = System.currentTimeMillis();
>>try {
>>
>>list = em.createQuery("select r from Reply as
>> r").getResultList();
>>
>>log.info("query data  used time :" +
>> String.valueOf
>> (System.currentTimeMillis() - start));
>>
>>start = System.currentTimeMillis();
>>
>>code to deal list data.
>>
>>req.getRequestDispatcher("result.jsp").forward(req,
>> resp);
>>log.info("render page used time : " +
>> String.valueOf
>> (System.currentTimeMillis() - start));
>>} finally {
>>em.close();
>>}
>>}
>> }
>>
>>
>> any one can help me?
>>
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>>
>  --
>

Re: [appengine-java] GData Java API known to (not) work on GAE?

2009-11-30 Thread Guillaume Laforge
Ah excellent, I missed that information and had not seen that section
in the knowledge base.
Thanks a lot, Toby!

On Mon, Nov 30, 2009 at 19:54, Toby Reyelts  wrote:
> Gdata works fine in the Java runtime but, but you need to disable its cookie
> handler.
>
> On Mon, Nov 30, 2009 at 1:00 PM, Guillaume Laforge 
> wrote:
>>
>> Hi all,
>>
>> I was wondering whether anyone had succeeded using the GData APIs on
>> their GAE applications?
>> I wanted to access the Picasa Web Albums, using the Java libraries of
>> GData.
>> But it seems it's not possible, as I'm getting some errors (locally, I
>> have not tried deployed in the cloud):
>>
>> ava.security.AccessControlException: access denied
>> (java.net.NetPermission getCookieHandler)
>>        at
>> java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
>>        at
>> java.security.AccessController.checkPermission(AccessController.java:427)
>>        at
>> java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
>>        at
>> com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151)
>>        at java.net.CookieHandler.getDefault(CookieHandler.java:58)
>>        at
>> com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.(GoogleGDataRequest.java:316)
>>        at
>> com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.(GoogleGDataRequest.java:305)
>>        at
>> com.google.gdata.client.http.GoogleGDataRequest.(GoogleGDataRequest.java:408)
>>        at
>> com.google.gdata.client.http.GoogleGDataRequest$Factory.createRequest(GoogleGDataRequest.java:73)
>>        at
>> com.google.gdata.client.http.HttpGDataRequest$Factory.getRequest(HttpGDataRequest.java:162)
>>        at com.google.gdata.client.Service.createRequest(Service.java:697)
>>        at
>> com.google.gdata.client.GoogleService.createRequest(GoogleService.java:525)
>>        at
>> com.google.gdata.client.Service.createFeedRequest(Service.java:1074)
>>        at com.google.gdata.client.Service.getFeed(Service.java:915)
>>        at
>> com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
>>        at com.google.gdata.client.Service.getFeed(Service.java:935)
>>
>>
>> I guess the GData API is not GAE-compliant?
>> Am I correct?
>>
>> --
>> Guillaume Laforge
>> Groovy Project Manager
>> Head of Groovy Development at SpringSource
>> http://www.springsource.com/g2one
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: How to return a file from a servlet

2009-11-30 Thread Vince Bonfanti
I'm not absolutely sure it's required, but I think in practice you should
always specify the content type. Note that you can get most common types via
a lookup based on the file extension:

   String contentType = getServletContext().getMimeType( imagePath );

You can add additional mime types to web.xml and the above code will use
them, too (in addition to the common ones).

Vince

On Mon, Nov 30, 2009 at 12:25 PM, Prashant  wrote:

> thanks a lot guys.
>
>
> is it necessary to use resp.setContentType("image/gif"); even if url end
> with ".gif" ?
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] GData Java API known to (not) work on GAE?

2009-11-30 Thread Toby Reyelts
Gdata works fine in the Java runtime but, but you need to
disableits
cookie handler.

On Mon, Nov 30, 2009 at 1:00 PM, Guillaume Laforge wrote:

> Hi all,
>
> I was wondering whether anyone had succeeded using the GData APIs on
> their GAE applications?
> I wanted to access the Picasa Web Albums, using the Java libraries of
> GData.
> But it seems it's not possible, as I'm getting some errors (locally, I
> have not tried deployed in the cloud):
>
> ava.security.AccessControlException: access denied
> (java.net.NetPermission getCookieHandler)
>at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
>at
> java.security.AccessController.checkPermission(AccessController.java:427)
>at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
>at
> com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151)
>at java.net.CookieHandler.getDefault(CookieHandler.java:58)
>at
> com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.(GoogleGDataRequest.java:316)
>at
> com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.(GoogleGDataRequest.java:305)
>at
> com.google.gdata.client.http.GoogleGDataRequest.(GoogleGDataRequest.java:408)
>at
> com.google.gdata.client.http.GoogleGDataRequest$Factory.createRequest(GoogleGDataRequest.java:73)
>at
> com.google.gdata.client.http.HttpGDataRequest$Factory.getRequest(HttpGDataRequest.java:162)
>at com.google.gdata.client.Service.createRequest(Service.java:697)
>at
> com.google.gdata.client.GoogleService.createRequest(GoogleService.java:525)
>at
> com.google.gdata.client.Service.createFeedRequest(Service.java:1074)
>at com.google.gdata.client.Service.getFeed(Service.java:915)
>at
> com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
>at com.google.gdata.client.Service.getFeed(Service.java:935)
>
>
> I guess the GData API is not GAE-compliant?
> Am I correct?
>
> --
> Guillaume Laforge
> Groovy Project Manager
> Head of Groovy Development at SpringSource
> http://www.springsource.com/g2one
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Unexpected exit when debugging

2009-11-30 Thread marksea
I get this sometimes when exiting the hosted browser when running (not
debugging) as well.  Everything is a fresh install, per the tutorial.
I've saw an old discussion in the GWT group of a similar error, but it
was with the 1.4 Java runtime, and i'm using 1.5.0, the Mac default.

On Nov 30, 1:14 am, marksea  wrote:
> I'm working through the GWT/GAE tutorial with Eclipse and OS X.
> Everything works great until I try to set some breakpoints to debug
> (part of the tutorial).  If I do that I get "The application GWT quit
> unexpectedly.  The problem may have been caused by the libgwt-ll-
> jnilib plug-in."  Has anyone else seen this message under these
> circumstances?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Changing Log Format

2009-11-30 Thread Jeffrey Goetsch
I know that it is not possible to change the log format currently, but I
wanted to make a request for this feature.

Currently the default logging prints the class and method that makes the
call to the logging API.  For me this always the same method, because I use
a utility method that adds the Login Name of the user making the request.
 Also the Logger Name is not anywhere in the Log message, which describes
where the real log came from.

Thanks,
Jeffrey

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] GData Java API known to (not) work on GAE?

2009-11-30 Thread Guillaume Laforge
Hi all,

I was wondering whether anyone had succeeded using the GData APIs on
their GAE applications?
I wanted to access the Picasa Web Albums, using the Java libraries of GData.
But it seems it's not possible, as I'm getting some errors (locally, I
have not tried deployed in the cloud):

ava.security.AccessControlException: access denied
(java.net.NetPermission getCookieHandler)
at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at 
java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at 
com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151)
at java.net.CookieHandler.getDefault(CookieHandler.java:58)
at 
com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.(GoogleGDataRequest.java:316)
at 
com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.(GoogleGDataRequest.java:305)
at 
com.google.gdata.client.http.GoogleGDataRequest.(GoogleGDataRequest.java:408)
at 
com.google.gdata.client.http.GoogleGDataRequest$Factory.createRequest(GoogleGDataRequest.java:73)
at 
com.google.gdata.client.http.HttpGDataRequest$Factory.getRequest(HttpGDataRequest.java:162)
at com.google.gdata.client.Service.createRequest(Service.java:697)
at 
com.google.gdata.client.GoogleService.createRequest(GoogleService.java:525)
at com.google.gdata.client.Service.createFeedRequest(Service.java:1074)
at com.google.gdata.client.Service.getFeed(Service.java:915)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
at com.google.gdata.client.Service.getFeed(Service.java:935)


I guess the GData API is not GAE-compliant?
Am I correct?

-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: scaling/best practices when sesssion is enabled on app engine

2009-11-30 Thread ArtemGr
Session are stored in the Datastore (with "_ah_SESSION" kind).
Every session have a separate Datastore Entity. They should scale as
much as Datastore does.

Last I heard, the session data isn't removed automatically, it is
something your application should do (using cron jobs, for example).
I still can see session Entities from September in Data Viewer.

A few months ago I heard that automatic cleaning is planned.

On 30 ноя, 18:56, rubeey  wrote:
> Hi,
>
> Can any knowledgble gentleman on this forum tell me, how does google
> app engine handle scaling of  sessions,
> when i set "session enabled true " in appeninge web xml.
>
> is there any specific way to code, are there any restrictions on
> session objects?, i basically want to know how the scaling differs
> when session is enabled and when it is not?
>
> becos some of the web frameworks, require session enabled to be true
> to work on appengine,
> besides i want to know the best practices to code when session is
> enabled.
>
> Thank you

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] summary of using JPA with GAE

2009-11-30 Thread Jeff Schnitzer
There doesn't appear to be any API for detaching objects using the JPA
interface.  If you need to serialize entity objects (say, to put them
in memcache), you're stuck with JDO (or one of the alternative
interfaces like Siena, SimpleDS, or the low-level API).

(if there is some undocumented way of doing this, the datanucleus
folks can chime in on it...)

Jeff

On Sun, Nov 29, 2009 at 5:41 PM, asianCoolz  wrote:
> I looking for feedback from anyone that already tried using JPA+spring
> @trans on GAE on any limitation when using the api? can share your
> experiences?
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] google app engine exception affected app's performance

2009-11-30 Thread Jeffrey Goetsch
I am seeing the same error.  I believe this happens when appengine shuts
down your server and then restarts the server.  I have read the exception is
harmless, but the slow start seems to indicate different.  My startup time
takes about 8 seconds.

I have created cron, that runs every minute.  This seems to prevent
appengine from shutting down my server very often.  I probably still have
the appengine shut down my server about 20+ times a day, but that is better
than every request.  I still have some delays on the first request after a
cron restarts, but it about 3 seconds.

I have also thread talking about these issues.

--Jeffrey



On Sat, Nov 28, 2009 at 9:00 AM, Donny  wrote:

> I use JPA in my servlet in my app, but some times when I query data
> google app engine will report some exception(following is my log from
> app engine's admin log. ResultServlet is my servlet), the exception is
> about:
>
> "com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
> 
> INFO: Failed to start reference finalizer thread. Reference cleanup
> will only occur when new references are created."
>
> this exception was discussed in this group and i found no one gave the
> solution, every one said it
> is not affect the performance of application. but from my log i found
> it affected my performance.
>
> 11-28 08:37AM 44.050 survey.ResultServlet doGet: begin query data
> I 11-28 08:37AM 44.703
>
> com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
> $SystemLoader loadFinalizer: Not allowed to access system class loader
> I 11-28 08:37AM 44.718
> com.google.appengine.repackaged.com.google.common.base.internal.Finalizer
> getInheritableThreadLocalsField: Couldn't access
> Thread.inheritableThreadLoc
> I 11-28 08:37AM 44.721
>
> com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
> : Failed to start reference finalizer thread. Reference
> cleanup...
> I 11-28 08:37AM 45.242 survey.ResultServlet doGet: query data used
> time :1188
> I 11-28 08:37AM 45.617 survey.ResultServlet doGet: render page used
> time : 375
>
> some times this exception will disappear, every thing go well, here is
> the log:
>
> 11-28 08:30AM 33.170 survey.ResultServlet doGet: begin query data
> I 11-28 08:30AM 33.206 survey.ResultServlet doGet: query data used
> time :36
> I 11-28 08:30AM 33.212 survey.ResultServlet doGet: render page used
> time : 6
>
> if the exception occurs, my page will be rendered to client very slowly
> (it will costs >3s), but without the exception page render is less
> than 1s. And I found this exception occurs after some minute when my
> application has no incoming request from client. because my
> application is not in very high concurrency environment, so the
> problem occurs in 50%  time.
>
>
> my code is like this:
>
> public class ResultServlet extends HttpServlet {
>
>private static final Logger log = Logger.getLogger
> (ResultServlet.class.getName());
>
>public void doGet(HttpServletRequest req, HttpServletResponse resp)
> throws IOException, ServletException {
>
>List list = null;
>EntityManager em = EMF.get().createEntityManager();
>
>log.info("begin query  data");
>long start = System.currentTimeMillis();
>try {
>
>list = em.createQuery("select r from Reply as
> r").getResultList();
>
>log.info("query data  used time :" + String.valueOf
> (System.currentTimeMillis() - start));
>
>start = System.currentTimeMillis();
>
>code to deal list data.
>
>req.getRequestDispatcher("result.jsp").forward(req,
> resp);
>log.info("render page used time : " +
> String.valueOf
> (System.currentTimeMillis() - start));
>} finally {
>em.close();
>}
>}
> }
>
>
> any one can help me?
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] My indexes are stuck in "BUILDING" state after deploying my app for the first time (i.e. on an empty datastore)

2009-11-30 Thread david ruescas
A similar thing happened to me yesterday. The problem resolved itself
overnight, cant tell you exactly how long it took.

On 11/30/09, Jeffrey Goetsch  wrote:
> I was having about 2 hour index build times.  I think a lot of people were
> launching over the weekend.
>
> --Jeff
>
> On Sun, Nov 29, 2009 at 8:36 PM, Tim Cooper  wrote:
>
>> I've just deployed my AppEngine application for the first time.  It
>> was working perfectly when running in the development environment on
>> my laptop, but doesn't work in its deployed state.  I'm getting "500
>> Server Error", "DatastoreNeedIndexException: no matching index
>> found".   The dashboard says that all my 7 indexes are still in the
>> BUILDING state and have been for about an hour.   The datastore was
>> empty before I did this, and it now has a total size of 34K...(somehow
>> 2 entities managed to get half created).
>>
>> The documentation says to mail this group if it appears that the
>> indexes are stuck.  I haven't been able to get useful information from
>> the group threads from the other people who have reported this
>> problem.
>>
>> The application-id is "edvaltt".
>>
>> I'm unable to continue my work.  Can anyone help?
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] JSTL formatDate requires session to be on?

2009-11-30 Thread david ruescas
A similar thing has happened to me using  for which
I had to enable sessions. I cant remember exactly where, but the stack
trace reveals that somewhere in the fmt implementation there is a call
to get session.

Ive left sessions on for the moment to get this working for me, but if
there is other workaround ill do the formatting myself manually.
There's no point in having session enabled just for this.

On 11/30/09, aschearer  wrote:
> I'm not sure if I'm doing something wrong -- I'm new to JSTL -- but
> when I try to format a date I get an error about session state not
> being enabled. For the record I am trying:
>
>  type="date" />
>
> Which results in the following error:
>
> Session support is not enabled in appengine-web.xml.  To enable
> sessions, put true in that file.
>
> If I enable sessions then the page loads as expected. I've tried
> setting the scope / var attributes on formatDate without any luck.
>
> I'd appreciate any help, thanks.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] No source code is available

2009-11-30 Thread Raphael André Bauer
On Mon, Nov 30, 2009 at 3:56 AM, Bryan Harper  wrote:
> No source code is available for type
> javax.jdo.PersistenceManagerFactory; did you forget to inherit a
> required module?
>
> I'm working on a simple app that I just got to the point of persisting
> data. When I call the PMF I get the error above. Any ideas?

that's an error from the GWT. Check your project layout and do not put
classes that should not be cross compiled to GWT under the *.client.*
package...

solution:
move the class to the *.server.* package and it will solve the prob...

ra
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] My indexes are stuck in "BUILDING" state after deploying my app for the first time (i.e. on an empty datastore)

2009-11-30 Thread Jeffrey Goetsch
I was having about 2 hour index build times.  I think a lot of people were
launching over the weekend.

--Jeff

On Sun, Nov 29, 2009 at 8:36 PM, Tim Cooper  wrote:

> I've just deployed my AppEngine application for the first time.  It
> was working perfectly when running in the development environment on
> my laptop, but doesn't work in its deployed state.  I'm getting "500
> Server Error", "DatastoreNeedIndexException: no matching index
> found".   The dashboard says that all my 7 indexes are still in the
> BUILDING state and have been for about an hour.   The datastore was
> empty before I did this, and it now has a total size of 34K...(somehow
> 2 entities managed to get half created).
>
> The documentation says to mail this group if it appears that the
> indexes are stuck.  I haven't been able to get useful information from
> the group threads from the other people who have reported this
> problem.
>
> The application-id is "edvaltt".
>
> I'm unable to continue my work.  Can anyone help?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] JDO new+update txn commits loosing data...

2009-11-30 Thread Stevko
I'm struggling with a JDO data loss situation.
The code below will NEW a  TextEntry object and hook it into the
object tree just fine.
The copy DTO updates are performed without error/exception thrown but
all updates are lost.
The fields that are being lost are privateComment, byLine,
shortContent, longContent, longContentSize.

I've attached a DN transaction log at the bottom.
The object state is marked as 'dirty' but the ObjectManager does not
'put' the new string values.
According to the logs, for some unknown reason, the DB
DatastorePersistenceHandler commits the "new"  object prior to the
copy of the associated data from the action DTO into the persistent
object.

I've broken this up into two sequential transactions complete with
isolated lookups but the data loss continues.

//-
// abridged code - error checking removed...
//
private final Provider pmp;
private PersistenceManager pm;

@Override
public SaveTextEntryResult execute(SaveTextEntry action,
ExecutionContext context) throws ActionException {

String entryId = action.getEntryId();
SaveTextEntryResult result;
try {
pm = pmp.get();
pm.currentTransaction().begin();

TextEntry entry;

// --
// is this new or update?
if (action.isNewEntry()) {

// lookup the chapterid and verify accountid
TextChapter chapter = 
diaryManager.lookupTextChapterById(action
.getChapterId());
entry = new TextEntry(action.getTimestamp(), chapter,
action.getSourceType(), 
action.getSourceId());

} else {
// look up the textentry id
entry = 
diaryManager.lookupTextEntryById(action.getEntryId());
}
//>>> new object is flushed here <<<--
// copy fields from action to object
entry.setPrivateComment(action.isPrivateComment());
entry.setByLine(action.getByLine());
logger.info("SaveTextEntry() short content =" +
action.getShortContent() );
entry.setShortContent(action.getShortContent());
logger.info("SaveTextEntry() long content =" + 
action.getLongContent
() );
entry.setLongContent(action.getLongContent());

//>>> persist object updates are not flushed here  <<<--
pm.currentTransaction().commit();

result = new SaveTextEntryResult(true, entry.getId() );

} finally {

if (pm.currentTransaction().isActive()) {
logger.severe("SaveTextEntry caught exception");
result = new SaveTextEntryResult(false, "");
pm.currentTransaction().rollback();
}
}

return result;
}
//
// related method below
public TextChapter lookupTextChapterById(String id) {
pm = pmp.get();

TextChapter chapter = pm.getObjectById(TextChapter.class, id);

return (chapter);
}

//
// Persistent object definition (bean methods removed)

@PersistenceCapable(identityType = IdentityType.APPLICATION )
@FetchGroup(  name="children", members={
@Persistent(name="commentEntrys"),
@Persistent(name="chapter")
})
public class TextEntry implements Entry, Serializable,
Comparable {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value =
"true")
private String id;

@Persistent
private Long accountId = new Long(0);

// Parent collection with ArrayList
@Persistent
private TextChapter chapter;

@Persistent
private Long timestamp = new Long(0);

@Persistent
private boolean privateComment = false;

@Persistent
private String byLine = "";

@Persistent(defaultFetchGroup="true")
private SourceType source = SourceType.UNKOWN;

@Persistent
private String sourceId = "";

@Persistent(defaultFetchGroup="true")
private String shortContent = null;

@Persistent(defaultFetchGroup="true")
private String longContentString = null;

@Persistent(defaultFetchGroup="true")
private Long longContentSize = new Long(-1);

@Persistent(mappedBy = "textEntry")
@Order(column="TEXTENTRY_COMMENTENTRY_IDX")
private TreeSet< CommentEntry> commentEntrys = new TreeSet<
CommentEntry>();

public TextEntry(Long timestamp, TextChapter chapter,  SourceType
source,
String sourceId) {
this.timestamp = timestamp;
this.source = source;
this.sourceId = sourceId;

// setup external references
this.chapter = chapter;
this.accountId = chapter.getAccountId();
chapter.add(this);
}

/

[appengine-java] JSTL formatDate requires session to be on?

2009-11-30 Thread aschearer
I'm not sure if I'm doing something wrong -- I'm new to JSTL -- but
when I try to format a date I get an error about session state not
being enabled. For the record I am trying:



Which results in the following error:

Session support is not enabled in appengine-web.xml.  To enable
sessions, put true in that file.

If I enable sessions then the page loads as expected. I've tried
setting the scope / var attributes on formatDate without any luck.

I'd appreciate any help, thanks.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] No source code is available

2009-11-30 Thread Bryan Harper
No source code is available for type
javax.jdo.PersistenceManagerFactory; did you forget to inherit a
required module?

I'm working on a simple app that I just got to the point of persisting
data. When I call the PMF I get the error above. Any ideas?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Servlet loading failing

2009-11-30 Thread Nicky
On deploying a version of my app, the log shows this failure
waterschematics : uncaught application failure
Uncaught exception from servlet
java.lang.NoClassDefFoundError: org/apache/tools/ant/filters/
StringInputStream
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at org.mortbay.jetty.servlet.ServletHolder.getServlet
(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
463)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at gov.ca.bdo.modeling.dsm2.map.server.RoleFilter.doFilter
(RoleFilter.java:33)

However when running the local instance it works and I see the class
in question being loaded as follows
...
[Loaded
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException from
file:/Users/nsandhu/dev/wk-3.5/dsm2-grid-map/war/WEB-INF/lib/gwt-
servlet.jar]
[Loaded java.text.ParseException from /System/Library/Frameworks/
JavaVM.framework/Versions/1.5.0/Classes/classes.jar]
[Loaded org.apache.tools.ant.util.ReaderInputStream from file:/Users/
nsandhu/dev/appengine-java-sdk-1.2.6/lib/shared/jsp/repackaged-
appengine-ant-1.6.5.jar]
[Loaded org.apache.tools.ant.filters.StringInputStream from file:/
Users/nsandhu/dev/appengine-java-sdk-1.2.6/lib/shared/jsp/repackaged-
appengine-ant-1.6.5.jar]
[Loaded com.google.gwt.user.server.rpc.RPCServletUtils from file:/
Users/nsandhu/dev/wk-3.5/dsm2-grid-map/war/WEB-INF/lib/gwt-
servlet.jar]
[Loaded com.google.gwt.user.server.rpc.RPC from file:/Users/nsandhu/
dev/wk-3.5/dsm2-grid-map/war/WEB-INF/lib/gwt-servlet.jar]
[Loaded com.google.gwt.user.server.rpc.UnexpectedException from file:/
Users/nsandhu/dev/wk-3.5/dsm2-grid-map/war/WEB-INF/lib/gwt-
servlet.jar]
[Loaded com.google.gwt.user.client.rpc.SerializationException from
file:/Users/nsandhu/dev/wk-3.5/dsm2-grid-map/war/WEB-INF/lib/gwt-
servlet.jar]
[Loaded com.google.gwt.user.server.rpc.SerializationPolicy from file:/
Users/nsandhu/dev/wk-3.5/dsm2-grid-map/war/WEB-INF/lib/gwt-
servlet.jar]
...

Using the appengine 1.2.6 with eclipse 3.5 on a mac

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] My indexes are stuck in "BUILDING" state after deploying my app for the first time (i.e. on an empty datastore)

2009-11-30 Thread Tim Cooper
I've just deployed my AppEngine application for the first time.  It
was working perfectly when running in the development environment on
my laptop, but doesn't work in its deployed state.  I'm getting "500
Server Error", "DatastoreNeedIndexException: no matching index
found".   The dashboard says that all my 7 indexes are still in the
BUILDING state and have been for about an hour.   The datastore was
empty before I did this, and it now has a total size of 34K...(somehow
2 entities managed to get half created).

The documentation says to mail this group if it appears that the
indexes are stuck.  I haven't been able to get useful information from
the group threads from the other people who have reported this
problem.

The application-id is "edvaltt".

I'm unable to continue my work.  Can anyone help?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] scaling/best practices when sesssion is enabled on app engine

2009-11-30 Thread rubeey
Hi,

Can any knowledgble gentleman on this forum tell me, how does google
app engine handle scaling of  sessions,
when i set "session enabled true " in appeninge web xml.



is there any specific way to code, are there any restrictions on
session objects?, i basically want to know how the scaling differs
when session is enabled and when it is not?

becos some of the web frameworks, require session enabled to be true
to work on appengine,
besides i want to know the best practices to code when session is
enabled.

Thank you

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Transaction Error with No Transactions

2009-11-30 Thread Jeffrey Goetsch
I am getting an exception that I pasted below.  It describes a transaction
error, but I have not programmed any transactions.  On top of that, the
request that I made should not have changed any data.  Has anyone else been
getting errors like this?

Caused by: java.lang.IllegalArgumentException: can't operate on multiple
entity groups in a single transaction.

at 
com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:33)
at 
com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:60)
at 
com.google.appengine.api.datastore.DatastoreServiceImpl$1.run(DatastoreServiceImpl.java:113)
at 
com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:30)
at 
com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServiceImpl.java:99)
at 
com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServiceImpl.java:72)
at 
com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServiceImpl.java:60)
at 
org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.get(RuntimeExceptionWrappingDatastoreService.java:63)
at 
org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePersistenceHandler.java:81)
at 
org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePersistenceHandler.java:91)
at 
org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(DatastorePersistenceHandler.java:487)
at 
org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4576)
at 
org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814)
at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754)
at 
org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2893)
at 
org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:369)
at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:256)
at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:801)
at 
org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:271)
... 51 more


Thanks,

Jeffrey

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: How to return a file from a servlet

2009-11-30 Thread Prashant
thanks a lot guys.


is it necessary to use resp.setContentType("image/gif"); even if url end
with ".gif" ?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Why is it called "Google App Engine for Java" ?

2009-11-30 Thread Jeff Schnitzer
I, for one, am sick and tired of Sun's domineering, suffocating
stranglehold on what is and isn't Java.  GAE is a breath of fresh air.

JavaME and JavaEE also impose a variety of limitations on Java.
What's the difference between those and GAE?  The difference is that
Sun got a committee of big company representatives with their own
vested interests in a closed room and argued about how "the official
specs" should work for years... and ultimately produced a bunch of
crap that is barely useful to anyone.  Just *try* out Websphere
sometime, I dare you.

For the first time ever, someone has produced a shared application
service model for Java that's even easier than PHP.  This could never
have come out of the JCP.

If this is "destroying java", then GOOD RIDDANCE!

Jeff

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Backspace characters showing up in email content

2009-11-30 Thread david ruescas
I get occasional characters that look like this

http://www.fileformat.info/info/unicode/char/0008/index.htm

when processing incoming emails. I think its the backspace 0008
character, at least thats how they show up in the app engine log. Any
idea where these characters are coming from?

Thankyou,

David

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Processing incoming email

2009-11-30 Thread Peter Ondruska
I am following instructions on 
http://code.google.com/appengine/docs/java/mail/receiving.html
to process incoming mail but failing on retrieving content (headers
are fine).

"The getContent() method returns an object that implements the
Multipart interface. You can then call getCount() to determine the
number of parts and getBodyPart(int index) to return a particular body
part."

MimeMultipart mmp = (MimeMultipart) message.getContent();

Error:
java.lang.ClassCastException: java.io.ByteArrayInputStream cannot be
cast to javax.mail.internet.MimeMultipart

And when I check at runtime what class is returned by getContent() it
really is java.io.ByteArrayInputStream.

Am I doing something wrong?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: How to return a file from a servlet

2009-11-30 Thread Vince Bonfanti
Or, something similar, using the IOUtils class from Commons I/O (
http://commons.apache.org/io/):

 InputStream resourceAsStream =
getServletContext().getResourceAsStream.(pathToImage);
 resp.setContentType("image/gif");
 IOUtils.copy(resourceAsStream,resp.getOutputStream);

Vince

On Mon, Nov 30, 2009 at 8:31 AM, bysse  wrote:

> This should get you going:
>
>  InputStream resourceAsStream = getServletContext().getResourceAsStream
> (pathToImage);
>  // use stream to read image data
>  ...
>  resp.setContentType("image/gif");
>  resp.setContentLength(imageData.length);
>  outputStream.write(imageData, 0, imageData.length);
>
> /Erik
>
> On Nov 30, 11:23 am, Prashant  wrote:
> > Hi,
> >
> > I have a servlet with request handler */file/** . I want to return a file
> *
> > /theme/bg.gif* for all */file/*.gif *. I can check for .gif extension
> then
> > how do i send */theme/bg.gif*, for */file/*.gif* without sending a
> redirect
> > ?
> >
> > Thanks.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: How to return a file from a servlet

2009-11-30 Thread bysse
This should get you going:

 InputStream resourceAsStream = getServletContext().getResourceAsStream
(pathToImage);
 // use stream to read image data
 ...
 resp.setContentType("image/gif");
 resp.setContentLength(imageData.length);
 outputStream.write(imageData, 0, imageData.length);

/Erik

On Nov 30, 11:23 am, Prashant  wrote:
> Hi,
>
> I have a servlet with request handler */file/** . I want to return a file *
> /theme/bg.gif* for all */file/*.gif *. I can check for .gif extension then
> how do i send */theme/bg.gif*, for */file/*.gif* without sending a redirect
> ?
>
> Thanks.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Now available: JDO/JPA preview release with inheritance support

2009-11-30 Thread R. A.
Thanks, Max. No more NPE in *-1.2.8.
Shall wait for final release.


> There is a preview release of the entire 1.2.8 SDK available for _local_
> testing available for download 
> athttp://code.google.com/p/googleappengine/downloads/list
>
> I realize that won't help you in prod, but if you're not ready to deploy yet
> anyway you may find it useful.
>
> Max
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Is it possible to implement Open EntityManager in View to avoid JDODetachedFieldAccessException?

2009-11-30 Thread Felipe Cypriano
Thanks,

Using these properties solve the problem.

On 28 nov, 08:09, datanucleus  wrote:
> > I'm using Spring therefore I tried to configure the
> > OpenEntityManagerInViewInterceptor, if this works as it's supposed to
> > I shouldn't get JDODetachedFieldAccessException anymore, but I still
> > get it.
>
> And what state are the objects in when you access the field ?
> detached ? and what PersistenceContext is used ?
> As perhttp://www.datanucleus.org/products/accessplatform_2_0/jpa/object_lif...
> DataNucleus 1.x supports "Transaction" out of the box (whereas
> DataNucleus 2.x supports both).
> You could easily use the persistence properties
> datanucleus.DetachAllOnCommit = false
> datanucleus.DetachOnClose=true
> if you wanted Extended.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] How to return a file from a servlet

2009-11-30 Thread Prashant
Hi,

I have a servlet with request handler */file/** . I want to return a file *
/theme/bg.gif* for all */file/*.gif *. I can check for .gif extension then
how do i send */theme/bg.gif*, for */file/*.gif* without sending a redirect
?

Thanks.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Using OpenJPA on GAE?

2009-11-30 Thread datanucleus
> Anyone has example of the OpenJPA code that running on GAE? I knew
> that GAE support JPA, but what I am looking for is OpenJPA on GAE.

Please have a think about what your question is. OpenJPA is a JPA
implementation that supports persistence to RDBMS (and XML) *only*.
The datastore on GAE/J is BigTable (not RDBMS nor XML). OpenJPA can't
persist to BigTable.
Also bear in mind that JPA was designed solely for use with RDBMS.

DataNucleus persists to BigTable, as well as to RDBMS, XML, ODBMS,
ODF, Excel, JSON, HBase (HADOOP), Amazon S3, etc and this is the
option that Google support here to their BigTable datastore.

--Andy (DataNucleus)

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Using OpenJPA on GAE?

2009-11-30 Thread YONG
Anyone has example of the OpenJPA code that running on GAE? I knew
that GAE support JPA, but what I am looking for is OpenJPA on GAE.
Thank You!

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] oid is not instanceof javax.jdo.identity.ObjectIdentity

2009-11-30 Thread bcottam
I'm trying to save some data in my app, quite similar to almost all
other data I've previously saved.  However, I'm now getting this stack
trace:

java.lang.ClassCastException: oid is not instanceof
javax.jdo.identity.ObjectIdentity
at com.resmark.client.model.RatePlan.jdoCopyKeyFieldsFromObjectId
(RatePlan.java)
at
org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObjectAsValue
(PersistenceCapableMapping.java:657)
at
org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObject
(PersistenceCapableMapping.java:364)
at org.datanucleus.store.appengine.DatastoreRelationFieldManager
$1.setObjectViaMapping(DatastoreRelationFieldManager.java:132)
at org.datanucleus.store.appengine.DatastoreRelationFieldManager
$1.apply(DatastoreRelationFieldManager.java:108)
at
org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
(DatastoreRelationFieldManager.java:80)
at
org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
(DatastoreFieldManager.java:795)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
(DatastorePersistenceHandler.java:288)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
(DatastorePersistenceHandler.java:241)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
(DatastorePersistenceHandler.java:225)
at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent
(JDOStateManagerImpl.java:3185)
at org.datanucleus.state.JDOStateManagerImpl.makePersistent
(JDOStateManagerImpl.java:3161)
at org.datanucleus.ObjectManagerImpl.persistObjectInternal
(ObjectManagerImpl.java:1298)
at org.datanucleus.ObjectManagerImpl.persistObject
(ObjectManagerImpl.java:1175)
at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent
(JDOPersistenceManager.java:669)
at org.datanucleus.jdo.JDOPersistenceManager.makePersistent
(JDOPersistenceManager.java:694)
at com.resmark.server.model.service.BaseDataService.create
(BaseDataService.java:227)
at com.resmark.server.SetupServiceImpl.updateOrCreate
(SetupServiceImpl.java:120)
at com.resmark.server.SetupServiceImpl.updateOrCreateBundle
(SetupServiceImpl.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke
(Runtime.java:100)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at com.google.appengine.tools.development.StaticFileFilter.doFilter
(StaticFileFilter.java:121)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle
(DevAppEngineWebAppContext.java:54)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:342)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
at org.mortbay.jetty.HttpConnection$RequestHandler.content
(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:21

[appengine-java] Re: Why is it called "Google App Engine for Java" ?

2009-11-30 Thread bcottam
The subject of this thread really caught my eye.  I have to echo
Bobby: I read about the GAE before trying to implement anything on it,
and was well aware of the limitations.  I'd have to suggest that you
read the docs prior to assuming anything about the environment.

The subject matter in this thread brings up a good point (not really
worth discussing, but fun anyway): what IS "Java"?  Is it:
a) the SDK/JRE?
Or
 b) the Java language specification?
I think the answer is "b".  Since pretty much all code running on GAE
is written using the Java language (there's some xml in there), it's
appropriately named "Google App Engine for Java".  There's no "SDK" or
"JDK" reference in there.  No promise about java.util or any other
package in there.  It just states what it is: an app engine that runs
code written in the Java programming language.

Jago, I think the same goes for your statement "Android is not Java".
Of course it isn't, Android is a platform that runs code "written in
the Java programming language".  The code is indeed written in Java,
but then compiled to Dalvik byte-code.  :)  The same goes for GWT,
it's code written in the Java programming language, and then compiled
to raw JavaScript.  There's a very small subset of the JDK that can be
used in GWT, but people seem to be doing just fine with those
limitations (of course, I'm sure they knew about the limitations prior
to writing code in GWT).

I think there are multiple advantages present in the GAE, it's
certainly not for every app, but it can sure power some very
complicated systems, and they seem to be fine with the whitelist
(Google Wave for instance).

I've been porting our system to the GAE in my spare time just to see
if it can handle the data structures our system uses.  We currently
run on Glassfish, using JAX-WS for SOAP web services and use JMS, JSF
1.2 blah blah blah... a bunch of stuff GAE doesn't support, and I've
found that I can generally get around the limitations put on me by the
GAE.  I understand frustration brought on by the system restrictions,
however, it's nothing you can't get around if you approach the problem
from a different angle.  And if you can't get around it, perhaps move
to a different system.  I've heard that Amazons cloud is much harder
to use and has many more restrictions, but I could be wrong, I've not
looked closely at it.

Now, if we're splitting hairs here, I'd say you may have a case in
suggesting that JDO is not fully supported on the GAE.  It'd be much
more fair to say that the GAE supports a "small subset" of the JDO
specification.  However, saying "it's not Java" simply isn't true.
The code is written using the Java language.

-bryce

On Nov 27, 10:52 pm, Bobby  wrote:
> If you were able to go 2 months without noticing that there was a
> whitelist then it must be more extensive than you make it seem. If you
> made a decision without the knowledge that GAE exposes only a subset
> of Java then i understand your frustration but it's really all your
> fault because it's documented, comes up fairly often and permeates
> almost every topic around here.
>
> Bobby

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.