[appengine-java] Re: how to save binary data in JDO

2010-03-02 Thread Jake
You're not limited to 1MB - you're just limited to using 1MB
entities.  The GAEVFS link I sent you implies that it's files can span
multiple entities.  As Mrityunjay stated, though, large storage
requires payment.  See the quotas for details:
http://code.google.com/appengine/docs/quotas.html

Jake

On Mar 1, 12:43 pm, Valentino Hankypants f.hirs...@gmx.at wrote:
 so i only can upload binary data up to 1 MB?
 any possibility to upload binary data with GBs?

 greatz

 On 1 Mrz., 18:36, Jake jbrooko...@cast.org wrote:

  Hey,

  Saving binary data to the datastore isn't too difficult - you can just
  use a Blob type and ensure that you don't break the 1MB capacity of a
  single entity.  You can see my class declaration below.  The hard
  part is converting a file upload to a byte[] and then from a byte[]
  back into what you would consider a downloadable file.  That
  depends, somewhat, on your implementation.  For example, I use the
  Wicket architecture and all I need to do is

  FileUpload f = fileUploadField.getFileUpload();
  BinaryFileData b = new BinaryFileData(f.getBytes());
  pm.makePersistent(b);

  I presume you are not using Wicket, but some other framework.  You'll
  need to look into how it handles file uploads.

  You may also find this interesting:http://code.google.com/p/gaevfs/
  I haven't used it, but it skips the whole byte[] thing entirely.

  Jake

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class BinaryFileData implements Serializable {

          private static final long serialVersionUID = 1L;

          @PrimaryKey
          @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
          private Key key;

          @Persistent
          private String name;

          @Persistent
          private String mimeType;

          @Persistent(defaultFetchGroup=true)
          private Blob data;

          public BinaryFileData(byte[] bytes) {
                  this.data = new Blob(bytes);
          }

          public byte[] getData() {
                  return data.getBytes();
          }

          public void setData(byte[] d) {
                  this.data = new Blob(d);
          }

  }

  On Mar 1, 11:25 am, Valentino Hankypants f.hirs...@gmx.at wrote:

   hello together,

   i started working with the app engine some days ago, and now i want to
   save some binary data (pdf, etc.) from my app (eg by clicking a
   button) in the storage system.

   anybody who can help me doing this? (tutorials, etc.)

   greatz
   flo

-- 
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] local testing GAE storage

2010-03-02 Thread Valentino Hankypants
hello,

if i save some data with JDO in the storage. Where is this data stored
if i run my app locally? is there any possibility to reset this
storage for testing?

greatz
flo

-- 
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 deleting file in Blob Viewer

2010-03-02 Thread Houston startup coder
I tried to delete a file in Blob Viewer and every time, no matter if
I'm attempting to delete one or several, I get this error:

Server Error

A server error has occurred.

Return to Applications screen »


-- 
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] form to request being allowed to deploy the application multiple times

2010-03-02 Thread Houston startup coder
I've been Googling all over this forum and the documentation, but I
can't find the form I need to submit to the GAE team.  I am deploying
multiple versions of my app (which are actually different apps) around
the same datastore, and it has billing enabled.  But I also need to
deploy this stuff again around a separate datastore for testing and I
don't want the GAE police to shut me down.

I remember coming across a form I can fill out to request exemption in
my case.  Can someone please direct me to that?  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.



Re: [appengine-java] local testing GAE storage

2010-03-02 Thread Karel Alvarez
project folder\war\WEB-INF\appengine-generated\local_db.bin  contains your
database, you can remove it if the dev server is stopped

On Tue, Mar 2, 2010 at 9:52 AM, Valentino Hankypants f.hirs...@gmx.atwrote:

 hello,

 if i save some data with JDO in the storage. Where is this data stored
 if i run my app locally? is there any possibility to reset this
 storage for testing?

 greatz
 flo

 --
 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] Re: how to save binary data in JDO

2010-03-02 Thread Valentino Hankypants
hi jake,

thanks for your replies.
in my case i have jsp-page with a form. the user should have the
possibility to select a file. i used the input type=file
name=test directive from html.
after the user selected a file, he clicks a button. by clicking this
button the binary data of the selected file should be read and saved
in a blob in the GAE storage.
afterwards i'll give the user the possibility to open the uploaded
file by clicking a link...

therefore, should i use this gaevfs or not?

up to now my major problem is, how can i get the binary data from the
form in my servlet class where i handle the form actions? i got all
other informations by HttpServletRequest.getParameter(test);

greatz and hoping for some help ;-)
flo



On 2 Mrz., 15:24, Jake jbrooko...@cast.org wrote:
 You're not limited to 1MB - you're just limited to using 1MB
 entities.  The GAEVFS link I sent you implies that it's files can span
 multiple entities.  As Mrityunjay stated, though, large storage
 requires payment.  See the quotas for 
 details:http://code.google.com/appengine/docs/quotas.html

 Jake

 On Mar 1, 12:43 pm, Valentino Hankypants f.hirs...@gmx.at wrote:

  so i only can upload binary data up to 1 MB?
  any possibility to upload binary data with GBs?

  greatz

  On 1 Mrz., 18:36, Jake jbrooko...@cast.org wrote:

   Hey,

   Saving binary data to the datastore isn't too difficult - you can just
   use a Blob type and ensure that you don't break the 1MB capacity of a
   single entity.  You can see my class declaration below.  The hard
   part is converting a file upload to a byte[] and then from a byte[]
   back into what you would consider a downloadable file.  That
   depends, somewhat, on your implementation.  For example, I use the
   Wicket architecture and all I need to do is

   FileUpload f = fileUploadField.getFileUpload();
   BinaryFileData b = new BinaryFileData(f.getBytes());
   pm.makePersistent(b);

   I presume you are not using Wicket, but some other framework.  You'll
   need to look into how it handles file uploads.

   You may also find this interesting:http://code.google.com/p/gaevfs/
   I haven't used it, but it skips the whole byte[] thing entirely.

   Jake

   @PersistenceCapable(identityType = IdentityType.APPLICATION)
   public class BinaryFileData implements Serializable {

           private static final long serialVersionUID = 1L;

           @PrimaryKey
           @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
           private Key key;

           @Persistent
           private String name;

           @Persistent
           private String mimeType;

           @Persistent(defaultFetchGroup=true)
           private Blob data;

           public BinaryFileData(byte[] bytes) {
                   this.data = new Blob(bytes);
           }

           public byte[] getData() {
                   return data.getBytes();
           }

           public void setData(byte[] d) {
                   this.data = new Blob(d);
           }

   }

   On Mar 1, 11:25 am, Valentino Hankypants f.hirs...@gmx.at wrote:

hello together,

i started working with the app engine some days ago, and now i want to
save some binary data (pdf, etc.) from my app (eg by clicking a
button) in the storage system.

anybody who can help me doing this? (tutorials, etc.)

greatz
flo

-- 
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: local testing GAE storage

2010-03-02 Thread Valentino Hankypants
thx karel, worked fine

greatz flo

On 2 Mrz., 16:20, Karel Alvarez kalvar...@gmail.com wrote:
 project folder\war\WEB-INF\appengine-generated\local_db.bin  contains your
 database, you can remove it if the dev server is stopped

 On Tue, Mar 2, 2010 at 9:52 AM, Valentino Hankypants f.hirs...@gmx.atwrote:

  hello,

  if i save some data with JDO in the storage. Where is this data stored
  if i run my app locally? is there any possibility to reset this
  storage for testing?

  greatz
  flo

  --
  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.



Re: [appengine-java] Re: datanucleus enhancer keeps running

2010-03-02 Thread Rajeev Dayal
See http://code.google.com/p/googleappengine/issues/detail?id=2115. This may
be the issue that you're having. It was recently fixed, and a version of GPE
with the fix is forthcoming.

On Thu, Feb 25, 2010 at 1:57 PM, Steve Pritchard steve...@gmail.com wrote:



 On Feb 25, 6:39 am, haole mejoe...@gmail.com wrote:
  i'm using eclipse 3.5.1, GPE 3.5 (1.2.0.v200912062003), GAE
  1.3.1.v201002101412, GWT 2.0.3.v201002191036
  datanucleusenhancer continuously runs over and over again
  temporary workaround: turn off build automatically feature in eclipse

 I have several projects with a dependency hierarchy.  I found the
 enhancer to be fragile and it often would not enhance the classes.   I
 had to do a 'clean' to make it happen. I could not find the pattern to
 when it failed to enhance.  It never looped on me so you may be seeing
 a different problem.

 About 3 weeks ago I had had enough and  turned off the Enhancer
 builder (the plugin yelled at me).  In its place I added an ant task
 to do the enhancement.  I derived the ant task statements from the
 Datanucleus site.  Since that time things have been very stable and
 the enhancer always finishes its job.

 This is the essence of the ant task:

  !--
  --
  !--  T A S K D E F
 S --
  !--
  --

  taskdef name=enhance
 classname=com.google.appengine.tools.enhancer.EnhancerTask
  classpath
pathelement path=${appengine.tools.classpath}/
pathelement path=${appengine.tools.lib}/
  /classpath
  /taskdef

  !--
  --
  !--  T A R G E T
 S   --
  !--
  --


  target name=enhance.cls
  description=Performs Datnucleus JDO enhancement on compiled
 data classes.
!-- echo message= path ${appengine.tools.classpath}/ --
!-- echo message= fileset ${proj.dir.gen.cls}/ --
enhance failonerror=true verbose=false
  classpath
pathelement path=${appengine.tools.classpath}/
fileset dir=${proj.dir.war.lib} includes=*.jar/
pathelement path=${proj.dir.gen.cls}/
  /classpath
  fileset dir=${proj.dir.gen.cls} includes=**/*.class/
/enhance
  /target

  target name=enhance.war
  description=Performs Datnucleus JDO enhancement on war
 classes.
!-- echo message= path ${appengine.tools.classpath}/ --
!-- echo message= fileset ${proj.dir.gen.cls}/ --
enhance failonerror=true verbose=false
  classpath
pathelement path=${appengine.tools.classpath}/
fileset dir=${proj.dir.war.lib} includes=*.jar/
pathelement path=${proj.dir.war.cls}/
  /classpath
  fileset dir=${proj.dir.war.cls} includes=**/*.class/
/enhance
  /target

 It may be worth a try.
 Steve

 --
 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] Re: Expires header automatically added (bug?)

2010-03-02 Thread George Moschovitis
Yes, I am setting a cookie.

The session leakage problem is interesting. I have a question though,
does the Expires header have precedence over the LastModified/ETag
headers?
I would like to use the LastModified/ETag headers to implement
conditional GET, are you sure that ETag has precedence over the
Expires header? (I am using cache-control: private)

btw, thanks for the answer.

-g.

On Mar 1, 8:39 pm, Ikai L (Google) ika...@google.com wrote:
 Are you setting a cookie? We force an expires header for any requests that
 have a set-cookie header. The reason for this is that many users access
 websites using HTTP proxies. Some proxies will cache the entire request,
 which may cause session leak (e.g. let you read someone else's email).

 On Mon, Mar 1, 2010 at 7:09 AM, George Moschovitis 





 george.moschovi...@gmail.com wrote:
  I don NOT want to set an Expires header. I am just curious with the
  header is added (and messes up with my caching scheme)

  -g.

   Well, if you do not like what GAE sets as Expires value, why not set
   yours?

   On Mar 1, 11:18 am, George  Moschovitis george.moschovi...@gmail.com
   wrote:

 Could you provide some code please?

What kind of code should I provide? I do NOT set the Expires header in
my code, and still GAE automatically adds the Expires header.

-g.

  --
  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%2B 
  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 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/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] Re: Blobstore - delete record from apps console

