[appengine-java] sandbox restrictions

2010-06-08 Thread RockyWolf
Hi,
I would like to know what all kinds of system calls can't be used in
App Engine.

The App Engine documentation also says that once a request is sent to
the client no further processing can be done. What do you mean by
this? I thought it was true for all JEE applications.
Could you give me more info on this?

-- 
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: many to many relation with additional attribut

2010-06-08 Thread wilberforce
I have used the above mentioned solution for my many to many
relations. Now if I want to get all the entities of type Entity2 for
one entity of type Entity1 I query the ManyToManyLink with the key of
Entity1. As a result I get a list of keys for Entity2. Now how do I
query Entity2 to get all the instances for my list of keys in one go?
I ended up in querying Entity2 for every single key I have in my list
which is surely not acceptable. Any ideas?

On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote:
 Hi Anna,

 There are various ways to approach this (others may well suggest other
 (better?) ones

 1.  Expose your encoded key strings using code like:

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

   // Optional (see my way 2 below)
   @Persistent
   @Extension(vendorName=datanucleus, key=gae.pk-id, value=true)
   private Long loID;

   public String getEncodedKey()
   {
     return sEncodedKey;
   }

   // Optional (see my way 2 below)
   public Long getID()
   {
     return loID;
   }

 2.  Continue with using encoded primary key strings (mine are
 automatically generated by the datastore for each entity at first-
 persistence-time) and then expose the entity's Long ID value (again,
 mine are automatically generated by the datastore for each entity at
 first-persistence-time) using:

   @Persistent
   @Extension(vendorName=datanucleus, key=gae.pk-id, value=true)
   private Long loID;

   public Long getID()
   {
     return loID;
   }

 Beware that in this case, the Long ID values are not the full key,
 just a summary: you will need a full chain starting with the entity
 group parent and working down through the children to your entity
 (unless your entity is the parent of its entity group). I do find
 entities by (Long) ID, but need IDs of entity group ancestors to get
 this to work.

 3.  Use Long IDs as your keys. I do not do this any more because of
 previously-existing bugs which I worked around by using encoded key
 strings and also to maintain some portability to outside of BigTable.
 I therefore cannot speak about this from recent experience.

 I hope that this helps,

 Ian

 On Jun 7, 8:29 pm, Anna anna.mem...@gmx.de wrote:

  Thank you very much Ian! I've implemented your solution but now I
  struggle with adding a Link to the database: A record of entity 1 and
  one of entity 2 are stored in the database. How can I get them out of
  the database to put their keys into a new link? I don't know the keys
  of both entities because I never use them to identify the objects (I
  use Long values instead).

  Regards, Anna

-- 
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: many to many relation with additional attribut

2010-06-08 Thread Ian Marshall
You might want to try one of the

  javax.​jdo.​PersistenceManager.getObjectsById(...)

methods. I have not done this myself yet (although I do use
getObjectById(...)), so I have not used an array or collection of
OIDs. You might want to give this a try.

Failing that, you might want to have as an instance of each
ManyToManyLink not a key for Entity1 and Entity2 but instead a key for
one entity and an array list of keys for the other entity type, so
your original query will return an array list of keys.


On Jun 8, 8:03 am, wilberforce wilberfo...@arcor.de wrote:
 I have used the above mentioned solution for my many to many
 relations. Now if I want to get all the entities of type Entity2 for
 one entity of type Entity1 I query the ManyToManyLink with the key of
 Entity1. As a result I get a list of keys for Entity2. Now how do I
 query Entity2 to get all the instances for my list of keys in one go?
 I ended up in querying Entity2 for every single key I have in my list
 which is surely not acceptable. 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] Re: SecurityException with Hessian on google app engine

2010-06-08 Thread Matija
Any news about this SecurityException ?

Matija.