2010-03-02 Thread Houston startup coder
I created a new post for this without realizing this thread existed.
I also starred the issue.


On Jan 13, 5:05 pm, Jason (Google) apija...@google.com wrote:
 Hi YONG. I'm seeing this too on my end. I see a more descriptive error
 message, however -- the Admin Console is basically reporting that billing
 isn't enabled for the application when it really is, and hence doesn't
 process the delete request. Please star this external issue and you'll be
 notified of updates.

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

 - Jason

 On Tue, Jan 12, 2010 at 7:39 PM, YONG yongkia...@gmail.com wrote:
   What application ID are you using, and what kind of error do you see when
   you try to delete the blob?

  my app ID is yong8128. When I try to delete it from Admin Console,
  Blob Viewer, I got the

  Server Error

  A server error has occurred.

  Return to Applications screen »

  I had uploaded a few blob fileif delete using Blobstore API is OK.
  But when delete using
  Admin Console, Blob Viewer, got the above error.

  --
  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] Re: error deleting file in Blob Viewer

2010-03-02 Thread Houston startup coder
I found another thread relevant to this and it mentioned this issue:
http://code.google.com/p/googleappengine/issues/detail?id=2622

So I starred that issue and left my info in a comment there.  Is there
no way to delete a blob from code?  The documentation says this:

If your app doesn't want to keep the blob, you should delete the blob
immediately to prevent it from becoming orphaned.

But I searched for delete on that page and didn't find a way to do
it even though the implication is that there is a way.  :)

Thanks,
Stephen


On Mar 2, 9:00 am, Houston startup coder stephenh...@gmail.com
wrote:
 I tried to delete a file in Blob Viewer and every time, no matter if
 I'm attempting to delete one or several, I get this error:

 Server Error

 A server error has occurred.

 Return to Applications screen »

-- 
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] Multiple contains() in a query and exploding indexes

2010-03-02 Thread Karel Alvarez
Hi
Some time ago, I asked how to use multiple contains in a query, and I got
some responses, that was great and I thank everybody for they help.

I am posting my findings and advance in hope it might be useful for somebody
trying to do the same.
I am trying to build a database with real state listings in my area, and
build some searches on it, the search is likely to have many fields, and
several of the fields the user can select multiple values. I chose to handle
the whole entity relationship myself instead of using the fancy features of
GAE, I had my reasons for it, but frustration with GAE it is a part of it,
regardless of that, the approach to searching might still apply if you chose
to use relationships from GAE.

I read somewhere in the docs that when you use contains in a query, it
internally it executes an equal sub-query for each of the values in the
list, (somebody care to confirm that?) so if you have several fields with
contains you might bump into the 30 sub-query constraint pretty fast.
So I choose to:
-execute the search by each one of the fields, and each ones of the selected
values sequentially, get only the ids, each one of this should hit only one
index, and be fast.
-add the results from each result to a memcache instance, using increment,
collect the ids in a list for later (there is no way to get all the keys in
the cache,that I found)
-collect the counts for each id in the list I got, and for each check the
count, if the count is equal to the number of queries, it means that entity
returned true for each of the queries and its an entity that I want to
return, i collect all the ides that are good results, and go to the
datastore to collect the full entities to return.

This process is expensive, and I still got to try it out with a a big set,
but executes sufficiently fast for my test set, of course I cache the result
until the user changes the search criteria (or expires).

Here is the code for the search method:

private ListIndexEntry buildResultsFor(SearchCriteria sc) {
ListIndexEntry result = new ArrayListIndexEntry();
 // Price parsing
float minPrice = -1;
float maxPrice = -1;
 if (sc.getMinPrice().length()  0) {
minPrice = Float.parseFloat(sc.getMinPrice());
 }
if (sc.getMaxPrice().length()  0) {
maxPrice = Float.parseFloat(sc.getMaxPrice());
 }
// Listing Status parsing
Long[] statusIds = null;
 String[] statusNames = sc.getStatus();
if (statusNames != null  statusNames.length  0) {
 statusIds = getListingStatusIdsByNames(statusNames);
}
// House Types parsing
 Long[] houseTypesIds = null;
String[] houseTypeNames = sc.getHouseType();
 if (houseTypeNames != null  houseTypeNames.length  0) {
houseTypesIds = getHouseTypeIdsByNames(houseTypeNames);
 }
// THE search
MemcacheService cache = MemcacheServiceFactory.getMemcacheService();
 SetString allIds = new HashSetString();
int condCount = 0;
 MapObject, Long lastResults = null;
Long one = new Long(1);
// by price
 if (minPrice  0 || maxPrice  0) {
condCount++;
ListString ids = indexService.getByPriceRange(minPrice, maxPrice);
 allIds.addAll(ids);
lastResults = addToChache(cache, one, ids);
}
 // by status
if (statusIds != null) {
condCount++;
 for (int i = 0; i  statusIds.length; i++) {
ListString listingByStatus =
indexService.getByListingStatus(statusIds[i]);
 allIds.addAll(listingByStatus);
lastResults = addToChache(cache, one, listingByStatus);
 }
}
// by house type
 if (houseTypesIds != null) {
condCount++;
for (int i = 0; i  houseTypesIds.length; i++) {
 ListString listingByHT = indexService.getByHouseType(houseTypesIds[i]);
allIds.addAll(listingByHT);
 lastResults = addToChache(cache, one, listingByHT);
}
}
 // by Zip Code
String[] zipCodes = parseZipCode(sc.getZipCode());
if (zipCodes != null  zipCodes.length  0) {
 condCount++;
for (int i = 0; i  zipCodes.length; i++) {
ListString listingByZ = indexService.getByZipCode(zipCodes[i]);
 allIds.addAll(listingByZ);
lastResults = addToChache(cache, one, listingByZ);
 }
}
if (lastResults != null) {
 MapObject, Object counters =
cache.getAll(Arrays.asList(allIds.toArray()));
ListString ids = new ArrayListString();
 for (Object listingNumber : counters.keySet()) {
String sCount = (String) counters.get(listingNumber);
 long count = Long.parseLong(sCount);
if (count  condCount) {
ids.add(listingNumber.toString());
 if (ids.size()500){
break;
}
 }
}
cache.clearAll();
 if (ids.size()  0) {
result = indexService.getEntriesOn(ids);
}
 }
return result;
}



hope it helps somebody
thanks
Karel

-- 
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: JPA 2.0 Support

2010-03-02 Thread datanucleus
The obvious question is ... what particular part of JPA2 are you
requiring access to ? JPA2 adds on various ORM related mapping
extensions, as well as JPQL Criteria, validation, and little else
really. The ORM features are of no relevance for GAE/J clearly.

DataNucleus 2.0 already implements JPA2, so it ought to be a matter of
GAE/J to update their plugin to use it (or for people like you to
contribute the updates necessary since it is open source). DN 2.0
isn't yet certified as JPA2 compliant since JPA2 is developed in
secret, and the TCK is not readily available (we requested it a month
ago and still nothing), though it passes our unit tests.

-- 
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] Multiple contains() in a query and exploding indexes

2010-03-02 Thread John Patterson

Hi Karel,

Keep in mind that each time you modify a list and put it in memcache  
the whole list is serialized which is why you see it is expensive.   
There is an efficient approach to merging queries that does not need  
memcahe that Bret Slatkin called the zig zag method:


http://www.scribd.com/doc/16952419/Building-scalable-complex-apps-on-App-Engine

It does not require the results to be in memory either so will work  
for large datasets.  You just need to make sure all the queries are  
sorted by the same property e.g. __key__


JD

On 2 Mar 2010, at 23:17, Karel Alvarez wrote:


Hi
Some time ago, I asked how to use multiple contains in a query, and  
I got some responses, that was great and I thank everybody for they  
help.


I am posting my findings and advance in hope it might be useful for  
somebody trying to do the same.
I am trying to build a database with real state listings in my area,  
and build some searches on it, the search is likely to have many  
fields, and several of the fields the user can select multiple  
values. I chose to handle the whole entity relationship myself  
instead of using the fancy features of GAE, I had my reasons for it,  
but frustration with GAE it is a part of it, regardless of that, the  
approach to searching might still apply if you chose to use  
relationships from GAE.


I read somewhere in the docs that when you use contains in a query,  
it internally it executes an equal sub-query for each of the values  
in the list, (somebody care to confirm that?) so if you have several  
fields with contains you might bump into the 30 sub-query constraint  
pretty fast.

So I choose to:
-execute the search by each one of the fields, and each ones of the  
selected values sequentially, get only the ids, each one of this  
should hit only one index, and be fast.
-add the results from each result to a memcache instance, using  
increment, collect the ids in a list for later (there is no way to  
get all the keys in the cache,that I found)
-collect the counts for each id in the list I got, and for each  
check the count, if the count is equal to the number of queries, it  
means that entity returned true for each of the queries and its an  
entity that I want to return, i collect all the ides that are good  
results, and go to the datastore to collect the full entities to  
return.


This process is expensive, and I still got to try it out with a a  
big set, but executes sufficiently fast for my test set, of course I  
cache the result until the user changes the search criteria (or  
expires).


Here is the code for the search method:

private ListIndexEntry buildResultsFor(SearchCriteria sc) {
ListIndexEntry result = new ArrayListIndexEntry();
// Price parsing
float minPrice = -1;
float maxPrice = -1;
if (sc.getMinPrice().length()  0) {
minPrice = Float.parseFloat(sc.getMinPrice());
}
if (sc.getMaxPrice().length()  0) {
maxPrice = Float.parseFloat(sc.getMaxPrice());
}
// Listing Status parsing
Long[] statusIds = null;
String[] statusNames = sc.getStatus();
if (statusNames != null  statusNames.length  0) {
statusIds = getListingStatusIdsByNames(statusNames);
}
// House Types parsing
Long[] houseTypesIds = null;
String[] houseTypeNames = sc.getHouseType();
if (houseTypeNames != null  houseTypeNames.length  0) {
houseTypesIds = getHouseTypeIdsByNames(houseTypeNames);
}
// THE search
MemcacheService cache = 
MemcacheServiceFactory.getMemcacheService();
SetString allIds = new HashSetString();
int condCount = 0;
MapObject, Long lastResults = null;
Long one = new Long(1);
// by price
if (minPrice  0 || maxPrice  0) {
condCount++;
			ListString ids = indexService.getByPriceRange(minPrice,  
maxPrice);

allIds.addAll(ids);
lastResults = addToChache(cache, one, ids);
}
// by status
if (statusIds != null) {
condCount++;
for (int i = 0; i  statusIds.length; i++) {
ListString listingByStatus =  
indexService.getByListingStatus(statusIds[i]);

allIds.addAll(listingByStatus);
lastResults = addToChache(cache, one, 
listingByStatus);
}
}
// by house type
if (houseTypesIds != null) {
condCount++;
for (int i = 0; i  

Re: [appengine-java] Multiple contains() in a query and exploding indexes

2010-03-02 Thread John Patterson
The zig zag method will help you with the AND part of your problem but  
the IN (OR) queries would need to be merged and ordered.  If each  
query is ordered by __key_ -  java.util.PriorityQueue could  
efficiently merge the parts of your IN query without needing to load  
them all into memory.  Then you could use the zig-zag method to  
combine (AND) the different IN queries.



On 2 Mar 2010, at 23:17, Karel Alvarez wrote:


Hi
Some time ago, I asked how to use multiple contains in a query, and  
I got some responses, that was great and I thank everybody for they  
help.


I am posting my findings and advance in hope it might be useful for  
somebody trying to do the same.
I am trying to build a database with real state listings in my area,  
and build some searches on it, the search is likely to have many  
fields, and several of the fields the user can select multiple  
values. I chose to handle the whole entity relationship myself  
instead of using the fancy features of GAE, I had my reasons for it,  
but frustration with GAE it is a part of it, regardless of that, the  
approach to searching might still apply if you chose to use  
relationships from GAE.


I read somewhere in the docs that when you use contains in a query,  
it internally it executes an equal sub-query for each of the values  
in the list, (somebody care to confirm that?) so if you have several  
fields with contains you might bump into the 30 sub-query constraint  
pretty fast.

So I choose to:
-execute the search by each one of the fields, and each ones of the  
selected values sequentially, get only the ids, each one of this  
should hit only one index, and be fast.
-add the results from each result to a memcache instance, using  
increment, collect the ids in a list for later (there is no way to  
get all the keys in the cache,that I found)
-collect the counts for each id in the list I got, and for each  
check the count, if the count is equal to the number of queries, it  
means that entity returned true for each of the queries and its an  
entity that I want to return, i collect all the ides that are good  
results, and go to the datastore to collect the full entities to  
return.


This process is expensive, and I still got to try it out with a a  
big set, but executes sufficiently fast for my test set, of course I  
cache the result until the user changes the search criteria (or  
expires).


Here is the code for the search method:

private ListIndexEntry buildResultsFor(SearchCriteria sc) {
ListIndexEntry result = new ArrayListIndexEntry();
// Price parsing
float minPrice = -1;
float maxPrice = -1;
if (sc.getMinPrice().length()  0) {
minPrice = Float.parseFloat(sc.getMinPrice());
}
if (sc.getMaxPrice().length()  0) {
maxPrice = Float.parseFloat(sc.getMaxPrice());
}
// Listing Status parsing
Long[] statusIds = null;
String[] statusNames = sc.getStatus();
if (statusNames != null  statusNames.length  0) {
statusIds = getListingStatusIdsByNames(statusNames);
}
// House Types parsing
Long[] houseTypesIds = null;
String[] houseTypeNames = sc.getHouseType();
if (houseTypeNames != null  houseTypeNames.length  0) {
houseTypesIds = getHouseTypeIdsByNames(houseTypeNames);
}
// THE search
MemcacheService cache = 
MemcacheServiceFactory.getMemcacheService();
SetString allIds = new HashSetString();
int condCount = 0;
MapObject, Long lastResults = null;
Long one = new Long(1);
// by price
if (minPrice  0 || maxPrice  0) {
condCount++;
			ListString ids = indexService.getByPriceRange(minPrice,  
maxPrice);

allIds.addAll(ids);
lastResults = addToChache(cache, one, ids);
}
// by status
if (statusIds != null) {
condCount++;
for (int i = 0; i  statusIds.length; i++) {
ListString listingByStatus =  
indexService.getByListingStatus(statusIds[i]);

allIds.addAll(listingByStatus);
lastResults = addToChache(cache, one, 
listingByStatus);
}
}
// by house type
if (houseTypesIds != null) {
condCount++;
for (int i = 0; i  houseTypesIds.length; i++) {
ListString listingByHT =  
indexService.getByHouseType(houseTypesIds[i]);

allIds.addAll(listingByHT);

[appengine-java] App upload failed

2010-03-02 Thread ast
Trying upload app:

./appcfg.sh update ../../../projects/appengine/myapp/www/

Reading application configuration data...
Encountered a problem: null
Please see the logs [/tmp/appcfgx2i014.log] for further information.

an...@ast:/mnt/sda1/projects/appengine/myapp$ cat /tmp/
appcfgx2i014.log
java.lang.NullPointerException
   at org.relaxng.datatype.helpers.DatatypeLibraryLoader$Service
$Loader2.getResources(libgcj.so.10)
   at org.relaxng.datatype.helpers.DatatypeLibraryLoader
$Service.init(libgcj.so.10)
   at
org.relaxng.datatype.helpers.DatatypeLibraryLoader.init(libgcj.so.
10)
   at gnu.xml.validation.xmlschema.XMLSchemaBuilder.init(libgcj.so.
10)
   at
gnu.xml.validation.xmlschema.XMLSchemaSchemaFactory.newSchema(libgcj.so.
10)
   at javax.xml.validation.SchemaFactory.newSchema(libgcj.so.10)
   at javax.xml.validation.SchemaFactory.newSchema(libgcj.so.10)
   at
com.google.appengine.tools.admin.Application.validateXml(Application.java:
319)
   at
com.google.appengine.tools.admin.Application.init(Application.java:
87)
   at com.google.appengine.tools.admin.application.readaan...@ast:/mnt/
sda1/projects/appengine/myapp

Same app was uploaded successfully from my home computer. Any
suggestions?

-- 
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 App Engine - ZK Modal Window Freezes

2010-03-02 Thread Norberto108
Hello,

I am creating a search window with this code, everything works fine in
eclipse, but when i put it online

Window pesquisa = (Window) 
Executions.createComponents(/principal/
comum/pesquisa.zul,winMain, map);
pesquisa.setParent(this);
pesquisa.doModal();

pesquisa.zul uses a listbox for browse records,

when i finally click on OK button

((WinMediumBasico) getFellow(Pesquisa).getParent()).
setMedium(MediumDAO.getInstance().
findById(((Medium)
lbMedium.getSelectedItem().getValue()).getId()));
this.onClose();

it don´t close the modal dialog.

public Medium findById(Key id) {
PersistenceManager pm = PMF.get().getPersistenceManager();
Medium medium = null;
try {
medium  = pm.getObjectById(Medium.class,id);
} catch (NoResultException nr) {
nr.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
} finally {
pm.close();
}
return medium;
}

I am not able to debug it, does someone can 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] Difficulty querying webserver through POSTing XML text

2010-03-02 Thread Joa
I am having difficulty POSTing and reading from a web server from GAE.
I can authenticate but the webserver does not accept the XML file I am
POSTing (which includes a query). I am not running the webserver in
question, so I have no insight into what might be wrong at that end
(or set it up differently).

First, a sanitized snippet of the curl statement that returns the
desired result (on OSX):
$ curl http://targetwebserver.org/servlet -u username:password -d '?
xml version=1.0 encoding=UTF-8 standalone=yes?Tag  /
Tag'
That to me confirm the webserver works alright.

Below now a snippet of the code (sanitized and rough) that I cannot
get to work. Again, authentication seems to work (I am not getting
responseCode 401), but whatever I have tried, I cannot get over
responseCode 400 and a corresponding boilerplate error message from
the webserver.

- snip ---
String requestString = ?xml version=1.0 encoding=UTF-8
standalone=yes?Tag  /Tag; // Also tried all sorts of
encoding, no luck
URL url = new URL(targetwebserver.org/servlet );
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod(POST);
conn.setDoOutput(true);
conn.setDoInput(true);
conn.addRequestProperty(Content-type, text/xml); // tried
application/xml as well, no luck

// Authenticate (seems to work OK)
String authData = username:password;
byte[] encodedAuthData = new
org.apache.commons.codec.binary.Base64().encode (authData.getBytes());
String authString = Basic ;
for (int i = 0; i  encodedAuthData.length; i++)
authString += (char)encodedAuthData[i];
conn.addRequestProperty (Authorization, authString);

// Post request
PrintWriter pw = new PrintWriter(conn.getOutputStream()); // tried
OutputStreamWriter as well, no luck
pw.println(requestString);
pw.close();

responseCode = conn.getResponseCode();
if (responseCode == 200) {
InputStream in = conn.getInputStream();
BufferedReader rd = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String line; while ((line = rd.readLine()) != null)
{ log.info(line); }
}
- snip ---

Please have a look at this - help's appreciated!

-- 
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] Datastore Error: No Source Attachment

2010-03-02 Thread ahawesome
Hello,

I've been working on an app which uses the datastore, and this is the
first time I've tested it out. When I attempted to add data, it didn't
seem to work. So, once I use Eclipse to debug the app, it gives me an
error saying that the source could not be found for a particular file
(no source attachment). The file is named appengine-api-1.0-
sdk-1.3.1.jar and resides in Eclipse's plugins directory (under where
the Google Plugin for Eclipse is installed).

I attempted to search for information regarding this error, but
nothing of use turned up. So, I was hoping that somebody here could
help me. I am using Eclipse with the Google App Engine plugin. GWT is
installed, but I am not using it for this app. I am more than willing
to provide any screenshots or other information needed to solve this
problem. I would like to have it fixed as soon as possible.

Thank you in advance!

Sincerely,
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] Datastore Error: No Source Attachment

2010-03-02 Thread John Patterson
Hi Alex, this is not an error so to speak - its just Eclipse telling  
you that it cannot show you the source code for internal app engine  
libraries because they are not available.


On 2 Mar 2010, at 12:47, ahawesome wrote:


Hello,

I've been working on an app which uses the datastore, and this is the
first time I've tested it out. When I attempted to add data, it didn't
seem to work. So, once I use Eclipse to debug the app, it gives me an
error saying that the source could not be found for a particular file
(no source attachment). The file is named appengine-api-1.0-
sdk-1.3.1.jar and resides in Eclipse's plugins directory (under where
the Google Plugin for Eclipse is installed).

I attempted to search for information regarding this error, but
nothing of use turned up. So, I was hoping that somebody here could
help me. I am using Eclipse with the Google App Engine plugin. GWT is
installed, but I am not using it for this app. I am more than willing
to provide any screenshots or other information needed to solve this
problem. I would like to have it fixed as soon as possible.

Thank you in advance!

Sincerely,
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-java@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: Request was aborted after waiting too long to attempt to service your request.

2010-03-02 Thread Kroc
Hello,
I'm developping an App (fullmetalgalaxy.com) with GWT/AppEngine and
I've got the same error in production server:
“Request was aborted after waiting too long to attempt to service your
request. Most likely, this indicates that you have reached your
simultaneous dynamic 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.”

My app may be poorly designed and I'm using a long pooling technique
for server push...
nevertheless I don't understand how I can exceed 30 simultaneous
dynamic request with only few client !

I though that web browser was able to handle only 2 simultaneous
request for a single domain name, if I'm right how can I exceed 30
requests with only few clients (less than 10) ?
Is there any other way to get this error ?

I'm using http filter for a good part of my static resources (mainly
to set cache lifetime), are these requests count as dynamics request ?
If yes, do I have another way to set cache lifetime (at least for
*.nocache.* and *.cache.* patern)

My long pooling request last for 26 sec but spend most of there time
in a “Thread.sleep()”... Are sleeping request count as one for all
simultaneous request ? I guest yes, but what other choice do I have to
do server push on AppEngine ?

Apparently enabling billing let application scale to around 500
request per second... How many in simultaneous dynamic request ? If I
don't exceed free quota, will enabling billing rise the max number of
simultaneous request ?

Thanks for your attention
Vincent

-- 
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: error deleting file in Blob Viewer

2010-03-02 Thread Houston startup coder
If we cannot delete blobs, will we have to pay for them?



On Mar 2, 10:15 am, Houston startup coder stephenh...@gmail.com
wrote:
 I found another thread relevant to this and it mentioned this 
 issue:http://code.google.com/p/googleappengine/issues/detail?id=2622

 So I starred that issue and left my info in a comment there.  Is there
 no way to delete a blob from code?  The documentation says this:

 If your app doesn't want to keep the blob, you should delete the blob
 immediately to prevent it from becoming orphaned.

 But I searched for delete on that page and didn't find a way to do
 it even though the implication is that there is a way.  :)

 Thanks,
 Stephen

 On Mar 2, 9:00 am, Houston startup coder stephenh...@gmail.com
 wrote:

  I tried to delete a file in Blob Viewer and every time, no matter if
  I'm attempting to delete one or several, I get this error:

  Server Error

  A server error has occurred.

  Return to Applications screen »

-- 
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: Request was aborted after waiting too long to attempt to service your request.

2010-03-02 Thread John Patterson


On 3 Mar 2010, at 00:22, Kroc wrote:


Hello,
I'm developping an App (fullmetalgalaxy.com) with GWT/AppEngine and
I've got the same error in production server:
“Request was aborted after waiting too long to attempt to service your
request. Most likely, this indicates that you have reached your
simultaneous dynamic 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.”


I have found I usually get this error when my app is loading and takes  
more than 10 seconds while another request come in.  Does your app  
take longer than 10 seconds to load?



My app may be poorly designed and I'm using a long pooling technique
for server push...
nevertheless I don't understand how I can exceed 30 simultaneous
dynamic request with only few client !

I though that web browser was able to handle only 2 simultaneous
request for a single domain name, if I'm right how can I exceed 30
requests with only few clients (less than 10) ?
Is there any other way to get this error ?

I'm using http filter for a good part of my static resources (mainly
to set cache lifetime), are these requests count as dynamics request ?
If yes, do I have another way to set cache lifetime (at least for
*.nocache.* and *.cache.* patern)


Set static resources and cache times in your appengine-web.xml.  That  
way Google serves them directly without hitting your app.




My long pooling request last for 26 sec but spend most of there time
in a “Thread.sleep()”... Are sleeping request count as one for all
simultaneous request ? I guest yes, but what other choice do I have to
do server push on AppEngine ?


I think there is no good solution on App Engine for server push.   
Polling would be the only option because as you say, simultaneous  
requests are limited.



Apparently enabling billing let application scale to around 500
request per second... How many in simultaneous dynamic request ? If I
don't exceed free quota, will enabling billing rise the max number of
simultaneous request ?


Its still 30 unless you get permission.


Thanks for your attention
Vincent

--
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-java@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: form to request being allowed to deploy the application multiple times

2010-03-02 Thread Houston startup coder
I finally found it in an old thread about multi tenant architecture
not generally being allowed on GAE:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/6ae2e6737cbb4b40/f47f015099538467?lnk=gstq=multiple+site#f47f015099538467

This is the exception request form:

http://code.google.com/support/bin/request.py?contact_type=AppEngineMultiInstanceExceptionRequest


However, from other stuff I remember reading a long time ago, I guess
this is not as much of a concern if I'm not deploying on multiple
domains.  I just want to be able to have multiple datastores (test,
QA, prod, that sort of thing), and in order to use the Blobstore in
each one I must have billing enabled, so I guess your automated
detection wouldn't pick that up as a violation since I'm paying for
the data, right?  I just didn't want it to sniff out that I have the
same code running around multiple datastores and shut me down thinking
I was trying to use as much free quota as possible.

Please let me know!

Thanks so much,
Stephen Huey


On Mar 2, 9:16 am, Houston startup coder stephenh...@gmail.com
wrote:
 I've been Googling all over this forum and the documentation, but I
 can't find the form I need to submit to the GAE team.  I am deploying
 multiple versions of my app (which are actually different apps) around
 the same datastore, and it has billing enabled.  But I also need to
 deploy this stuff again around a separate datastore for testing and I
 don't want the GAE police to shut me down.

 I remember coming across a form I can fill out to request exemption in
 my case.  Can someone please direct me to that?  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.



Re: [appengine-java] Why is java.security.AccessController on the whitelist?

2010-03-02 Thread Toby Reyelts
The purpose of AccessController is to perform an operation requiring
escalated permissions on behalf of code that doesn't have that permission.
For example, maybe you need to implement an authenticate(String user, String
password) function that needs to read from a password file that calling code
doesn't have permission to read from. The call stack might look something
like:

checkUser --- Untrusted caller doesn't have permission to read /etc/passwd
authenticate -- Your code does have permission.
AccessController.doPrivileged -- Escalate to your code's permission levels
readFromEtcPasswdAndCheck -- Now can do privileged read for untrusted code

In the context of GAE, all code in your application runs with the same
permissions. This means AccessController isn't needed, and you can write any
application without it.

However, we whitelist AccessController, because it improves compatibility.
For example, there are several Java libraries which need to use
AccessController when not running on GAE. By whitelisting AccessController,
we help these libraries run portably on GAE.

On Tue, Mar 2, 2010 at 4:20 AM, Yiming Li yiming...@umail.ucsb.edu wrote:

 Hi All,
When I was looking at the whitelist of GAE Java, it is
 interesting that I found java.security.AccessController class, and I
 don't quite understand in what scenario we need to use this class.
On the other hand, it may introduce some security issues,
 think about this code in a servlet:

public void doGet(HttpServletRequest req, final HttpServletResponse
 resp)
throws IOException {

AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
File dir2 = new File(/etc);
String[] children2 = dir2.list();
if (children2 == null) {

}
else { for (int i=0; ichildren2.length; i++)
{
try {
resp.getWriter().println(children2[i]);
} catch (IOException e) {
e.printStackTrace();
}
}
Thread t= new Thread(){

public void run() {
try {

  resp.getWriter().println(waaa);
} catch (IOException e) {
e.printStackTrace();
}
}

};t.run();

   return null;
}
});
 }
  The result page will print all file names under /etc
 directory, with waaa, which is the output of thread t.
  But fortunately, this will happen only on development
 server, and only if you have the permission to do view all files under
 /etc directory(but if you run the dev server with root permission
 accidentally, you can basically do anything).
  So my point is with java.security.AccessController class,
 you can easily get rid of the restriction of the sandbox, although
 only on the dev server. Can anybody give me an example of using
 java.security.AccessController in a legitimate way?
  Thank you very much.

 --
 Yiming
 MS student of CS Department @UCSB

 --
 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.



Re: [appengine-java] App upload failed

2010-03-02 Thread Toby Reyelts
It looks like you're using gcj. Can you use a different JVM, such as OpenJDK
or Sun's JDK?

On Tue, Mar 2, 2010 at 3:44 AM, ast anton.star...@gmail.com wrote:

 Trying upload app:

 ./appcfg.sh update ../../../projects/appengine/myapp/www/

 Reading application configuration data...
 Encountered a problem: null
 Please see the logs [/tmp/appcfgx2i014.log] for further information.

 an...@ast:/mnt/sda1/projects/appengine/myapp$ cat /tmp/
 appcfgx2i014.log
 java.lang.NullPointerException
   at org.relaxng.datatype.helpers.DatatypeLibraryLoader$Service
 $Loader2.getResources(libgcj.so.10)
   at org.relaxng.datatype.helpers.DatatypeLibraryLoader
 $Service.init(libgcj.so.10)
   at
 org.relaxng.datatype.helpers.DatatypeLibraryLoader.init(libgcj.so.
 10)
   at gnu.xml.validation.xmlschema.XMLSchemaBuilder.init(libgcj.so.
 10)
   at
 gnu.xml.validation.xmlschema.XMLSchemaSchemaFactory.newSchema(libgcj.so.
 10)
   at javax.xml.validation.SchemaFactory.newSchema(libgcj.so.10)
   at javax.xml.validation.SchemaFactory.newSchema(libgcj.so.10)
   at
 com.google.appengine.tools.admin.Application.validateXml(Application.java:
 319)
   at
 com.google.appengine.tools.admin.Application.init(Application.java:
 87)
   at com.google.appengine.tools.admin.application.readaan...@ast:/mnt/
 sda1/projects/appengine/myapp

 Same app was uploaded successfully from my home computer. Any
 suggestions?

 --
 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.



Re: [appengine-java] Re: Eclipse hangs at startup, Ubuntu

2010-03-02 Thread Jeff Schnitzer
The projects that cause the problem started life as Subclipse projects
but I were converted to Subversive with the detach, share process.  My
eclipse install is a new one with Subversive installed but not
Subclipse.  However, the conversion to Subversive happened quite a
while before the OS upgrade.

I finally couldn't take it anymore and created a whole new workspace
from scratch.  A very painful solution.

Jeff

On Tue, Mar 2, 2010 at 8:17 AM, Rajeev Dayal rda...@google.com wrote:
 That message corresponds to GPE's attempt to update your project's
 war/WEB-INF/lib folder on project classpath initialization, which occurs on
 Eclipse startup.
 Sometimes, problems can occur if there is some sort of lock being held on
 the files in that directory (such as by a version control plugin). Do you
 have any version control plugins installed in Eclipse?
 We've actually made some changes so that the update of war/WEB-INF/lib
 occurs on classpath change instead of classpath init. That should alleviate
 this sporadic issue. The fix will be available in a forthcoming version of
 GPE.

 On Mon, Mar 1, 2010 at 2:34 AM, Jeff Schnitzer j...@infohazard.org wrote:

 Did anyone ever resolve this in a consistent way?

 I recently upgraded from OSX 10.5 to 10.6, and now my Eclipse (Cocoa
 64-bit, as I was using before) hangs on most startups.  I see the
 Updating MyProje... - 1.3.1 in the bottom right corner and the
 entire window is locked up.  Only way out is to Force Quit.

 It doesn't happen on every startup.  I can often get it working after
 a few tries.

 This was a brand-new OS install on a new HD.  I did, however, copy my
 eclipse directory over by hand, and the workspace was imported as part
 of my user data.

 Jeff

 On Jan 14, 12:49 am, pgoetz pgo...@pgoetz.de wrote:
  Hi group,
 
  I have a problem with the Google Eclipse Plugin. I am developing an
  application for the Google App Engine (Eclipse JEE Galileo, Google
  Plugin 1.2.0, Google App Engine SDK 1.3.0, OS Ubuntu 9.10). Yesterday
  I reinstalled the Google Plugin and Google App Engine SDK after I got
  the same problem with an older version of the SDK.
  Today I started Eclipse and after the workspace comes up, I see the
  message Updating myproject/...ne - 1.3.0 in the status bar of
  Eclipse. I suspect that it means Updating myproject/Google App
  Engine - 1.3.0. With this message my whole Eclipse freezes and I can
  only kill the process.
  Does anybody know why that happens? And how can I prevent the plugin
  from performing the update?
  I had the same problem yesterday with the old setup and the solution
  was to remove the folders for the plugin from Eclipse plugins and
  features directories and to reinstall the plugin. Then it worked
  yesterday and crashed this morning.
 
  Thank you very much for your help!
 
  Greetings,
 
  Peter

 --
 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.



[appengine-java] Re: lost sub entity

2010-03-02 Thread Gunnar
I've uploaded my app to google with the same result, so it's not a
problem with Eclipse or sdk version.
Gunnar