On Jun 5, 4:46 pm, dilbert dilbert.elbo...@gmail.com wrote:
 I am having trouble with Hessian on Google App Engine. First I will
 describe the setup. I have a persistent class MessageDb declared as
 (It contains a String and an arraylist of strings):

 @PersistenceCapable
 public class MessageDb {
     @PrimaryKey
     private String user;

     @Persistent
     private ArrayListString words = new ArrayListString();
     /* getters and setters ...*/

 }

 I have the following service interface:
 public interface IService {
     ArrayListString testMessage();
     /* Some other methods ... */
  }

 The Service is implemented on App engine in the following way:
 public class Service extends HessianServlet implements IService {
     private static final PersistenceManagerFactory pmfInstance =
 JDOHelper.getPersistenceManagerFactory(transactions-optional);

     @Override
     public ArrayListString testMessage() {
         PersistenceManager pm = null;
         try {
             pm = pmfInstance.getPersistenceManager();

             MessageDb messageDb;
             try {
                 messageDb = pm.getObjectById(MessageDb.class,
 testMessage);
             } catch (JDOObjectNotFoundException e) {
                 return null;
             }
             return messageDb.getWords();
             //return new ArrayListString(messageDb.getWords());
         } finally {
             if (pm != null)
                 pm.close();
         }
     }

 }

 The service simply retrieves an MessageDb object by key and returns
 the object's ArrayListString. This code works fine on the local
 development server but it fails when deployed on remote Google servers
 with the following exception:

 java.lang.SecurityException: java.lang.IllegalAccessException:
 Reflection is not allowed on private int java.util.ArrayList.size
         at
 com.google.appengine.runtime.Request.process-0c4ab611241850c6(Request.java)
         at java.lang.reflect.Field.setAccessible(Field.java:166)
         at
 com.caucho.hessian.io.JavaSerializer.introspect(JavaSerializer.java:
 122)
         at com.caucho.hessian.io.JavaSerializer.init(JavaSerializer.java:
 81)
         at com.caucho.hessian.io.JavaSerializer.create(JavaSerializer.java:
 95)
         at
 com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFact 
 ory.java:
 348)
         at
 com.caucho.hessian.io.SerializerFactory.loadSerializer(SerializerFactory.ja 
 va:
 278)
         at
 com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.jav a:
 224)
         at
 com.caucho.hessian.io.SerializerFactory.getObjectSerializer(SerializerFacto 
 ry.java:
 197)
         at
 com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:
 418)
         at
 com.caucho.hessian.io.AbstractHessianOutput.writeReply(AbstractHessianOutpu 
 t.java:
 558)
         at
 com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:
 323)
         at
 com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:
 202)
         at
 com.caucho.hessian.server.HessianServlet.invoke(HessianServlet.java:
 389)
         at
 com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:
 369)
         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
 511)
         at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1166)
         at
 com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo 
 bUploadFilter.java:
 97)
         at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1157)
         at
 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF 
 ilter.java:
 35)
         at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1157)
         at
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans 
 actionCleanupFilter.java:
 43)
         at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1157)
         at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
 388)
         at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
 216)
         at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
 182)
         at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
 765)
         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
 418)
         at
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionH 
 andlerMap.java:
 238)
         at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
 152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
 542)
         at org.mortbay.jetty.HttpConnection
 $RequestHandler.headerComplete(HttpConnection.java:923)
         

[appengine-java] Unnecessary memcache request from jetty SessionManager?

2010-06-08 Thread dmitrygusev
Can somebody comment on:

http://code.google.com/p/googleappengine/issues/detail?id=3319

-- 
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] JPA entity listner callbacks are not invoked when using Query API

2010-06-08 Thread Sudhir Ramanandi
When an entity is loaded using query, postLoad() call back is not invoked.
postLoad() works only with entityManager.find(clazz, id)

As per the JPA specification:
The PostLoad method is invoked before a query result is returned or
accessed or before an association is traversed.

Example:

@EntityListeners(value={FooEntityListner.class})
@Entity
public class Foo extends BaseEntity {

}

public class UnownedRelationLoader {
public void postLoad(BaseEntity entity) {
---
}

Query q = getEntityManager().createQuery(select from  +
Foo.class.getName());

callback will not be called in above case.

Reported the issue here
http://code.google.com/p/googleappengine/issues/detail?id=3326
Please vote for it.

-- 
Sudhir Ramanandi
http://www.ramanandi.org

-- 
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] Fwd: JPA entity listner callbacks are not invoked when using Query API

2010-06-08 Thread Sudhir Ramanandi
Ohh, sorry.. in the example, I gave a wrong class name
UnownedRelationLoader
Its FooEntityListner and still it does not work

public class FooEntityListner {
public void postLoad(BaseEntity entity) {
---
}

-- Forwarded message --
From: Sudhir Ramanandi sramana...@gmail.com
Date: Tue, Jun 8, 2010 at 2:37 PM
Subject: JPA entity listner callbacks are not invoked when using Query API
To: google-appengine-java@googlegroups.com


When an entity is loaded using query, postLoad() call back is not invoked.
postLoad() works only with entityManager.find(clazz, id)

As per the JPA specification:
The PostLoad method is invoked before a query result is returned or
accessed or before an association is traversed.

Example:

@EntityListeners(value={FooEntityListner.class})
@Entity
public class Foo extends BaseEntity {

}

public class UnownedRelationLoader {
public void postLoad(BaseEntity entity) {
---
}

Query q = getEntityManager().createQuery(select from  +
Foo.class.getName());

callback will not be called in above case.

Reported the issue here
http://code.google.com/p/googleappengine/issues/detail?id=3326
Please vote for it.

-- 
Sudhir Ramanandi
http://www.ramanandi.org



-- 
Sudhir Ramanandi
http://www.ramanandi.org

-- 
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: Unnecessary memcache request from jetty SessionManager?

2010-06-08 Thread Peter Ondruska
How I understand memcache:

cache.containsKey(some-key) tells you whether there is such key in
memcache
and cache.get(some-key) retrieves the value for key

You could skip asking for existence of the key in memcache only in
case you expect to return non-null values (and null being non-existent
object), I may be wrong but this is how I understand memcache.

On Jun 8, 11:07 am, dmitrygusev dmitry.gu...@gmail.com wrote:
 Can somebody comment on:

 http://code.google.com/p/googleappengine/issues/detail?id=3319

-- 
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] Getting an error while using Struts 2 with Google App Engine

2010-06-08 Thread Gaurav Munjal
I referred to this post
http://whyjava.wordpress.com/2009/08/30/creating-struts2-application-on-google-app-engine-gae/

Getting this error

Jun 8, 2010 10:31:06 AM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via
com.google.apphosting.utils.jetty.JettyLogger
Jun 8, 2010 10:31:06 AM
com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Gaurav
Munjal\workspace\SampleStruts\war\WEB-INF/appengine-web.xml
Jun 8, 2010 10:31:06 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: fa...@null line:2 col:6 : org.xml.sax.SAXParseException: The
processing instruction target matching [xX][mM][lL] is not allowed.
Jun 8, 2010 10:31:06 AM
com.google.apphosting.utils.config.AbstractConfigXmlReader getTopLevelNode
SEVERE: Received SAXException parsing the input stream for C:\Users\Gaurav
Munjal\workspace\SampleStruts\war\WEB-INF/web.xml
org.xml.sax.SAXParseException: The processing instruction target matching
[xX][mM][lL] is not allowed.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
 at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
 at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(XMLScanner.java:701)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(XMLDocumentFragmentScannerImpl.java:1016)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(XMLScanner.java:669)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:954)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
 at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
 at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
 at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
 at org.mortbay.xml.XmlParser.parse(XmlParser.java:230)
at
com.google.apphosting.utils.config.AbstractConfigXmlReader.getTopLevelNode(AbstractConfigXmlReader.java:206)
 at
com.google.apphosting.utils.config.AbstractConfigXmlReader.parse(AbstractConfigXmlReader.java:228)
at
com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:142)
 at
com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:22)
at
com.google.apphosting.utils.config.AbstractConfigXmlReader.readConfigXml(AbstractConfigXmlReader.java:111)
 at
com.google.apphosting.utils.config.WebXmlReader.readWebXml(WebXmlReader.java:73)
at
com.google.appengine.tools.development.AbstractContainerService.loadAppEngineWebXml(AbstractContainerService.java:237)
 at
com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:144)
at
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
 at
com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:162)
at
com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
 at
com.google.appengine.tools.development.DevAppServerMain.init(DevAppServerMain.java:113)
at
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
Jun 8, 2010 10:31:06 AM
com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
SEVERE: Received exception processing C:\Users\Gaurav
Munjal\workspace\SampleStruts\war\WEB-INF/web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Received
SAXException parsing the input stream for C:\Users\Gaurav
Munjal\workspace\SampleStruts\war\WEB-INF/web.xml
at
com.google.apphosting.utils.config.AbstractConfigXmlReader.getTopLevelNode(AbstractConfigXmlReader.java:214)
 at
com.google.apphosting.utils.config.AbstractConfigXmlReader.parse(AbstractConfigXmlReader.java:228)
at
com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:142)
 at
com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:22)
at
com.google.apphosting.utils.config.AbstractConfigXmlReader.readConfigXml(AbstractConfigXmlReader.java:111)
 at

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Anna
Thanks a lot for your helpful code Ian! Now I've implemented the long
as gae.pk-id. Both entities and the link are stored but I don't know
how to adopt what you wrote:

On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote:
 Beware that in this case, the Long ID values are not the full key,
 just a summary: you will need a full chain starting with the entity
 group parent and working down through the children to your entity
 (unless your entity is the parent of its entity group). I do find
 entities by (Long) ID, but need IDs of entity group ancestors to get
 this to work.

How do I build a key from parent and child if I don't know the parents
key? The KeyFactory and KeyFactory.Builder don't provide this way. I
guess I missed somehting in my line of thought. Actually I like to do
what wilberforce did: I have a (long) id of an entity 1 object and
like to get all (long) ids of the linked objects of entity 2.

@ wilberforce: Could you post a code snipped of your query (where you
query the ManyToManyLink with the key of Entity1 and get a list of
keys for Entity2)?

Thank you in anticipation!

-- 
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: many to many relation with additional attribut

2010-06-08 Thread Anna
Thanks a lot for your helpful code Ian! Now I've implemented the long
as gae.pk-id. Both entities and the link are stored but I don't know
how to adopt what you wrote:

On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote:
 Beware that in this case, the Long ID values are not the full key,
 just a summary: you will need a full chain starting with the entity
 group parent and working down through the children to your entity
 (unless your entity is the parent of its entity group). I do find
 entities by (Long) ID, but need IDs of entity group ancestors to get
 this to work.

How do I build a key from parent and child if I don't know the parents
key? The KeyFactory and KeyFactory.Builder don't provide this way. I
guess I missed somehting in my line of thought. Actually I like to do
what wilberforce did: I have a (long) id of an entity 1 object and
like to get all (long) ids of the linked objects of entity 2.

@ wilberforce: Could you post a code snipped of your query (where you
query the ManyToManyLink with the key of Entity1 and get a list of
keys for Entity2)?

Thank you in anticipation!

-- 
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: many to many relation with additional attribut

2010-06-08 Thread Anna
Thanks a lot for your helpful code Ian! Now I've implemented the long
as gae.pk-id. Both entities and the link are stored but I don't know
how to adopt what you wrote:

On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote:
 Beware that in this case, the Long ID values are not the full key,
 just a summary: you will need a full chain starting with the entity
 group parent and working down through the children to your entity
 (unless your entity is the parent of its entity group). I do find
 entities by (Long) ID, but need IDs of entity group ancestors to get
 this to work.

How do I build a key from parent and child if I don't know the parents
key? The KeyFactory and KeyFactory.Builder don't provide this way. I
guess I missed somehting in my line of thought. Actually I like to do
what wilberforce did: I have a (long) id of an entity 1 object and
like to get all (long) ids of the linked objects of entity 2.

@ wilberforce: Could you post a code snipped of your query (where you
query the ManyToManyLink with the key of Entity1 and get a list of
keys for Entity2)?

Thank you in anticipation!

-- 
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] Connecting to a remote datastore

2010-06-08 Thread John Patterson

Hi,

I had a problem in my app that would only show when using the live  
data and I could not load all the live data into the local datastore.   
So I wrote an ApiProxy.Delegate which intercepts all datastore RPC  
calls on the dev server and posts the binary data to a servlet running  
in my live app that calls ApiProxy.makeSyncCall and returns the binary  
result back to the dev server.


I thought that this approach might also be an easy way to manipulate  
data in a production datastore directly from code on your local  
machine.  i.e. you could even write a TestCase that loads data or  
sends emails... many cool uses.


It *almost* works... the only part that is not working so far are  
calls to Next which are made by result Iterators when they need a  
new chuck of data.  This runs fine in dev mode (connecting from one  
dev server to another) but on the live servers throws:


com.google.apphosting.api.ApiProxy$ApplicationException:  
ApplicationError: 1: invalid handle: 18336955636086461310
	at com.google.apphosting.runtime.ApiProxyImpl 
$AsyncApiFuture.rpcFinished(ApiProxyImpl.java:293)
	at com.google.net.rpc.RpcStub$RpcCallbackDispatcher 
$1.runInContext(RpcStub.java:1025)
	at com.google.tracing.TraceContext$TraceContextRunnable 
$1.run(TraceContext.java:444)

at com.google.tracing.TraceContext.runInContext(TraceContext.java:684)
	at com.google.tracing.TraceContext 
$ 
AbstractTraceContextCallback 
.runInInheritedContextNoUnref(TraceContext.java:322)
	at com.google.tracing.TraceContext 
$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java: 
314)
	at com.google.tracing.TraceContext 
$TraceContextRunnable.run(TraceContext.java:442)
	at com.google.net.rpc.RpcStub 
$RpcCallbackDispatcher.rpcFinished(RpcStub.java:1046)

at com.google.net.rpc.RPC.internalFinish(RPC.java:2047)
	at com.google.net.rpc.impl.RpcNetChannel.finishRpc(RpcNetChannel.java: 
2338)
	at  
com 
.google.net.rpc.impl.RpcNetChannel.messageReceived(RpcNetChannel.java: 
1265)
	at  
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java: 
319)
	at  
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java: 
290)


This code is closed source and server side only so I was wondering if  
someone might be able to shed some light on the problem or suggest a  
workaround?  My first thought was that perhaps the protocol buffers  
are different on the live servers to the dev servers.

I put the code up here: http://code.google.com/p/remote-datastore/
Thanks,
John

--
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 exception when not using a transaction ?

2010-06-08 Thread JD
I am not using a transaction (see original POST), which is the
problem.

On Jun 4, 11:03 am, Chau Huynh cmhu...@gmail.com wrote:
 Did you have different entity groups inside a transaction?
 Google have a constraint of what can be done in a transaction 
 herehttp://code.google.com/appengine/docs/python/datastore/transactions.h...

 On Fri, Jun 4, 2010 at 5:45 PM, JD liva...@gmail.com wrote:
  After debugging, I was able to get rid of the exception by removing a
  pm.newQuery() which was happening on a different entity group.

  To me this is a bug in App Engine, as there is no reason the query on
  a particular entity group should fail outside a transaction.

  On Jun 3, 12:25 pm, Millisecond millisec...@gmail.com wrote:
   Hmmm.

   How is your object model structured?  Do entities have other entities
   as direct references?

   If you have class A { B b } and setting b to an instance of B that
   already existed might throw the error you're seeing.

   I changed my structure to be class A { String bKey } for a variety
   of other reasons, but guess it also may have gotten around this
   problem.

   Alternatively, post as much code as you can and I'll see if anything
   else rings a bell, early on I spent a frustrated day or two working
   around this exception in a variety of places so know it can be
   frustrating.

   -C

   On Jun 3, 6:33 am, JD liva...@gmail.com wrote:

I added a call to flush() after every change on the PM-managed object,
but that did not help.

Also doing a pm.flush() does not throw this exception, but doing a
pm.close() does - which seems to be contrary to your reasoning (I
would expect flush to throw the same exception if multiple entity
groups were at cause).