On 1 mar, 20:59, John Patterson jdpatter...@gmail.com wrote:
 http://lmgtfy.com/?q=appengine+jdo+%22default+fetch+group%22

 On 2 Mar 2010, at 02:50, Gunnar wrote:

  I don't jnow what you mean with look into default fetch group!.
  Please explain.
  Gunnar

  On 1 mar, 19:20, John Patterson jdpatter...@gmail.com wrote:
  Did you look into default fetch group?

  On 2 Mar 2010, at 01:04, Gunnar wrote:

  Hi,
  I followed Jakes advice to do e.setList(list) but no change.
  I've also stepped through my code, but there is no exception!
  Btw I use version 1.3.1 of the SDK.
  Gunnar

  On 1 mar, 15:28, John Patterson jdpatter...@gmail.com wrote:
  It is unusual that you see no  stack trace.  Are you sure you are  
  not
  catching it?  You could step through the code line by line to see
  what
  happens after the line with the problem.

  Could this be something to do with setting the fetch group to
  default?  That seems to be the problem with a lot of peoples JDO
  code :)

  On 1 Mar 2010, at 21:19, Jake wrote:

  If I recall, JDO is picky when it comes to being aware of changes
  made
  to a persisted object.  For example, changing fields directly
  (object.field = newValue;) doesn't work - you need to use a  
  getter/
  setter (object.setField(newValue);).  Perhaps you are encountering
  the
  same issue here?  Does the following type of thing work?

  LIstSubEntity list = e.getMyList();
  SubEntity first = list.remove(0);
  list.add(first);
  e.setMyList(list);
  pm.makePersistent(e);
  tx.commit();

  Jake

  On Feb 28, 11:05 am, Gunnar gunnar@gmail.com wrote:
  Hi,
  John and Karel, you are right about the placement of the commit
  statement.
  It worked in the test example because I only had one instance of
  MyEntity.
  I don't get any exception at all in the Eclipse console!
  When I add a second instance of MyEntity if fails with  
  Transaction
  is
  not active as expected.

  Now I've changed the code in the try statement like this, but  
  still
  the first sub entity is lost and no exception is thrown!
  (Of cause it would fail it the list is empty.)

  ListMyEntity results = (ListMyEntity) query.execute();
          if (results.iterator().hasNext()) {
                  tx.begin();
                  MyEntity e = results.iterator().next();
                  ListSubEntity list = e.getMyList();
                  SubEntity first = list.remove(0);
                  boolean ok = list.add(first);
                  if (!ok) {
                          System.err.println(could not add  
  first);
                  }
                  System.out.println(list);
                  pm.makePersistent(e);
                  tx.commit();
          }

  On 28 Feb, 02:51, John Patterson jdpatter...@gmail.com wrote:

  This should be throwing an exception.  The JavaDocs for
  Transaction.commit() say
  Commits the transaction. Whether this call succeeds or fails,  
  all
  subsequent method invocations on this object will throw
  IllegalStateException.

  When something does not work as you expect the first place to  
  look
  is
  the logs under your application console.

  On 28 Feb 2010, at 05:25, Karel Alvarez wrote:

  dont you get any exceptions stacktrace  in the server  
  console? it
  would help... also you are calling commit() inside the for  
  loop,
  although the transactions is started only once... that would
  crash
  in the second iteration in a normal db server, I am not sure  
  what
  GAE does with it, in any case I dont think it is what you
  intended...

  On Sat, Feb 27, 2010 at 2:52 PM, Gunnar gunnar@gmail.com
  wrote:
  Hi,
  I have problem with reordering a List.
  I created a test with an entity called MyEntity which have a
  ListSubEntity.
  First I persist one instance of MyEntity with a list  
  containing 3
  SubEntity.
  This works fine. Then I call a reorder servlet that moves the
  first
  SubEntity to the last position in the list.
  The result is that the first SubEntity is lost and the  
  datastore
  only
  contains 2 SubEntity instances.
  What can be wrong?
  Here is the reorder code:

  package com.google.appengine.demo;

  import java.io.IOException;
  import java.util.List;

  import javax.jdo.PersistenceManager;
  import javax.jdo.Query;
  import javax.jdo.Transaction;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;

  @SuppressWarnings(serial)
  public class ReorderServlet extends HttpServlet {
        �...@suppresswarnings(unchecked)
         public void doGet(HttpServletRequest req,
  HttpServletResponse
  resp)
  throws IOException {
                 PersistenceManager pm =
  PMF.get().getPersistenceManager();
                 Query query = pm.newQuery(MyEntity.class);
                 Transaction tx = pm.currentTransaction();
                 try {
          

[appengine-java] number of tasks in queue

2010-03-02 Thread Nichole
Hello,

   In the near future will there be an API method to get the current
number of tasks in a queue?

Thanks for your time,
Nichole

-- 
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] (Java) App Engine (Servlet) - Google Buzz

2010-03-02 Thread Ikai L (Google)
The Buzz API is documented here:

http://code.google.com/apis/buzz/

http://code.google.com/apis/buzz/Just so you know - no write access yet.

On Tue, Mar 2, 2010 at 12:52 PM, Perry Dykes pdy...@gmail.com wrote:

 I would like to augment my app engine java servlet application to
 write status updates to a specific user in google buzz or a group. Is
 there an api and example to start with?

 --
 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
http://googleappengine.blogspot.com | http://twitter.com/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] App Engine Code sending emails from Our Domain not from google.com or How to avoid Spoofing

2010-03-02 Thread Kris
Using the Google App Engine settings panel we have registered a new
domain (e.g. OurDomain.com).The web of our application is now
reachable directly from that domain however emails sent from our App
Engine code are coming from Google.com instead of OurDomain.com.  This
then results in email security at Corporate America as seeing the
email as Spoofing who it is really from.
As expected the ‘Reply To’ does show up as OurDomain.com but the
important part, the From string in the SMTP headers is from mail-yw0-
f235.google.com

Is it possible on the Google App Engine to actually have emails, sent
via code, to originate from our domain to avoid spoofing?
If so, what are the steps to configure 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: Google Accounts are killing my application!....

2010-03-02 Thread Toby
Hello Ikai,

I guess many of us have the same problem. It would be good to have
some general advice on that.
Unfortunatly GAE only offers build in authentication for the admin
users or for users within a apps domain.

So what I did is a simple table with the users gmail addresses that
are allowed to access my app. If I can retrieve a user from the
content and his/her email corresponds to the one I have saved, I let
them in.
UserServiceFactory.getUserService().getCurrentUser()

If not I redirect them to the Google login page:
response.sendRedirect(UserServiceFactory.getUserService().createLoginURL(redirect));

This solution works quite well but somehow I do not like it. I have
the strong feeling that  I build something that must already be there
somehow.
Also users have not the option to add my site as trusted so they
have to log in whenever they come back to my page. I do not know how
to work around that.
The only advantage is that I can have alternatively the possibility
for users to create an extra account on my site...

You mentioned oauth and somewhere I read about friendconnect. I can
not see how exactly that fits into the framework. Why cant we just
have a google authentication build into GAE. With a users list as we
do for the account admins and a simple rule to throw into the web.xml.
+some way for users to self-register if the application developer
wants that.This way no-one needs to reinvent the wheel.

Does such a thing maybe already exist? Or is it on the road-map? Or is
there a good approach you would advice?

Thanks,

Toby




On Feb 22, 8:09 pm, Ikai L (Google) ika...@google.com wrote:
 Providing a login inside a frame is a compromise you should never, ever
 make. You're essentially training your users to be victims of phishing
 attacks. By providing a login in a frame, you're essentially removing every
 single security mechanism browsers provide to attempt to ensure users that
 the site they are on is really the site they are on and not a password
 stealing site. This is why many companies go out of their way to provide
 OAuth:http://oauth.net- because this allows client developers a way to
 authenticate users against another site's identity mechanism without having
 users send their credentials to a potentially untrusted site itself.

 Granted, there's a bit of a disconnect on login, but this is a price we'll
 have to pay just because this is one of the failings of browser security.
 Savvy users have already caught on to this, and more and more mainstream
 users will as well. This is a stopgap - when browsers are able to provide
 native authentication mechanisms, we shouldn't have to do this anymore, but
 we have a ways to go before this sort of thing will exist.

 On Sun, Feb 21, 2010 at 3:21 PM, John V Denley
 johnvden...@googlemail.comwrote:



  The frame works fine when logging in. If its a security risk please
  elaborate, Im onlt using Google accounts because I dont really know
  how to do my own security, and Im guessing that even using google via
  a frame is more secure than trying to do it myself!

  When creating an account it does not take the user back to the
  original page as there is a total disconnect after the user clicks on
  the link in the email sent from google. Google have informed me that
  this is a known issue, but has a low priority (which is
  understandable).

  I have now created what I think is a reasonable compromise. Only time
  will tell if our potential customers are ok with the process!

  On Feb 18, 7:04 pm, Brian bwa...@gmail.com wrote:
   You shouldn't use a frame. It is a security problem, and right of
   google login code to break out of it.

   After they make a new account, if not using a frame, I believe it
   forwards the user back to the page they were trying to go to. Seems to
   work pretty well.

   On Feb 18, 8:40 am, John V Denley johnvden...@googlemail.com wrote:

I have been trying to leverage google accounts for security for my
users, but the way its working is really preventing useability within
my application, its very frustrating

Ive just spent the best part of the last week trying to get the google
account login to work in an frame within my application. Ive run into
a number of related issues (see other threads in the GWT group) which
I have manage to work through finally. (Thanks to everyone who helped
out and provided input)

However, I have just tried clicking on the create an account now
link which is what will be used by any new user who doesnt currently
have a google account, but the account creation window has frame
breakout code on it, which takes my users away from my application
again, and then after clicking on the email link to confirm thier new
account, the user is NOT taken back to my application but are just
congratulated for creating a google account.

The problem is that the user is then left thinking now what do i do?
and several of the people 

Re: [appengine-java] Re: Google Accounts are killing my application!....

2010-03-02 Thread Ikai L (Google)
It'll have to work similar to how OAuth works with a window redirect. The
issue with domains is that Users will be giving their credentials to a
potentially untrustworthy site, and this isn't something we want our users
to do.

We can certainly do more with authentication. For instance, if you are
logged into your Google account and go to YouTube, if you click log in,
it'll log you in and redirect you. The user sees a bit of a delay as the
redirects take place, but it's otherwise invisible. We could probably do
something like this if you have logged into the given application before.
One issue is with revocation: we'd need to build something into the global
Google Accounts infrastructure that allows for OAuth-like granting and
revocation of access to specific applications.

On Tue, Mar 2, 2010 at 1:53 PM, Toby toby.ro...@gmail.com wrote:

 Hello Ikai,

 I guess many of us have the same problem. It would be good to have
 some general advice on that.
 Unfortunatly GAE only offers build in authentication for the admin
 users or for users within a apps domain.

 So what I did is a simple table with the users gmail addresses that
 are allowed to access my app. If I can retrieve a user from the
 content and his/her email corresponds to the one I have saved, I let
 them in.
 UserServiceFactory.getUserService().getCurrentUser()

 If not I redirect them to the Google login page:

 response.sendRedirect(UserServiceFactory.getUserService().createLoginURL(redirect));

 This solution works quite well but somehow I do not like it. I have
 the strong feeling that  I build something that must already be there
 somehow.
 Also users have not the option to add my site as trusted so they
 have to log in whenever they come back to my page. I do not know how
 to work around that.
 The only advantage is that I can have alternatively the possibility
 for users to create an extra account on my site...

 You mentioned oauth and somewhere I read about friendconnect. I can
 not see how exactly that fits into the framework. Why cant we just
 have a google authentication build into GAE. With a users list as we
 do for the account admins and a simple rule to throw into the web.xml.
 +some way for users to self-register if the application developer
 wants that.This way no-one needs to reinvent the wheel.

 Does such a thing maybe already exist? Or is it on the road-map? Or is
 there a good approach you would advice?

 Thanks,

 Toby




 On Feb 22, 8:09 pm, Ikai L (Google) ika...@google.com wrote:
  Providing a login inside a frame is a compromise you should never, ever
  make. You're essentially training your users to be victims of phishing
  attacks. By providing a login in a frame, you're essentially removing
 every
  single security mechanism browsers provide to attempt to ensure users
 that
  the site they are on is really the site they are on and not a password
  stealing site. This is why many companies go out of their way to provide
  OAuth:http://oauth.net- because this allows client developers a way to
  authenticate users against another site's identity mechanism without
 having
  users send their credentials to a potentially untrusted site itself.
 
  Granted, there's a bit of a disconnect on login, but this is a price
 we'll
  have to pay just because this is one of the failings of browser security.
  Savvy users have already caught on to this, and more and more mainstream
  users will as well. This is a stopgap - when browsers are able to provide
  native authentication mechanisms, we shouldn't have to do this anymore,
 but
  we have a ways to go before this sort of thing will exist.
 
  On Sun, Feb 21, 2010 at 3:21 PM, John V Denley
  johnvden...@googlemail.comwrote:
 
 
 
   The frame works fine when logging in. If its a security risk please
   elaborate, Im onlt using Google accounts because I dont really know
   how to do my own security, and Im guessing that even using google via
   a frame is more secure than trying to do it myself!
 
   When creating an account it does not take the user back to the
   original page as there is a total disconnect after the user clicks on
   the link in the email sent from google. Google have informed me that
   this is a known issue, but has a low priority (which is
   understandable).
 
   I have now created what I think is a reasonable compromise. Only time
   will tell if our potential customers are ok with the process!
 
   On Feb 18, 7:04 pm, Brian bwa...@gmail.com wrote:
You shouldn't use a frame. It is a security problem, and right of
google login code to break out of it.
 
After they make a new account, if not using a frame, I believe it
forwards the user back to the page they were trying to go to. Seems
 to
work pretty well.
 
On Feb 18, 8:40 am, John V Denley johnvden...@googlemail.com
 wrote:
 
 I have been trying to leverage google accounts for security for my
 users, but the way its working is really preventing useability
 within
 my 

[appengine-java] Re: Flash arcade game GAE based

2010-03-02 Thread kazunori_279
Tim,

But isn't it so expensive to use the AMF/HTTP comet technique on the
appengine? CPU usage can be extremely high. Or you have to use AMF/
HTTP polling which is not so responsive for gaming.

Thanks,

Kaz

On Mar 2, 7:43 pm, tsp...@green20now.com tsp...@green20now.com
wrote:
 Take a look at GraniteDS or other AMF supporting tools. I am using GraniteDS 
 to push data to a Flex client.
 It is fairly simple to setup so you can perform trsting and find the 
 limitations which would impact your game.

 Tim

 Sent from my Verizon Wireless Phone

 - Reply message -
 From: Jeff Schnitzer j...@infohazard.org
 Date: Tue, Mar 2, 2010 3:50 AM
 Subject: [appengine-java] Flash arcade game GAE based
 To: google-appengine-java@googlegroups.com

 It would be extraordinarily difficult to use Appengine for this sort
 of project.  You probably want a server framework that supports
 persistent connections and in-memory state that won't disappear when a
 memcache server is flushed.

 Here's a good starting point:  
 http://en.wikipedia.org/wiki/List_of_game_engines

 Jeff



 On Sat, Feb 27, 2010 at 11:58 PM, Ahmed Khalifa derkhal...@gmail.com wrote:
  hi all,
  I am writing a multiplayer flash arcade game in actionscript .. i have
  discovered GAE recently and thought that it might be a very good
  choice for building and hosting my server ..
  however, i realize that arcade games need an almost realtime
  responsive capacity from the server .. besides the server has to be
  looping on receiving position object of Client A, storing it in a DB,
  Fetching Client B position object and sending it back .. this will
  result in a huge number of DB requests either storing, fetching or
  deleting which will quickly exhaust the CPU quota for the
  application ..

  So, I was wondering if any one had an idea or a reference to come
  around these two problems of real time response and CPU exhaustion by
  DB calls

  best regards,
  A. Khalifa

  --
  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 at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Flash arcade game GAE based

2010-03-02 Thread kazunori_279
FYI, I always use another messaging server along with appengine, on
EC2 or something, which runs a socket relay server or Tornado (Python
based long polling server).

And I think WebSockets is the way to go for us in future ultimately :)

Thanks,

Kaz

On Mar 3, 7:51 am, kazunori_279 kazunori...@gmail.com wrote:
 Tim,

 But isn't it so expensive to use the AMF/HTTP comet technique on the
 appengine? CPU usage can be extremely high. Or you have to use AMF/
 HTTP polling which is not so responsive for gaming.

 Thanks,

 Kaz

 On Mar 2, 7:43 pm, tsp...@green20now.com tsp...@green20now.com
 wrote:

  Take a look at GraniteDS or other AMF supporting tools. I am using 
  GraniteDS to push data to a Flex client.
  It is fairly simple to setup so you can perform trsting and find the 
  limitations which would impact your game.

  Tim

  Sent from my Verizon Wireless Phone

  - Reply message -
  From: Jeff Schnitzer j...@infohazard.org
  Date: Tue, Mar 2, 2010 3:50 AM
  Subject: [appengine-java] Flash arcade game GAE based
  To: google-appengine-java@googlegroups.com

  It would be extraordinarily difficult to use Appengine for this sort
  of project.  You probably want a server framework that supports
  persistent connections and in-memory state that won't disappear when a
  memcache server is flushed.

  Here's a good starting point:  
  http://en.wikipedia.org/wiki/List_of_game_engines

  Jeff

  On Sat, Feb 27, 2010 at 11:58 PM, Ahmed Khalifa derkhal...@gmail.com 
  wrote:
   hi all,
   I am writing a multiplayer flash arcade game in actionscript .. i have
   discovered GAE recently and thought that it might be a very good
   choice for building and hosting my server ..
   however, i realize that arcade games need an almost realtime
   responsive capacity from the server .. besides the server has to be
   looping on receiving position object of Client A, storing it in a DB,
   Fetching Client B position object and sending it back .. this will
   result in a huge number of DB requests either storing, fetching or
   deleting which will quickly exhaust the CPU quota for the
   application ..

   So, I was wondering if any one had an idea or a reference to come
   around these two problems of real time response and CPU exhaustion by
   DB calls

   best regards,
   A. Khalifa

   --
   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 at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] GCacheException: Policy prevented put operation

2010-03-02 Thread Andrei
I got few of those today
Isn't it only for maintenance mode?

com.google.appengine.api.memcache.stdimpl.GCacheException: Policy
prevented put operation

-- 
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: Request was aborted after waiting too long to attempt to service your request.

2010-03-02 Thread Kroc

 I have found I usually get this error when my app is loading and takes  
 more than 10 seconds while another request come in.  Does your app  
 take longer than 10 seconds to load?

Hum yes it may be this...
But I don't know how to measure the loading time and how to reduce it.
If a remove some useless jar file ?

Vincent

-- 
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: App Engine cold starts and overly aggressive cycling

2010-03-02 Thread David Peters
Hi.. I apologize for reviving this post, but this problem is really
hitting me hard.  I have an interactive fiction site
(www.friedfiction.com) that has been experiencing some terrible
response times over the past month.  After investigating, it appears
that my app is cold starting almost every two minutes.  If someone is
filling out a form or reading a story, and they've been idle for more
than two minutes -- they have to wait approx 10-20 seconds for the app
to cold start before it can process their request.  This is giving my
site a bad reputation.

- What is your application ID?  friedfic

- How do you know it is being cycled out? You'll need to insert some
code
that only gets called when the app cold starts.
Logging the servlet init

- How much time of inactivity does it take before your application is
cycled
out?
Every 2 minutes

- What time or days does this seem to happen?
All the time

- What frameworks or libraries are you loading?
GWT, AntiSamy

On Jan 15, 6:32 pm, Ikai Lan i...@google.com wrote:
 Hey everybody,

 We've been seeing more and more reports of applications being cycled out
 overly aggressively, resulting in some folks implementing (discouraged)
 workarounds to keep their application from being cycled out. The primary
 symptom of this problem is that your application will see lots of loading
 requests that fire up a new JVM, which, as many of you know can take
 anywhere from a few seconds with naked servlets to as much as twenty seconds
 when loading something like Spring MVC, JRuby on Rails or Grails.

 In theory, there is enough capacity such that as long as you get some
 traffic every few hours, you should not be getting cycled out, but we have
 been seeing reports of applications being cycled after only a minute or
 less. To help us figure out if these are app specific issues or App Engine
 issues, can you post the following information if you believe this is
 happening to you?

 - What is your application ID?
 - How do you know it is being cycled out? You'll need to insert some code
 that only gets called when the app cold starts.
 - How much time of inactivity does it take before your application is cycled
 out?
 - What time or days does this seem to happen?
 - What frameworks or libraries are you loading?

 Any other information you can provide would be helpful.

 --
 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] Sporadic problems with very high response times

2010-03-02 Thread Michael
Looking at my App Engine logs, I see troubling results when viewing
the response times for requests.  In my current log set, the first 80
requests all complete in under 100 ms with less than 100 ms of cpu or
api time.  Then, oddly, the 83rd request, from the exact same client
with the exact same request parameters, takes 7,192 ms to respond with
10,123 cpu ms (and 12 api ms).

These kinds of spikes are dotted throughout my logs.  They occur in
less than 1% of cases, as far as I can tell, but the spikes are not
just large; they're enormous.  I know for a fact that the request
parameters and returned data were identical to the requests several
seconds before and after from the same client, but the request took
about 20 times longer to serve.

Does anyone know what causes these large spikes in response time, and
can anyone share tricks to help alleviate these spikes?  I know that
it is somehow related to instantiating the JVM, but I don't know:
- how to reduce the startup time of the JVM
- how to predict when GAE will try to start a new JVM

Thanks in advance for any advice,
- Michael

-- 
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 use junit test in the newest SDK1.3.1

2010-03-02 Thread Ed Murphy
Thanks for starting this thread.  I have my Junit tests working,
including my datastore tests, but I have a question regarding project
setup.  I suppose this is more of an Eclipse question than anything
else, but perhaps you can help.  I've worked in NetBeans prior, and I
can setup a 'test' folder with my unit test source.  These classes are
excluded from the final war file. However, when I create a test folder
at the same level as my source folder:

Project
- src
- test

the only way I can make my tests work is to include test as a source
folder and add all the testing jars to my normal build path.  This
means my test classes end up in the deployment.

Can I have my tests in the same project as my source, or do I need to
have a separate project?

Thanks for you help.