On Jun 3, 1:33 am, Millisecond millisec...@gmail.com wrote:

 Even though you're not using transactions, I think it's trying to
  make
 the .close() call atomic (maybe with an internal implicit
 transaction), failing or succeeding as a whole.  And as I understand
 it, entities not in the same group can be stored on separate machines
 so can't be operated on atomically.

 I've worked around this by calling a flush() after most any change on
 a PM-managed object until close().  If this has a huge number of
  reqs/
 s, you may want to re-architect to get the objects in the same entity
 group as multiple flushes won't be very efficient.

 -C

 On Jun 2, 8:26 pm, JD liva...@gmail.com wrote:

  I have a PersistenceManager

  PersistenceManager pm = PMF.get().getPersistenceManager();

  which I use to do a bunch of operations on different objects, but
  WITHOUT transaction (run queries, store entities and lookup
  entities).

  I then close the manager with pm.close() and get this obscure error
  that complains about multiple entity groups inside a transaction
  even
  though I am not using a transaction (you will notice that the error
  is
  not the usual one where it prints the different entity groups).

  I am not 100% confident but have the impression that this error
  started happening with the 1.3.4 release.
  100% reproducible use case. Would appreciate input from App Engine
  developers.

  com.myapp.servlet.task.PopulateUserPages doAction: Illegal argument
  javax.jdo.JDOFatalUserException: Illegal argument
          at

  org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc
  leusJDOHelper.java:
  344)
          at

  org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
  281)
          at
  com.myapp.dao.jdo.DatastoreService.release(DatastoreService.java:
  631)
          at

  com.myapp.servlet.AbstractBaseServlet.releaseService(AbstractBaseServlet.ja
  va:
  243)
          at

  com.myapp.servlet.task.PopulateUserPages.doAction(PopulateUserPages.java:
  132)
          at
  com.myapp.servlet.task.Dispatcher.doAction(Dispatcher.java:35)
          at
  com.myapp.servlet.task.TaskServlet.doAction(TaskServlet.java:36)
          at

  com.myapp.servlet.AbstractBaseServlet.doGenericAction(AbstractBaseServlet.j
  ava:
  194)
          at

  com.myapp.servlet.AbstractBaseServlet.doPost(AbstractBaseServlet.java:
  84)
          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:
  511)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1166)
          at

  com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo
  bUploadFilter.java:
  97)
          at org.mortbay.jetty.servlet.ServletHandler
  $CachedChain.doFilter(ServletHandler.java:1157)
          at

  

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Ian Marshall
 How do I build a key from parent and child if I don't know the parent's
 key?
I use a field to link the entity group parent instance to a child
instance. I make this bi-directional, so from an entity I can retrieve
both its parent and also its child or set of children.


 Thanks a lot for your helpful code Ian! Now I've implemented the long
 as gae.pk-id.
Just be aware that in my code snippet Way 1 I have both an encoded
key string (key=gae.encoded-pk) as the primary key as well as a Long
value as a Long ID (gae.pk-id). I believe that GAE/J extracts this
Long ID as a summary of the entity's full primary key (which contains
its full entity group path from its entity group root all the way
through to itself). The GAE/J persistence documentation shows how to
use the Long ID (gae.pk-id) (and I trust that my code conforms!).

Enjoy!

-- 
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: sandbox restrictions

2010-06-08 Thread Tristan
Here's an exhaustive list:

http://code.google.com/appengine/docs/java/jrewhitelist.html


On Jun 8, 5:40 am, james isaac jamesisaa...@gmail.com wrote:
 I would also like to know what you mean when you say we can't open a
 socket or access another host directly.What API is being referred to
 here?
 

  On Tue, Jun 8, 2010 at 11:31 AM, RockyWolf jamesisaa...@gmail.com wrote:





  Hi,
  I would like to know what all kinds of system calls can't be used in
  App Engine.

  The App Engine documentation also says that once a request is sent to
  the client no further processing can be done. What do you mean by
  this? I thought it was true for all JEE applications.
  Could you give me more info on this?

  --
  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 
  athttp://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: AspectJ + Spring

2010-06-08 Thread Tristan
Something to consider, that if you start an entire AspectJ framework
you're increasing your server startup time (whether it's large or
not). I liked the solution Roo brings to the table, and that is it
compiles AspectJ out of the source by the time it is deployed simply
by inserting the Java code to where it needs to go. That should get
rid of any errors AND make your app run faster.

On Jun 7, 2:07 am, Sudhir Ramanandi sramana...@gmail.com wrote:
 I Got

 Error creating bean with name
 'org.springframework.context.weaving.AspectJWeavingEnabler#0':
 Initialization of bean failed; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error creating bean
 with name 'loadTimeWeaver': Initialization of bean failed; nested exception
 is java.lang.IllegalStateException: ClassLoader
 [com.google.appengine.tools.development.IsolatedAppClassLoader] does NOT
 provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom
 LoadTimeWeaver or start your Java virtual machine with Spring's agent:
 -javaagent:org.springframework.instrument.jar:

 On Mon, Jun 7, 2010 at 11:24 AM, Sudhir Ramanandi sramana...@gmail.comwrote:

  Hello,

  Is any one successfully using Spring + Aspectj for dependency injection in
  domain objects
  as explained here
 http://static.springsource.org/spring/docs/3.0.x/spring-framework-ref...

  Does aspectj Load time weaving works properly on GAE

  --
  Sudhir Ramanandi
 http://www.ramanandi.org

 --
 Sudhir Ramanandihttp://www.ramanandi.org