On Feb 11, 10:43 am, Krishna Caldas krishnacal...@gmail.com wrote:
 Yes, I missed that method.
 Maybe add this little trick on tutorial for now!?

 Krishna

 2010/2/11 Max Ross (Google) maxr+appeng...@google.com:



  Great, glad to hear it!  I forgot to add a method to LocalServiceTestHelper
  to set a custom app id.  My mistake.  I'll make sure this gets added for the
  next release so you don't need to provide your ownEnvironment
  implementation.

  Max

  On Thu, Feb 11, 2010 at 10:30 AM, Krishna Caldas krishnacal...@gmail.com
  wrote:

  You're right!
  I refactored my code and forget to annotate the new setUp method with
  @Before.
  Sorry for taking your time! It works now.

  Thanks,
  Krishna

  2010/2/11 Max Ross (Google) maxr+appeng...@google.com:
   Your code looks fine.  Are you sure you're calling setUp() on the
   LocalServiceTestHelper?

   On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas
   krishnacal...@gmail.com
   wrote:

   Ooops.. missed your question!
   It's just:
  @Override
  protectedEnvironmentnewEnvironment() {
  return new TestEnvironment();
  }

   Thanks,
   Krishna

   2010/2/11 Max Ross (Google) maxr+appeng...@google.com:
Subclassing LocalServiceTestHelper and overriding newEnvironment()
should
work fine.  What does your implementation of newEnvironment() look
like?

On Wed, Feb 10, 2010 at 7:35 PM, Krishna krishnacal...@gmail.com
wrote:

Ok!

But when I'm using transactions I'm getting:

java.lang.NullPointerException:NoAPIenvironmentisregisteredfor
thisthread.
   at

com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(Datas
 toreApiHelper.java:
67)
   at

com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(Da
 tastoreServiceImpl.java:
270)

I've tried to extend LocalServiceTestHelper and overwrite
newEnvironment()  with myEnvironment(who returns appId) but it
didn't work...

What's wrong?

Thanks,
Krishna

On Feb 10, 10:25 pm, Ikai L (Google) ika...@google.com wrote:
 We've got a more simple interface for you now. Take a look:

http://code.google.com/appengine/docs/java/tools/localunittesting.html

 2010/2/10 时空之蕊 skzr@gmail.com

  I found the class
  com.google.appengine.tools.development.ApiProxyLocalImpl is not
  public,but before 1.3.1 it's public!
  In the JUnit document:

  import java.io.File;
  import com.google.appengine.tools.development.ApiProxyLocalImpl;
  import com.google.apphosting.api.ApiProxy;

  ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)){});

  So I can't new a ApiProxyLocalImpl instance!
  Any body know how to use JUnit?
  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.comgoogle-appengine-java%2B
  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

 Enginehttp://googleappengine.blogspot.com|http://twitter.com/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 

[appengine-java] 「sdc_internet_routing : NO_MATCHI NG_RESOURCE」 when trying to fetch URL via SDC

2010-03-02 Thread smile laugh
hello everyone

I cannot fetch intranet resource via sdc.

The following are my setting, Could someone kindly help me out:

my localConfig.xml:
entity
  sdcServerHostapps-secure-data-connector.google.com/sdcServerHost
  sdcServerPort443/sdcServerPort
  domainmydomain.com/domain
  usersecure-data-connector-user/user
  passwordmypwd/password
  agentIdagent_mydomain/agentId
  socksServerPort1080/socksServerPort
  sshd/etc/opt/google-secure-data-connector/openssh/start_sshd.sh/
sshd
  healthCheckGadgetUsersadmi...@mydomain.com/
healthCheckGadgetUsers
/entity

my resourceRules.xml:
resourceRules
  rule repeatable=true
ruleNum1/ruleNum
agentIdagent_mydomain/agentId
viewerEmail repeatable=trueadmi...@mydomain.com/
viewerEmail
apps repeatable=true
  serviceAppEngine/service
  allowAnyAppIdtrue/allowAnyAppId
/apps
urlhttp://myintranetIP:8080/tomcat.gif/url
urlMatchHOSTPORT/urlMatch
  /rule
/resourceRules

my  java sourcecode:
URL dataURL = new URL(http://myintranetIP:8080/tomcat.gif?X-
secureDataConnectorDebug=text);
HTTPRequest fetchreq = new HTTPRequest(dataURL);
fetchreq.setHeader(new HTTPHeader(use_intranet,yes));
HTTPResponse fetchresp = fetcher.fetch(fetchreq);
resp.setContentType(text/plain);
resp.getWriter().print(new String(fetchresp.getContent()));

Actual results:
request_user : admi...@mydomain.com
request_sdc_agent_domain : mydomain.com
request_url : 
http://myintranetIP:8080/tomcat.gif?X-secureDataConnectorDebug=text
request_service : AppEngine
request_appId : myappid
request_requestId : (Id = bf33d834f932802d)
sdc_routing : Internet
sdc_internet_routing : NO_MATCHING_RESOURCE
response_sdc_status : ok
response_content_size : 0

BTW:
and I have open ports(8080 , 1080) in the firewall between sdc server
and intranet webserver ,
I can fetch the intranet resource by executing a java program in sdc
server.

when use netstat in sdc server , I can see the connection between gae
and my sdc server is ESTABLISHED.

thanks 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.



Re: [appengine-java] Re: Flash arcade game GAE based

2010-03-02 Thread tspear
Kaz,
Not sure about the CPU (we are still at the proof of concept stage for
using GAE). We are using the polling aspect since our business
requires updates with 5-15 minutes. Its not very time intensive like a
game would be.

Good luck,

Tim

 Tim,

 But isn't it so expensive to use the AMF/HTTP comet technique on the
 appengine? CPU usage can be extremely high. Or you have to use AMF/
 HTTP polling which is not so responsive for gaming.

 Thanks,

 Kaz

 On Mar 2, 7:43 pm, tsp...@green20now.com tsp...@green20now.com
 wrote:
 Take a look at GraniteDS or other AMF supporting tools. I am using
 GraniteDS to push data to a Flex client.
 It is fairly simple to setup so you can perform trsting and find the
 limitations which would impact your game.

 Tim

 Sent from my Verizon Wireless Phone

 - Reply message -
 From: Jeff Schnitzer j...@infohazard.org
 Date: Tue, Mar 2, 2010 3:50 AM
 Subject: [appengine-java] Flash arcade game GAE based
 To: google-appengine-java@googlegroups.com

 It would be extraordinarily difficult to use Appengine for this sort
 of project.  You probably want a server framework that supports
 persistent connections and in-memory state that won't disappear when a
 memcache server is flushed.

 Here's a good starting point:
  http://en.wikipedia.org/wiki/List_of_game_engines

 Jeff



 On Sat, Feb 27, 2010 at 11:58 PM, Ahmed Khalifa derkhal...@gmail.com
 wrote:
  hi all,
  I am writing a multiplayer flash arcade game in actionscript .. i have
  discovered GAE recently and thought that it might be a very good
  choice for building and hosting my server ..
  however, i realize that arcade games need an almost realtime
  responsive capacity from the server .. besides the server has to be
  looping on receiving position object of Client A, storing it in a DB,
  Fetching Client B position object and sending it back .. this will
  result in a huge number of DB requests either storing, fetching or
  deleting which will quickly exhaust the CPU quota for the
  application ..

  So, I was wondering if any one had an idea or a reference to come
  around these two problems of real time response and CPU exhaustion by
  DB calls

  best regards,
  A. Khalifa

  --
  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 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 get testing working with anything other than the default queue

2010-03-02 Thread David Chandler
I'm using the workaround above and it's reading my queue.xml
correctly; however, when I call runTask() I am getting a connection
refused exception. Does the AppEngine test environment provide a
servlet container or mock thereof for running the task servlet? The
task servlet is configured in my web.xml and works fine in dev and
prod, but not in unit tests, so I'm guessing I need to wire in a
lightweight servlet container in test also... would appreciate any
pointers.

INFO: Local task queue initialized with base url http://localhost:8080
Mar 2, 2010 11:33:05 PM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing
request: Connection refused: connect
Mar 2, 2010 11:33:05 PM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request

Thank you,
/dmc

On Feb 16, 6:08 pm, Max Ross (Google) maxr+appeng...@google.com
wrote:
 Sorry Will, we look for ./WEB-INF/queue.xml by default.  Anyway glad you got
 it working with the workaround.  I'll get this straightened out for the next
 release.

 Max

 On Tue, Feb 16, 2010 at 11:41AM, Will Bunker w...@thebunkers.com wrote:
  I put in queue.xml in the test directory and it didn't seem to find
  it.

  On Feb 16, 10:47am, Max Ross (Google) 
  maxr+appeng...@google.commaxr%2bappeng...@google.com

  wrote:
   I see.  In the test environment it looks in . by default so if you
  place
   queue.xml in the directory from which you're executing the test it should
   pick it up.I

   On Tue, Feb 16, 2010 at 10:35AM, Will Bunker w...@thebunkers.com
  wrote:
I am saying that it is not reading queue.xml.  I am testing to make
sure a certain function puts x number tasks in a queue that is not
the default.  It doesn't load the queue.xml file unless I use your
workaround (then it works great.)

On Feb 16, 10:21am, Max Ross (Google) 
maxr+appeng...@google.commaxr%2bappeng...@google.com
  maxr%2bappeng...@google.com maxr%252bappeng...@google.com

wrote:
 By default the LocalTaskQueueTestConfig configures the local task
  queue
 service to not automatically execute tasks:
   http://code.google.com/appengine/docs/java/tools/localunittesting/jav.
  ..

 Or are you saying it's not reading queue.xml?

 On Tue, Feb 16, 2010 at 10:16AM, Will Bunker w...@thebunkers.com
wrote:
  Actually it doesn't seem to be reading the queue at all.  It is
  coming
  from the standard directory in WAR, but doesn't seem to pick it up.
   I
  am on Mac OS if that makes any difference.

  On Feb 16, 9:35am, Max Ross (Google) 
  maxr+appeng...@google.commaxr%2bappeng...@google.com
  maxr%2bappeng...@google.com maxr%252bappeng...@google.com
maxr%2bappeng...@google.com maxr%252bappeng...@google.com 
  maxr%252bappeng...@google.com maxr%25252bappeng...@google.com

  wrote:
   Hi Will,

   You're loading queue.xml from a different location in your unit
tests?
   This
   is a use case I didn't thoroughly consider.  I can certainly fix
  this
for
   the next release but let me see if I can find a workaround for
  you.

   Thanks,
   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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com

google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com
  google-appengine-java%252bunsubscr...@googlegroups.comgoogle-appengine-java%25252bunsubscr...@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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  .
  For more 

Re: [appengine-java] Re: Flash arcade game GAE based

2010-03-02 Thread nicolas melendez
I want to do the same. Is there any good XMPP Java framework to include in
my Applet? recomendations?
Thanks
NM

On Tue, Mar 2, 2010 at 11:31 PM, tsp...@green20now.com wrote:

 Kaz,