-- 
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: AspectJ + Spring

2010-06-08 Thread Nacho Coloma
Hi Sudhir,

Try using interfaces for your objects. I have been able to use aspects
in my applications using Spring interceptors instead of weaving, which
is triggered (I may be wrong here) when your class does not implement
any interfaces.

Bottom line: inject interfaces instead of bean implementations and you
should be OK. To be 100% sure, please post your full stack trace and
relevant spring config snippets.

On Jun 7, 9:07 am, Sudhir Ramanandi sramana...@gmail.com wrote:
 I Got

 Error creating bean with name
 'org.springframework.context.weaving.AspectJWeavingEnabler#0':
 Initialization of bean failed; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error creating bean
 with name 'loadTimeWeaver': Initialization of bean failed; nested exception
 is java.lang.IllegalStateException: ClassLoader
 [com.google.appengine.tools.development.IsolatedAppClassLoader] does NOT
 provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom
 LoadTimeWeaver or start your Java virtual machine with Spring's agent:
 -javaagent:org.springframework.instrument.jar:

 On Mon, Jun 7, 2010 at 11:24 AM, Sudhir Ramanandi sramana...@gmail.comwrote:

  Hello,

  Is any one successfully using Spring + Aspectj for dependency injection in
  domain objects
  as explained here
 http://static.springsource.org/spring/docs/3.0.x/spring-framework-ref...

  Does aspectj Load time weaving works properly on GAE

  --
  Sudhir Ramanandi
 http://www.ramanandi.org

 --
 Sudhir Ramanandihttp://www.ramanandi.org

-- 
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: Task Queues: no method to get their current size()

2010-06-08 Thread Nacho Coloma
You can while testing (this is from the users guide):

LocalTaskQueue queue = LocalTaskQueueTestConfig.getLocalTaskQueue();
QueueStateInfo qsi = queue.getQueueStateInfo().get(default);
assertEquals(entriesCount, qsi.getTaskInfo().size());

Out of the development environment, you cannot.

On Jun 5, 6:27 am, Didier Durand durand.did...@gmail.com wrote:
 Hi,
 I'm trying to use the Task Queues in my application.

 I don't find any method on
 com.google.appengine.api.labs.taskqueue.Queue to obtain the current
 number of tasks in the queue. It's important for me to monitor that it
 doesn't go up too much meaning that something goes wrong in my app.

 Where is such a method as size() or length() on Queue ?

 regards
 didier

-- 
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] Google Profile API

2010-06-08 Thread Jeevan
Hello all,
Am Jeevan and am doing a project on Google Profile API.
The objective of my application is I need to fetch the profile of all
the users who are in a particular domain, and then display the
information of the users of that particular domain in the Google Apps,
and I have to deploy this application in the Google App Engine.
Please help me to under stand the XML API.

Thanks a lot in advance

-- 
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] Fetching previous and next entity

2010-06-08 Thread Johan
Hi,

My problem: Given a key and x sort criteria i want to fetch the
previous and next entity.

Im looking for suggentions on the most effective ways of implementing
this using the low level api.






-- 
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] error accessing page

2010-06-08 Thread Jeremy-t
I get the following error trying to access a jsp:

The requested URL was not allowed: /sprintbbreport.jsp  (resource
reports-sprintbb2010.appspot.com)

It needs to be protected by the admin user associated to the domain -
i set up the domain with this option on creation instead of allowing
any user login w/ a gmail id.

I'm using the User java api.

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: Performance issue for GAE auto-restart

2010-06-08 Thread Tin
Hi all:

We have found a temporary solution for this issue:
Try with an AJAX timer kicking the server (doing nothing), maybe one
request per minute (or less) and GAE will keep our site / users in the
same node.
In our testing it could avoid the GAE web instance reloaded, but if
the request interval is long, it would cause another Datastore
performance issue: http://goo.gl/98zk that will be fixed in near
future.

More info please refer to here: http://goo.gl/mzQR

-- 
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] Sessions - Working in request scope, not persisting between requests

2010-06-08 Thread klonq
I have a problem with sessions. This is not a new problem it has been
something that has been bugging me since I started developing for GAE,
I am using SDK 1.3.3.1

Things I have done:
1. Enabled sessions in app-engine.xml with sessions-enabledtrue/
sessions-enabled.
2. Implemented Serializable in the objects I would like to persist.
3. RTFM but there's only one paragraph and it doesn't give much away.

For example I am using flash messages to give feedback to the user:

if (email.send()) {
flash = new FlashMessage(FlashMessage.SUCCESS, Your message has
been sent);
session.setAttribute(FlashMessage.SESSION_KEY, flash);
response.sendRedirect(URL.HOME);
} else {
flash = new FlashMessage(FlashMessage.ERROR,
FlashMessage.INVALID_FORM_DATA);
session.setAttribute(FlashMessage.SESSION_KEY, flash);
 
getServletContext().getRequestDispatcher( 
CONTACT_FORM).forward(request,response);
}

When the request is forwarded to a JSP via
getRequestDispatcher.forward() the flash message displays like its
supposed to. When the request is redirected via
response.sendRedirect() nothing happens. The message is displayed via
the same JSP template in both scenarios as follows:

%   if (session.getAttribute(FlashMessage.SESSION_KEY) != null) {
   FlashMessage flash =
(FlashMessage)session.getAttribute( FlashMessage.SESSION_KEY);
%
%= flash.display() %
% }%

The class FlashMessage is included below:

import java.io.Serializable;

/**
 * HTML element used to give feedback to client based on server side
operations.
 * The flash message will be displayed as a DIV of class type.
 */
public class FlashMessage implements Serializable {
private static final long serialVersionUID = 8109520737272565760L;

/** Session key, where the flash message is stored */
public static final String SESSION_KEY = flashMessage;

/

Class Types */
/** Negative feedback message type */
public static final String ERROR = error;
/** Positive feedback message type */
public static final String SUCCESS = success;

/

Messages */
/** Invalid form data */
public static final String INVALID_FORM_DATA = Your request failed
to validate, please check the fields below.;

private String message;
private String type;

/**
 * @param type Message type
 * @param message Message
 */
public FlashMessage (String type, String message) {
this.type = type;
this.message = message;
}

/**
 * @return HTML string representing the DIV element of the flash
message.
 */
public String display(){
return div id='flash' class=' + this.type + ' + 
this.message +
/div;
}
}


-- 
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: List all entitie kinds from the datastore

2010-06-08 Thread Laco Skokan
Erich,

yes, this works fine. Thank you!

Ladislav.

On 28 kvě, 19:10, Erich erich.re...@gmail.com wrote:
 I've used the following code, to limited success...

 code
 %@ page import=com.google.appengine.api.datastore.DatastoreService
 %
 %@ page
 import=com.google.appengine.api.datastore.DatastoreServiceFactory %
 %@ page import=com.google.appengine.api.datastore.Entity %
 %@ page import=com.google.appengine.api.datastore.PreparedQuery %
 %@ page import=com.google.appengine.api.datastore.Query %

 %@ page import=java.lang.Iterable %

 %
 DatastoreService datastore =
 DatastoreServiceFactory.getDatastoreService();
 PreparedQuery global = datastore.prepare(new Query(__Stat_Kind__));

 for( Entity globalStat : global.asIterable() )
 {
     Long totalBytes = (Long) globalStat.getProperty(bytes);
     Long totalEntities = (Long) globalStat.getProperty(count);
     String kindName = (String) globalStat.getProperty(kind_name);

     %%= [ + kindName + ] has  + totalEntities +  entities and
 takes up  + totalBytes + bytesbr/ %%} // end for

 %
 /code

 This works to a point. It seems I only shows that I have one entry for
 my POJO when I know I have thousands. Perhaps the statistics aren't
 updated for extended periods as I've seen on other threads. Hope this
 helps you get all your kinds in one pass...

 Erich

 On May 20, 9:33 am, Laco Skokan sko...@gmail.com wrote:

  I have tried both. On local it does not work at all as you say. On
  cloud it works, but I have to specify entity name, so I can't list all
  entities.

  L.

  On 20 kvě, 06:15, Didier Durand durand.did...@gmail.com wrote:

   Hi Ladislav

   Did you try on GAE itself or on your local dev server: stats don't
   work locally

   seehttp://groups.google.com/group/google-appengine-java/browse_thread/th...
   orhttp://groups.google.com/group/google-appengine-java/browse_thread/th...

   cheers
   didier

   On May 18, 10:06 pm, Laco Skokan sko...@gmail.com wrote:

I have tried, but it does not. I have ro specify kind_name as a
parameter. But I want to list all kinds. If I do not specify the
parameter, the stat returns null.

Ladislav.

On 18 kvě, 11:16, Didier Durand durand.did...@gmail.com wrote:

 Hi,

 did you try the sample code 
 athttp://code.google.com/appengine/docs/java/datastore/stats.html
 with __Stat_Kind__ ? Should do what you want.

 didier

 On May 17, 10:51 pm, Laco Skokan sko...@gmail.com wrote:

  Hello,

  did anybody tried to list all entity kinds from thedatastore? How 
  can
  this be done?
  I try to useDatastorestatistics, but it does not seems to be useful
  for this task.

  Any ideas? Thank you, Ladislav.

  --
  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 
  athttp://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 
 athttp://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 
athttp://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 
   athttp://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 
  athttp://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 

[appengine-java] Re: Version not ready error (but it's ready)

2010-06-08 Thread Tristan
Well??? This problem happens EVERY time I deploy these days. As a
result Google App Engine has become USELESS as a hosting solution.
Any plans to fix this? Anything I can do on my side so that my uploads
work?

On Jun 7, 4:59 pm, Tristan tristan.slomin...@gmail.com wrote:
 I keep on getting this during deployment:

 Deploying newversion.
 Will check again in 1 seconds
 Will check again in 2 seconds
 Will check again in 4 seconds
 Will check again in 8 seconds
 Will check again in 16 seconds
 Will check again in 32 seconds
 Will check again in 64 seconds
 Will check again in 128 seconds
 Rolling back the update.
 java.lang.RuntimeException:Versionnot ready.

 This happens almost every time I deploy. The thing is, the application
 code deploys just fine, but this error prevents any updates to indexes
 or queues.

 In summary, the newversiongets deployed to the app engine just fine.
 I can set it as defaultversionand it works. What breaks is that any
 queues or indexes are not updated because they never get uploaded due
 to the above error.

 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.



Re: [appengine-java] Re: Version not ready error (but it's ready)

2010-06-08 Thread Don Schwarz
What version of the SDK are you using?  I believe that this deadline was
increased significantly in 1.3.4.

On Tue, Jun 8, 2010 at 10:39 PM, Tristan tristan.slomin...@gmail.comwrote:

 Well??? This problem happens EVERY time I deploy these days. As a
 result Google App Engine has become USELESS as a hosting solution.
 Any plans to fix this? Anything I can do on my side so that my uploads
 work?

 On Jun 7, 4:59 pm, Tristan tristan.slomin...@gmail.com wrote:
  I keep on getting this during deployment:
 
  Deploying newversion.
  Will check again in 1 seconds
  Will check again in 2 seconds
  Will check again in 4 seconds
  Will check again in 8 seconds
  Will check again in 16 seconds
  Will check again in 32 seconds
  Will check again in 64 seconds
  Will check again in 128 seconds
  Rolling back the update.
  java.lang.RuntimeException:Versionnot ready.
 
  This happens almost every time I deploy. The thing is, the application
  code deploys just fine, but this error prevents any updates to indexes
  or queues.
 
  In summary, the newversiongets deployed to the app engine just fine.
  I can set it as defaultversionand it works. What breaks is that any
  queues or indexes are not updated because they never get uploaded due
  to the above error.
 
  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.comgoogle-appengine-java%2bunsubscr...@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] iterating through items in cache (Java)

2010-06-08 Thread radzish
Hi

Memcache API is missing this. Are there any ideas how to do that?

Regards,
Alex

-- 
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] iterating through items in cache (Java)

2010-06-08 Thread Ikai L (Google)
Memcache doesn't natively have this ability, even outside of App Engine.
You'll have to keep an index of used keys, or consider a different storage
strategy.

On Tue, Jun 8, 2010 at 4:36 PM, radzish radz...@gmail.com wrote:

 Hi

 Memcache API is missing this. Are there any ideas how to do that?

 Regards,
 Alex

 --
 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.comgoogle-appengine-java%2bunsubscr...@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
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/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.



[appengine-java] Using the Gdata Java Client Application Library on GWT and GAE. Authenticating with OAuth.

2010-06-08 Thread drthink
I am building a GWT-GAE-Java application that imports Google Contacts
using the GData Java Client library.  I am following this example
here:  http://code.google.com/apis/gdata/docs/auth/oauth.html

I am attempting the first stage of this demo where I create a URL the
user gets redirected to to authenticate my application to extract
contact data.

The problem is I can't get it to work.  My code is running on the
server section of the GWT application, and it fails on the first line
where the GoogleOAuthParameters is initialized with a
NoClassDefFoundError.

I have tried changing this every which way and I am pulling my
proverbial hair out.

I recognize that there is a GWT-Client library for managing this
process from the client side of GWT, but I don't want to use that as
it doesn't use oAuth.

Any ideas?

Cheers
Gene


 CODE
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);
oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);
oauthParameters.setScope(https://docs.google.com/feeds/;);
oauthParameters.setOAuthCallback(http://www.example.com/
UpgradeToken.jsp);

GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(new
OAuthHmacSha1Signer());
oauthHelper.getUnauthorizedRequestToken(oauthParameters);

String approvalPageUrl =
oauthHelper.createUserAuthorizationUrl(oauthParameters);
System.out.println(approvalPageUrl);


*ERROR
Jun 8, 2010 2:56:52 PM
com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1276034212868000] javax.servlet.ServletContext log: Exception
while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract com.sohoappspot.scheduler.shared.UserInfo
com.sohoappspot.scheduler.client.rpc.GreetingService.getUserInformation()
throws java.lang.IllegalArgumentException' threw an unexpected
exception: java.lang.NoClassDefFoundError: com/google/gdata/client/
authn/oauth/GoogleOAuthParameters
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
378)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
581)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
188)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
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:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.NoClassDefFoundError: com/google/gdata/client/

[appengine-java] Date based sorting and result pagination

2010-06-08 Thread RAVINDER MAAN
Hello all
how can i get my query result sorted based on creationdate and
also i want to do pagination for the same.what is the best way to do
that.can anybody refer me any example code?
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.