Not sure about the CPU (we are still at the proof of concept stage for
 using GAE). We are using the polling aspect since our business
 requires updates with 5-15 minutes. Its not very time intensive like a
 game would be.

 Good luck,

 Tim

  Tim,
 
  But isn't it so expensive to use the AMF/HTTP comet technique on the
  appengine? CPU usage can be extremely high. Or you have to use AMF/
  HTTP polling which is not so responsive for gaming.
 
  Thanks,
 
  Kaz
 
  On Mar 2, 7:43 pm, tsp...@green20now.com tsp...@green20now.com
  wrote:
  Take a look at GraniteDS or other AMF supporting tools. I am using
  GraniteDS to push data to a Flex client.
  It is fairly simple to setup so you can perform trsting and find the
  limitations which would impact your game.
 
  Tim
 
  Sent from my Verizon Wireless Phone
 
  - Reply message -
  From: Jeff Schnitzer j...@infohazard.org
  Date: Tue, Mar 2, 2010 3:50 AM
  Subject: [appengine-java] Flash arcade game GAE based
  To: google-appengine-java@googlegroups.com
 
  It would be extraordinarily difficult to use Appengine for this sort
  of project.  You probably want a server framework that supports
  persistent connections and in-memory state that won't disappear when a
  memcache server is flushed.
 
  Here's a good starting point:
   http://en.wikipedia.org/wiki/List_of_game_engines
 
  Jeff
 
 
 
  On Sat, Feb 27, 2010 at 11:58 PM, Ahmed Khalifa derkhal...@gmail.com
  wrote:
   hi all,
   I am writing a multiplayer flash arcade game in actionscript .. i have
   discovered GAE recently and thought that it might be a very good
   choice for building and hosting my server ..
   however, i realize that arcade games need an almost realtime
   responsive capacity from the server .. besides the server has to be
   looping on receiving position object of Client A, storing it in a DB,
   Fetching Client B position object and sending it back .. this will
   result in a huge number of DB requests either storing, fetching or
   deleting which will quickly exhaust the CPU quota for the
   application ..
 
   So, I was wondering if any one had an idea or a reference to come
   around these two problems of real time response and CPU exhaustion by
   DB calls
 
   best regards,
   A. Khalifa
 
   --
   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
  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.comgoogle-appengine-java%2bunsubscr...@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.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.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] Re: Difficulty querying webserver through POSTing XML text

2010-03-02 Thread Joa

Any takers? I've carried the code over to a regular Java Application
and it runs through without a hitch. Hmm, looks I am stuck with a GAE
bug?


On Mar 2, 6:54 am, Joa joachim.pfeif...@gmail.com wrote:
 I am having difficulty POSTing and reading from a web server from GAE.
 I can authenticate but the webserver does not accept the XML file I am
 POSTing (which includes a query). I am not running the webserver in
 question, so I have no insight into what might be wrong at that end
 (or set it up differently).

 First, a sanitized snippet of the curl statement that returns the
 desired result (on OSX):
 $ curlhttp://targetwebserver.org/servlet-u username:password -d '?
 xml version=1.0 encoding=UTF-8 standalone=yes?Tag  /
 Tag'
 That to me confirm the webserver works alright.

 Below now a snippet of the code (sanitized and rough) that I cannot
 get to work. Again, authentication seems to work (I am not getting
 responseCode 401), but whatever I have tried, I cannot get over
 responseCode 400 and a corresponding boilerplate error message from
 the webserver.

 - snip ---
 String requestString = ?xml version=1.0 encoding=UTF-8
 standalone=yes?Tag  /Tag; // Also tried all sorts of
 encoding, no luck
 URL url = new URL(targetwebserver.org/servlet );
 HttpURLConnection conn = (HttpURLConnection)url.openConnection();
 conn.setRequestMethod(POST);
 conn.setDoOutput(true);
 conn.setDoInput(true);
 conn.addRequestProperty(Content-type, text/xml); // tried
 application/xml as well, no luck

 // Authenticate (seems to work OK)
 String authData = username:password;
 byte[] encodedAuthData = new
 org.apache.commons.codec.binary.Base64().encode (authData.getBytes());
 String authString = Basic ;
 for (int i = 0; i  encodedAuthData.length; i++)
         authString += (char)encodedAuthData[i];
 conn.addRequestProperty (Authorization, authString);

 // Post request
 PrintWriter pw = new PrintWriter(conn.getOutputStream()); // tried
 OutputStreamWriter as well, no luck
 pw.println(requestString);
 pw.close();

 responseCode = conn.getResponseCode();
 if (responseCode == 200) {
         InputStream in = conn.getInputStream();
         BufferedReader rd = new BufferedReader(new
 InputStreamReader(conn.getInputStream()));
         String line; while ((line = rd.readLine()) != null)
 { log.info(line); }}

 - snip ---

 Please have a look at this - help's appreciated!

-- 
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: Difficulty querying webserver through POSTing XML text

2010-03-02 Thread Joa

OK, please disregard. Issue resolved.
org.apache.commons.codec.binary.Base64().encode()
adds control characters \r\n to the end of the authorization string.
Although this should keep the response code add 401, it doesn't, so I
was looking at the wrong spot last night. Hope this helps somebody
else out who might run into a similar problem.




On Mar 2, 9:49 pm, Joa joachim.pfeif...@gmail.com wrote:
 Any takers? I've carried the code over to a regular Java Application
 and it runs through without a hitch. Hmm, looks I am stuck with a GAE
 bug?

 On Mar 2, 6:54 am, Joa joachim.pfeif...@gmail.com wrote:

  I am having difficulty POSTing and reading from a web server from GAE.
  I can authenticate but the webserver does not accept the XML file I am
  POSTing (which includes a query). I am not running the webserver in
  question, so I have no insight into what might be wrong at that end
  (or set it up differently).

  First, a sanitized snippet of the curl statement that returns the
  desired result (on OSX):
  $ curlhttp://targetwebserver.org/servlet-uusername:password -d '?
  xml version=1.0 encoding=UTF-8 standalone=yes?Tag  /
  Tag'
  That to me confirm the webserver works alright.

  Below now a snippet of the code (sanitized and rough) that I cannot
  get to work. Again, authentication seems to work (I am not getting
  responseCode 401), but whatever I have tried, I cannot get over
  responseCode 400 and a corresponding boilerplate error message from
  the webserver.

  - snip ---
  String requestString = ?xml version=1.0 encoding=UTF-8
  standalone=yes?Tag  /Tag; // Also tried all sorts of
  encoding, no luck
  URL url = new URL(targetwebserver.org/servlet );
  HttpURLConnection conn = (HttpURLConnection)url.openConnection();
  conn.setRequestMethod(POST);
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.addRequestProperty(Content-type, text/xml); // tried
  application/xml as well, no luck

  // Authenticate (seems to work OK)
  String authData = username:password;
  byte[] encodedAuthData = new
  org.apache.commons.codec.binary.Base64().encode (authData.getBytes());
  String authString = Basic ;
  for (int i = 0; i  encodedAuthData.length; i++)
          authString += (char)encodedAuthData[i];
  conn.addRequestProperty (Authorization, authString);

  // Post request
  PrintWriter pw = new PrintWriter(conn.getOutputStream()); // tried
  OutputStreamWriter as well, no luck
  pw.println(requestString);
  pw.close();

  responseCode = conn.getResponseCode();
  if (responseCode == 200) {
          InputStream in = conn.getInputStream();
          BufferedReader rd = new BufferedReader(new
  InputStreamReader(conn.getInputStream()));
          String line; while ((line = rd.readLine()) != null)
  { log.info(line); }}

  - snip ---

  Please have a look at this - help's appreciated!

-- 
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: App upload failed

2010-03-02 Thread ast
I removed gcj from the system, and now everything works, thanks!
But, I can't understand why appengine chose GCJ rather than Sun's JDK.

On 2 мар, 22:13, Toby Reyelts to...@google.com wrote:
 It looks like you're usinggcj

 gcj. Can you use a different JVM, such as OpenJDK
 or Sun's JDK?



 On Tue, Mar 2, 2010 at 3:44 AM, ast anton.star...@gmail.com wrote:
  Trying upload app:

  ./appcfg.sh update ../../../projects/appengine/myapp/www/

  Reading application configuration data...
  Encountered a problem: null
  Please see the logs [/tmp/appcfgx2i014.log] for further information.

  an...@ast:/mnt/sda1/projects/appengine/myapp$ cat /tmp/
  appcfgx2i014.log
  java.lang.NullPointerException
    at org.relaxng.datatype.helpers.DatatypeLibraryLoader$Service
  $Loader2.getResources(libgcj.so.10)
    at org.relaxng.datatype.helpers.DatatypeLibraryLoader
  $Service.init(libgcj.so.10)
    at
  org.relaxng.datatype.helpers.DatatypeLibraryLoader.init(libgcj.so.
  10)
    at gnu.xml.validation.xmlschema.XMLSchemaBuilder.init(libgcj.so.
  10)
    at
  gnu.xml.validation.xmlschema.XMLSchemaSchemaFactory.newSchema(libgcj.so.
  10)
    at javax.xml.validation.SchemaFactory.newSchema(libgcj.so.10)
    at javax.xml.validation.SchemaFactory.newSchema(libgcj.so.10)
    at
  com.google.appengine.tools.admin.Application.validateXml(Application.java:
  319)
    at
  com.google.appengine.tools.admin.Application.init(Application.java:
  87)
    at com.google.appengine.tools.admin.application.readaan...@ast:/mnt/
  sda1/projects/appengine/myapp

  Same app was uploaded successfully from my home computer. Any
  suggestions?

  --
  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%2B 
  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] How do you transfer a ListJdoObject from server to client?

2010-03-02 Thread Stephen Wills
Hello,
I have been wanting to know how to do this for a while now, but don't know
where to find information on how to do this. I simply want to know how to
setup my project so I can have a JDO object in the server package (so I
can use classes like com.google.appengine.api.datastore.Key and
javax.jdo.listener.StoreCallback), and request a list of those objects from
my client side code. Currently I store my JDO object in my client package.
So when a user clicks a button to retrieve all the People objects I can get
back a ListPeople. I'm sure these are some fundamentally basic steps I
just don't know to acheive. Do you need a persistent object on the server
side and a transfer object on the client? If so how do you send the data to
the transfer object. Thanks

currently have: (and want it instead in com.myapp.server but also to
retrieve say ListPeople )
in com.myapp.client

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.gwt.user.client.rpc.IsSerializable;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class People implements IsSerializable {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long pKeyRiderID;

@Persistent
private String lastName;
...


currently in com.myapp.server:
private ListPeople get() {
PersistenceManager pm = PMF.get().getPersistenceManager();

ListPeople result = null;
try {
String q = select from  + People.class.getName();
result = new ArrayListPeople((ListPeople)
pm.newQuery(q).execute());
} finally {
pm.close();
}
return result;
}

-- 
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: multiple inserts/update/delete problem

2010-03-02 Thread legendlink
thanks!

On Mar 2, 12:28 pm, Chau Huynh cmhu...@gmail.com wrote:
 You can try searching the error in the group,
 it was QA many times, and explained in detail cant operate on multiple
 entity groups in a single transaction
 site:groups.google.comhttp://tinyurl.com/yeto4to



 On Tue, Mar 2, 2010 at 8:06 AM, legendlink gregc...@gmail.com wrote:
  hi,

  i have tried to insert multiple insert, using multiple
  pm.makePersistent calls,
  but exceprion always occurrs.
  exception thrown:
   javax.jdo.jdofataluserexception:illegal argument
  cant operate on multiple entity groups in a single transaction

  i wanted to try to do batch inserts.
  all of the entities should be successfully inserted because they are
  related to each other
  i also tried the pm.makePersistentAll but a single request to
  datastore is limited to 1mb.

  is there a workaround or am i doing it the wrong way?
  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.comgoogle-appengine-java%2B 
  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] elegant way of implementing sequence generator

2010-03-02 Thread legendlink
hi, i wanted to have a sequence generator that increments by x value
everytime it generates a value. if i would create the sequence
generator by using the datastore, it is likely that data contention
would occurr if there is high access times.

i have looked into the sample code of max ross in the google code
repository (SequenceExamplesJDO.java) and  think this is limited to
increment by 1 only and not increment by x value.

if sharding technique is used, my concern is that i might not get the
right sequence.

what is the best/elegant way of doing sequence generator that
increments x value?

-- 
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.