[appengine-java] Re: Expires header automatically added (bug?)

2010-03-01 Thread Peter Ondruska
Could you provide some code please?

On Mar 1, 9:06 am, George  Moschovitis george.moschovi...@gmail.com
wrote:
  I do use Expires header as well and it works as expected. For statis
  resources you define explicit expiration using appengine-web.xml.

 It did work as expected.
 Now the Expires header is added automatically to *dynamic* request,
 even for request that don't require it.

 -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.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-01 Thread George Moschovitis
 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.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-01 Thread Peter Ondruska
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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Unable to establish HTTPS communication

2010-03-01 Thread vmaatta
Hi,

You should cast the return from openConnection() to HttpURLConnection:

URL requestURL = new URL(url);
HttpURLConnection connection = (HttpURLConnection)
requestURL.openConnection();

Depending on what you need to do you might not need to open the
connection at all. It might be better to use the stream and readers
like shown in the URL Fetch documentation you referenced (http://
code.google.com/appengine/docs/java/urlfetch/overview.html).

Br,
Ville


On Feb 27, 9:15 pm, Persevering apo...@gmail.com wrote:
 Hi All,

 I am new to Google app and trying to build an application that would
 load some data from other site over hppts. Below is my code that is
 working in other applications but i am getting some errors with google
 app engine.

 Initially compiler is throwing error like
         - sun.net.www.protocol.https.HttpsURLConnectionImplis not supported
 by Google App Engine's Java runtime environment.

 My code is:
 java.net.URL requestURL = new URL(url);
 HttpsURLConnectionImpl h =
 (HttpsURLConnectionImpl)requestURL.openConnection();

 and somehow i complied it using solution available at http://
 74.125.153.132/search?q=cache:http://blog.frankel.ch/tag/google; but i
 got error on local Development environment as mentioned below:

 com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler
 $Connection cannot be cast to
 sun.net.www.protocol.https.HttpsURLConnectionImpl
 java.lang.ClassCastException:
 com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler
 $Connection cannot be cast to
 sun.net.www.protocol.https.HttpsURLConnectionImpl

 I have also gone 
 throughhttp://code.google.com/appengine/docs/java/urlfetch/overview.html
 but no luck.

 Please let me know how can i solve it.

 Thanks.

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



[appengine-java] Re: lost sub entity

2010-03-01 Thread Jake
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 {
                          tx.begin();
                          ListMyEntity results = (ListMyEntity)  
   query.execute();
                          if (results.iterator().hasNext()) {
                                  for (MyEntity e : results) {
                                          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();
                                  }
                          }
                  } catch (Exception e) {
                          e.printStackTrace();
                  } finally {
                          if (tx.isActive())
                                  tx.rollback();
                          query.closeAll();
                          pm.close();
                  }
              

[appengine-java] Re: Spreadsheets and GAE

2010-03-01 Thread praseed
Thanks Lior and Stephen.

Good Info.

In my situation, these are excel simple spreadsheets (with no formulas
or macros etc..,). Customers download these spreadsheets, work on them
and when they are done, they upload these to the site.
As they upload, I need to validate that indeed they are the same
spreadsheets they downloaded and that their entries are fine. Then, I
show all successful entries in a grid.
Then they verify , change, add whatever they want and basically
commit.

I would have used Apache POI..but, now I am curious if Google's
spreadhsheet API may be sufficient for this.  I also need to see if
users can open these spreadsheets in their respective excel version
and save and upload those into the web app.

I guess I will need to do some digging. Are there any good web
resources for this API? Or is the Google getting started doc is just
fine.

Thanks
Praseed


On Mar 1, 2:30 am, Houston startup coder stephenh...@gmail.com
wrote:
 How complex are these spreadsheets?  If all you need to do is upload
 some basic data, then have them save it as CSV and upload that into
 GAE.  I'm assuming your spreadsheets are complex enough that you need
 them to actually be Microsoft Excel files.

 Lior's response made me consider your actual use case and it sounds
 like it could be worthwhile for you to try using the Google
 Spreadsheets API.  I had considered it but my spreadsheet needs are
 slightly different, and you can read about my decision 
 here:http://stephenhuey.wordpress.com/2010/01/01/docxgae/

 Although I used the GaeVFS virtual file system in that blog post, you
 can actually do plenty of the typical file stuff in memory and just
 write out to the Blobstore.  Basically, I needed my users to be able
 to download data in full-fledged Microsoft Excel spreadsheets, and
 since the traditional Java libraries out there aren't supported on
 GAE, I chose to use Microsoft's xlsx format which is a zip file
 consisting of text files and images.  In case that sounds terrible,
 note that I'm using FreeMarker to help me modify template XML files,
 and that does make things a little bit cleaner.

 So in a nutshell, you can work with bona fide Microsoft Excel files on
 GAE if you use the xlsx file format and not the older xls file
 format.

 - Stephen Huey

 On Mar 1, 1:14 am, Lior Harsat lior.har...@gmail.com wrote:



  Hi Praseed,

  my application uses the google spreadsheet api for importing data. I
  have learned the following lessons from it:
  1. performance is not great. the api runs over http and is limited to
  GAE request timeout (5 to 10) seconds. on some cases a single request
  exceed this time and you are required to handle these timeout (retry)
  2. API inconsistencies. The API is not that stable. some of the
  examples posted on Google simply do not work. it could be very
  frustrating.
  3. google spreadsheets are nice for low volume data. Handling masses
  of data is difficult. copy paste is limited. limited formulas
  (comparing to Excel) . very basic scripting support. you should really
  play with it and verify that your end user won't get frustrated with
  it.
  4. accessing the spreadsheet requires authentication. it may be an
  overhead for your end users unless you handle it for them.

  Having said all of the above I still recommend it as it is free,
  doesn't require leaving the google API realm, and will probably mature
  over time.
  you need to make a deep analysis of your requirement to make sure the
  above limitation won't become showstoppers.

  Thanx, Lior

  On Feb 28, 6:41 pm, praseed prase...@gmail.com wrote:

   Hi all,

    New here.

    My app requires users to upload spreadsheets. The server has to make
   the data available on a grid (GWT)..the user then makes changes if any
   and press import.. This is when the data is stored in the data store
   in appropriate entities.

   Questions .

    If this is not GAE, i would have stored the uploaded file in the
   filesystem; used Apache POI to parse the file from a GWT-RPC service
   and return it to a GWT grid. Then, upon user selection, commit the
   data to persistence. Are there better (read: easier) ways to do this
   under GAE? Can I make use of the Spreadsheet Data API to do this
   instead? Do I need to store the file at all in that case?
   Is there something in the Google Docs Upload API I should be using?

   Since I am already committed to GAE and GWT, I wanted to make things
   as simpler as it can be. If I can avoid other external
   libraries..great.

   Thoughts?

   Cheers
   praseed

-- 
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: Can not fetch record from DB

2010-03-01 Thread Jake
Hey,

getUserQuery.setFilter(userLogin == vLogin AND password ==
vPassword).  Not  but AND.

Keep in mind, the filter is JDOQL (?), not Java.

Jake

On Feb 27, 11:05 am, Andriy Andrunevchyn diyko...@gmail.com wrote:
 Don't work all get methods
 I've changed method according your advice it didn't help
 public UserModel getUserByLoginAndPassword(String login, String
 password) {
                 PersistenceManager pm = getPersistenceManager();
                 Query getUserQuery = pm.newQuery(UserModel.class);
                 getUserQuery.setFilter(userLogin == vLogin  password ==
 vPassword);
                 getUserQuery.declareParameters(String vLogin, String 
 vPassword);

                 UserModel result = null;
                 try {
                         ListUserModel list = (ListUserModel) 
 getUserQuery.execute(
                                         login, password);
                         if (!list.isEmpty()) {
                                 result = list.get(0);
                         }
                 } finally {
                         getUserQuery.closeAll();
                         releasePersistenceManager(pm);
                 }
                 return result;
         }
 Following method throw strange exception
 public UserModel getUserByLogin(String login) {
                 PersistenceManager pm = getPersistenceManager();
                 Query getUserQuery = pm
                                 .newQuery(select from UserModel userLogin == 
 vLogin parameters
 String vLogin);
                 /*
                  * getUserQuery.setFilter(userLogin == vLogin);
                  * getUserQuery.declareParameters(String vLogin);
                  */
                 UserModel user = null;
                 try {
                         ListUserModel result = (ListUserModel) 
 getUserQuery
                                         .execute(login);
                         if (!result.isEmpty())
                                 user = result.get(0);
                 } finally {
                         getUserQuery.closeAll();
                         releasePersistenceManager(pm);
                 }
                 return user;
         }

 org.datanucleus.store.appengine.FatalNucleusUserException: Candidate
 class could not be found: SELECT FROM UserModel userLogin == vLogin
 PARAMETERS String vLogin
 Perhaps I've forgotten some jdo configuration
 Does anybody know how to fix it?

-- 
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: Can not fetch record from DB

2010-03-01 Thread Jake
BAH!  Sorry.  I'm wrong - it supports .  Un-Send.  Facepalm.

Regardless, I think the error still lies in the JDOQL syntax.
http://www.jpox.org/docs/1_2/jdo/jdoql.html

Jake

On Mar 1, 9:23 am, Jake jbrooko...@cast.org wrote:
 Hey,

 getUserQuery.setFilter(userLogin == vLogin AND password ==
 vPassword).  Not  but AND.

 Keep in mind, the filter is JDOQL (?), not Java.

 Jake

 On Feb 27, 11:05 am, Andriy Andrunevchyn diyko...@gmail.com wrote:

  Don't work all get methods
  I've changed method according your advice it didn't help
  public UserModel getUserByLoginAndPassword(String login, String
  password) {
                  PersistenceManager pm = getPersistenceManager();
                  Query getUserQuery = pm.newQuery(UserModel.class);
                  getUserQuery.setFilter(userLogin == vLogin  password ==
  vPassword);
                  getUserQuery.declareParameters(String vLogin, String 
  vPassword);

                  UserModel result = null;
                  try {
                          ListUserModel list = (ListUserModel) 
  getUserQuery.execute(
                                          login, password);
                          if (!list.isEmpty()) {
                                  result = list.get(0);
                          }
                  } finally {
                          getUserQuery.closeAll();
                          releasePersistenceManager(pm);
                  }
                  return result;
          }
  Following method throw strange exception
  public UserModel getUserByLogin(String login) {
                  PersistenceManager pm = getPersistenceManager();
                  Query getUserQuery = pm
                                  .newQuery(select from UserModel userLogin 
  == vLogin parameters
  String vLogin);
                  /*
                   * getUserQuery.setFilter(userLogin == vLogin);
                   * getUserQuery.declareParameters(String vLogin);
                   */
                  UserModel user = null;
                  try {
                          ListUserModel result = (ListUserModel) 
  getUserQuery
                                          .execute(login);
                          if (!result.isEmpty())
                                  user = result.get(0);
                  } finally {
                          getUserQuery.closeAll();
                          releasePersistenceManager(pm);
                  }
                  return user;
          }

  org.datanucleus.store.appengine.FatalNucleusUserException: Candidate
  class could not be found: SELECT FROM UserModel userLogin == vLogin
  PARAMETERS String vLogin
  Perhaps I've forgotten some jdo configuration
  Does anybody know how to fix it?

-- 
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: lost sub entity

2010-03-01 Thread John Patterson
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 {
   tx.begin();
   ListMyEntity results = (ListMyEntity)
query.execute();
   if (results.iterator().hasNext()) {
   for (MyEntity e : results) {
   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();
   }
   }
   } catch (Exception e) {
   e.printStackTrace();
   } finally {
   if (tx.isActive())

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

2010-03-01 Thread A1programmer
You can use memcache to help speed up access to the DB.

All communication over GAE has to be done using HTTP... So, that makes
it harder to things like pushing real time messages to the clients.
You can use a technique called Long Polling, but requests must
return in 30 seconds, and currently, applications have a max of 30
simultaneous requests.

Basically, the request starts a thread that sleeps most of the time,
waiting to return data to the client when it's ready.  One the client
receives the update, it makes another long polling request.

Hope this helps.

- Derrick

On Feb 28, 2:58 am, 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 at 
http://groups.google.com/group/google-appengine-java?hl=en.



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

2010-03-01 Thread Ahmed Khalifa
thanks for the reply ..
are there any other servers/hosts that provide a near real time client/
server communication??
Plus, i don't exactly get your part about the long polling and 30
simultanous requests limit .. can you elaborate more
regards,


On Mar 1, 4:55 pm, A1programmer derrick.simp...@gmail.com wrote:
 You can use memcache to help speed up access to the DB.

 All communication over GAE has to be done using HTTP... So, that makes
 it harder to things like pushing real time messages to the clients.
 You can use a technique called Long Polling, but requests must
 return in 30 seconds, and currently, applications have a max of 30
 simultaneous requests.

 Basically, the request starts a thread that sleeps most of the time,
 waiting to return data to the client when it's ready.  One the client
 receives the update, it makes another long polling request.

 Hope this helps.

 - Derrick

 On Feb 28, 2:58 am, 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 at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Citical Security error in Accounts Java API: request.getUserPrincipal() gets wrong username/email

2010-03-01 Thread Houston startup coder
Ikai, what you said makes sense to me, but in the last week I've been
seeing something a little different with Safari (version 4.0.4).  I
protect some App Engine URLs in the app by requiring authentication
based on Google Apps, and in order to easily access those URLs in
testing, I simply log the browser into Google Apps first (e.g. Mail).
Or when I'm not signed into Google Apps and try to access the URL, it
has me do Google Apps authentication, and then I can access both the
URL and Mail.  But in Firefox 3.5.8, the authentication is
independent, so if I've authenticated for my App Engine URL and sign
out of Mail, I can still access the App Engine URL in the browser.

Stephen Huey


On Feb 25, 3:01 am, Thomas Schnocklake
thomas.schnockl...@googlemail.com wrote:
 Yes, i implemented this already. I developped the widget in GAE in Java.
 There I used OAuth to authenticate against the gdata-api. Then I stored the
 combination of usern...@gappdomain.xxx and the OAuth accesskey in the GAE
 persistant storage. Everything works fine. So when i log in google apps the
 includes Gadget reads the logged in username
 (request.getUserPrincipal().getName() )) and searches with this username for
 the OAuth key.
 But than the problem: sometimes the username
 (request.getUserPrincipal().getName() ) is wrong, so i read the data (e.g.
 Contacts List) of the wrong user.

 So actuelly I don't need a solution for authentication but I need to know
 which user is actually really logged in to google apps.

 Any ideas?

 This should be a quite important topic for all developpers who want to
 enhance google apps with gae, isn' t it?

 thanks

 2010/2/25 Ikai L (Google) ika...@google.com

  Probably OAuth, though I'm not sure how that will work with a gadget. In
  most places gadgets will include a user ID with the makeRequest.

  On Tue, Feb 23, 2010 at 12:23 PM, Thomas Schnocklake 
  thomas.schnockl...@googlemail.com wrote:

  Thank you for your answer.

  So what would you suppose to use for authentication for a gadget that is
  places in google apps (e.g. gmail, google sites ) ?

  thanks

  thomas

  2010/2/18 Ikai L (Google) ika...@google.com

  Yes, this seems to make sense. Being logged into Google Apps is
  independent of being logged into an App Engine application. They don't use
  the same cookie. App Engine's User service allows you to use Google 
  logins,
  but not the Google Apps session.

  On Tue, Feb 16, 2010 at 3:29 AM, tsschnoc 
  thomas.schnockl...@googlemail.com wrote:

  Hello,

  I use App Engine in my Google Apps domain and restricted the
  authentification of app
  engine to my apps domain. (see
 http://code.google.com/appengine/articles/auth.html
  )
  I developed a widget and use this in multiple accounts of my google
  apps domain.
  When i switch from one account (of my apps domain) to the other, the
  former account is displayed in the widget (Java:
  request.getUserPrincipal().getName() ).

  So the gadget placed on my Google Apps Inbox displays data of a user
  different to the user logged in to google apps.

  I noticed that the problems goes away when i wait some minutes
  ( session expiration ?? ).

  see picture:

 http://picasaweb.google.com/lh/photo/QDcR2Lgk2xI2-UQ77BoGXw?feat=dire...

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

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

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

2010-03-01 Thread Valentino Hankypants
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: Scheduled Tasks aborted early

2010-03-01 Thread Eugene Kuleshov
John,

  My application is hardly used right now, so there is certainly NO
other requests coming in. So, I still don't understand why execution
is cut after 10 seconds instead of promised 30 seconds.

  With such limitation GAE for Java is practically making impossible
to use the most popular web framework (i.e. Spring MVC + Spring
Security + Spring Core), but I'd be interested to hear how you can
replace such stack with something based on Guice.

  regards,
  Eugene


On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:
 You get this message when you app is still starting while other  
 requests come in.  The only current solution is to reduce start up  
 time - pinging is not a satisfactory solution because you still get  
 frequent loading requests.  With Guice I was able to reduce star up  
 by using a non AOP version which did no bytecode enhancement.  Also,  
 try delaying initialising components until they are needed.

 On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:



   I have Java application deployed on the appengine and it has several
  job definitions. However I see that Scheduled Tasks are aborted within
  10 seconds from the start, even so corresponding FAQ entry states 30
  seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li...

   This is a big problem for any applications using Springframework,
  which has startup time about 20 seconds.

   Here is corresponding entry from the log file for one of the
  executions of such scheduled task.

  ---
    1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
       See details

       0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET /fetch.htm?...
  HTTP/1.1 500 0 - - ipsc-stats.appspot.com

    2. W 02-28 02:45PM 49.160

       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.htmlfor more details.
  ---

   Can you please advise what could be done in such and if I am missing
  anything obvious?

   Thanks

   Eugene

  --
  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 
  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: Scheduled Tasks aborted early

2010-03-01 Thread Eugene Kuleshov

  Also, that this 10 seconds issue actually appear mostly when my
scheduled tasks are kicked, so in result they never start, even so
user requests from the regular UI are coming trough. It seem like this
problem been introduced recently

  Thanks

  Eugene


On Mar 1, 11:35 am, Eugene Kuleshov ekules...@gmail.com wrote:
 John,

   My application is hardly used right now, so there is certainly NO
 other requests coming in. So, I still don't understand why execution
 is cut after 10 seconds instead of promised 30 seconds.

   With such limitation GAE for Java is practically making impossible
 to use the most popular web framework (i.e. Spring MVC + Spring
 Security + Spring Core), but I'd be interested to hear how you can
 replace such stack with something based on Guice.

   regards,
   Eugene

 On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:

  You get this message when you app is still starting while other  
  requests come in.  The only current solution is to reduce start up  
  time - pinging is not a satisfactory solution because you still get  
  frequent loading requests.  With Guice I was able to reduce star up  
  by using a non AOP version which did no bytecode enhancement.  Also,  
  try delaying initialising components until they are needed.

  On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:

    I have Java application deployed on the appengine and it has several
   job definitions. However I see that Scheduled Tasks are aborted within
   10 seconds from the start, even so corresponding FAQ entry states 30
   seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li...

    This is a big problem for any applications using Springframework,
   which has startup time about 20 seconds.

    Here is corresponding entry from the log file for one of the
   executions of such scheduled task.

   ---
     1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
        See details

        0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET /fetch.htm?...
   HTTP/1.1 500 0 - - ipsc-stats.appspot.com

     2. W 02-28 02:45PM 49.160

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

    Can you please advise what could be done in such and if I am missing
   anything obvious?

    Thanks

    Eugene

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



Re: [appengine-java] JSF 2 on GAE getting java.io.NotSerializableException: javax.faces.component.html.HtmlSelectManyListbox after trying to run from production

2010-03-01 Thread Joel Weight
Hi Daniel,

Looking at the javadoc for HtmlSelectManyListbox (
http://java.sun.com/javaee/javaserverfaces/2.0/docs/api/javax/faces/component/html/HtmlSelectManyListbox.html
)
it looks like it doesn't implement Serializable.  Since you are binding to
it in a session scoped bean, you must have a reference to it in your bean,
then it looks like GAE is trying to serialize the session, which includes
your bound instance of that class.

This is all just guesswork based on your stack trace.  If it were my code, I
would probably try to figure out how to do what I need to do without binding
jsf controls in my managed beans.

Joel

On Sun, Feb 28, 2010 at 3:19 PM, Daniel vedm...@gmail.com wrote:

 Hi

 I got a small JSF 2 application with 1 managed bean defined as
 @SessionScoped and i just added a HtmlSelectManyListbox and did
 binding to it from  h:selectManyListbox
 all works 100% from local server, but after deploying im getting
 exception...

 and i did add implements Serializable to the class

 and added private static final long serialVersionUID

 my gae sdk version is:
 Your SDK:
 Release: 1.3.0
 Timestamp: Mon Dec 14 20:47:37 IST 2009
 API versions: [1.0]



 This the exception


 java.lang.RuntimeException: java.io.NotSerializableException:
 javax.faces.component.html.HtmlSelectManyListbox
at

 com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:
 361)
at

 com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession(SessionManager.java:
 341)
at com.google.apphosting.runtime.jetty.SessionManager
 $AppEngineSession.save(SessionManager.java:162)
at

 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
 41)
at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1084)
at

 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
 43)
at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1084)
at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
 360)
at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
 216)
at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
 181)
at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
 712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
 405)
at

 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
 238)
at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
 139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
 506)
at org.mortbay.jetty.HttpConnection
 $RequestHandler.headerComplete(HttpConnection.java:830)
at

 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
 76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at

 com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
 135)
at
 com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
 235)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
 $6.handleBlockingRequest(RuntimePb.java:5485)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
 $6.handleBlockingRequest(RuntimePb.java:5483)
at

 com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
 24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
 363)
at com.google.net.rpc.impl.Server$2.run(Server.java:837)
at
 com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:
 56)
at

 com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:
 536)
at com.google.net.rpc.impl.Server.startRpc(Server.java:792)
at com.google.net.rpc.impl.Server.processRequest(Server.java:367)
at

 com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
 448)
at
 com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:
 319)
at
 com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
 290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:
 474)
at

 com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:
 774)
at
 com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:
 205)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
 101)
at
 com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:
 251)
at com.google.apphosting.runtime.JavaRuntime
 $RpcRunnable.run(JavaRuntime.java:394)
 

Re: [appengine-java] Re: Scheduled Tasks aborted early

2010-03-01 Thread John Patterson

Hi Eugene,

All it takes are two requests to see that error - the first to start  
the application loading and then any other request (even a request for  
a css file or refreshing the page) will wait 10 seconds and then throw  
that exception.  It is rare that a single page does not need more than  
one request.


In my opinion this loading request problem is the biggest hidden  
gotcha that should be written in big red letters on the introduction  
page.  It could end up requiring you to discard the frameworks you are  
accustomed to using.


Something which helped me was to split my app into an admin version  
and a user facing client version.  That reduced the loading time of  
the client version significantly.


On 1 Mar 2010, at 23:35, Eugene Kuleshov wrote:


John,

 My application is hardly used right now, so there is certainly NO
other requests coming in. So, I still don't understand why execution
is cut after 10 seconds instead of promised 30 seconds.

 With such limitation GAE for Java is practically making impossible
to use the most popular web framework (i.e. Spring MVC + Spring
Security + Spring Core), but I'd be interested to hear how you can
replace such stack with something based on Guice.

 regards,
 Eugene


On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:

You get this message when you app is still starting while other
requests come in.  The only current solution is to reduce start up
time - pinging is not a satisfactory solution because you still get
frequent loading requests.  With Guice I was able to reduce star up
by using a non AOP version which did no bytecode enhancement.  Also,
try delaying initialising components until they are needed.

On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:



 I have Java application deployed on the appengine and it has  
several
job definitions. However I see that Scheduled Tasks are aborted  
within

10 seconds from the start, even so corresponding FAQ entry states 30
seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li 
...



 This is a big problem for any applications using Springframework,
which has startup time about 20 seconds.



 Here is corresponding entry from the log file for one of the
executions of such scheduled task.



---
  1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
 See details



 0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET /fetch.htm?...
HTTP/1.1 500 0 - - ipsc-stats.appspot.com



  2. W 02-28 02:45PM 49.160


 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.htmlfor more details.
---


 Can you please advise what could be done in such and if I am  
missing

anything obvious?



 Thanks



 Eugene



--
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 
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-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: Scheduled Tasks aborted early

2010-03-01 Thread Eugene Kuleshov

  John, I hear you, but I am quite certain that there is no other
requests. It happen in a middle of the night when there is no users
and the failing request is initiated by the GAE's own cron, so there
is no refresh of the pages, nor any requests for css.

  With Spring framework, the most of the initialization happens in
either startup servlet or context listener, so splitting application
won't address the issue.

  Another problem is that request is terminated without providing any
stack trace, so it is rather hard to debug issue on a live system.

  regards,
  Eugene


On Mar 1, 12:10 pm, John Patterson jdpatter...@gmail.com wrote:
 Hi Eugene,

 All it takes are two requests to see that error - the first to start  
 the application loading and then any other request (even a request for  
 a css file or refreshing the page) will wait 10 seconds and then throw  
 that exception.  It is rare that a single page does not need more than  
 one request.

 In my opinion this loading request problem is the biggest hidden  
 gotcha that should be written in big red letters on the introduction  
 page.  It could end up requiring you to discard the frameworks you are  
 accustomed to using.

 Something which helped me was to split my app into an admin version  
 and a user facing client version.  That reduced the loading time of  
 the client version significantly.

 On 1 Mar 2010, at 23:35, Eugene Kuleshov wrote:

  John,

   My application is hardly used right now, so there is certainly NO
  other requests coming in. So, I still don't understand why execution
  is cut after 10 seconds instead of promised 30 seconds.

   With such limitation GAE for Java is practically making impossible
  to use the most popular web framework (i.e. Spring MVC + Spring
  Security + Spring Core), but I'd be interested to hear how you can
  replace such stack with something based on Guice.

   regards,
   Eugene

  On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:
  You get this message when you app is still starting while other
  requests come in.  The only current solution is to reduce start up
  time - pinging is not a satisfactory solution because you still get
  frequent loading requests.  With Guice I was able to reduce star up
  by using a non AOP version which did no bytecode enhancement.  Also,
  try delaying initialising components until they are needed.

  On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:

   I have Java application deployed on the appengine and it has  
  several
  job definitions. However I see that Scheduled Tasks are aborted  
  within
  10 seconds from the start, even so corresponding FAQ entry states 30
  seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li
  ...

   This is a big problem for any applications using Springframework,
  which has startup time about 20 seconds.

   Here is corresponding entry from the log file for one of the
  executions of such scheduled task.

  ---
    1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
       See details

       0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET /fetch.htm?...
  HTTP/1.1 500 0 - - ipsc-stats.appspot.com

    2. W 02-28 02:45PM 49.160

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

   Can you please advise what could be done in such and if I am  
  missing
  anything obvious?

   Thanks

   Eugene

  --
  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 
  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-java@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] How to migrate data from an existing database to APP Engine?

2010-03-01 Thread HugoMatus
Hi,

I looked at APP Engine for the first time this weekend and understand
clearly the steps to create a new application and persist new data to
APP Engine. What I could not find an answer for is:

How to migrate existing data from a relational database to APP Engine
so that I can then migrate a small app that queries the data and
allows user to modify or add new records?

Thanks,

HugoMatus

-- 
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] error while deploying web appln in google appengine

2010-03-01 Thread Chummar Maly
I had the same issue and resolved it by removing all jre installations and
leaving out just the jdk.

On Sat, Feb 27, 2010 at 11:02 PM, shanthi ramabhadran 77can...@gmail.comwrote:

 How to resolve the following error while deploying java web appln in
 google appengine??
 8% Compiling jsp files.
 11% Compiling java files.

 Error Details:
 Feb 28, 2010 9:21:57 AM org.apache.jasper.JspC processFile
 INFO: Built File: \index.jsp
 java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
 Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
 Exception in thread main Could not find the main class:
 com.sun.tools.javac.Main.  Program will exit.
 Error while executing: C:\Program Files\Java\jre6\bin\javac.exe -
 classpath /C:/Program Files/appengine-java-sdk-1.3.0/lib/impl/
 appengine-api-labs.jar;/C:/Program Files/appengine-java-sdk-1.3.0/lib/
 impl/appengine-api-stubs.jar;/C:/Program Files/appengine-java-
 sdk-1.3.0/lib/impl/appengine-api.jar;/C:/Program Files/appengine-java-
 sdk-1.3.0/lib/impl/appengine-local-runtime.jar;C:\Program Files
 \appengine-java-sdk-1.3.0\lib\shared\appengine-local-runtime-
 shared.jar;C:\Program Files\appengine-java-sdk-1.3.0\lib\shared
 \geronimo-el_1.0_spec-1.0.1.jar;C:\Program Files\appengine-java-
 sdk-1.3.0\lib\shared\geronimo-jsp_2.1_spec-1.0.1.jar;C:\Program Files
 \appengine-java-sdk-1.3.0\lib\shared\geronimo-
 servlet_2.5_spec-1.2.jar;C:\Program Files\appengine-java-sdk-1.3.0\lib
 \shared\jsp\repackaged-appengine-ant-1.6.5.jar;C:\Program Files
 \appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-ant-
 launcher-1.6.5.jar;C:\Program Files\appengine-java-sdk-1.3.0\lib\shared
 \jsp\repackaged-appengine-commons-el-1.0.jar;C:\Program Files
 \appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-commons-
 logging-1.1.1.jar;C:\Program Files\appengine-java-sdk-1.3.0\lib\shared
 \jsp\repackaged-appengine-jasper-compiler-5.0.28.jar;C:\Program Files
 \appengine-java-sdk-1.3.0\lib\shared\jsp\repackaged-appengine-jasper-
 runtime-5.0.28.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\classes;C:
 \DOCUME~1\ADMINI~1\LOCALS~1\Temp\appcfg5666792600954450490.tmp\WEB-INF
 \lib\jdo2-api-2.3-eb.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\geronimo-
 jpa_3.0_spec-1.1.1.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\appengine-api-1.0-
 sdk-1.3.0.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\geronimo-
 jta_1.1_spec-1.1.1.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\datanucleus-jpa-1.1.5.jar;C:
 \DOCUME~1\ADMINI~1\LOCALS~1\Temp\appcfg5666792600954450490.tmp\WEB-INF
 \lib\appengine-api-labs-1.3.0.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\datanucleus-
 core-1.1.5.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\datanucleus-
 appengine-1.0.4.1.final.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-
 jakarta-jstl-1.1.2.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-
 jakarta-standard-1.1.2.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-
 ant-1.6.5.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-ant-
 launcher-1.6.5.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-
 commons-el-1.0.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-
 commons-logging-1.1.1.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-jasper-
 compiler-5.0.28.jar;C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\lib\repackaged-appengine-jasper-
 runtime-5.0.28.jar; -d C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg5666792600954450490.tmp\WEB-INF\classes -encoding UTF-8 C:
 \DOCUME~1\ADMINI~1\LOCALS~1\Temp\appcfg5666792600954450490.tmp\WEB-INF
 \classes\org\apache\jsp\index_jsp.java


 com.google.appengine.tools.admin.JspCompilationException: Failed to
 compile the generated JSP java files.
 Unable to update app: Failed to compile the generated JSP java files.
 Please see the logs [C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
 \appcfg8759329262789349213.log] for further information.

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

[appengine-java] Database import feature request for Java

2010-03-01 Thread Anand
Hi,
We really need following feature urgently mentioned in blog:-

Database import: move GBs of data easily into your App Engine app.
Matching export capabilities are coming soon, hopefully within a
month.

Even if database-import for java just upload few MBs, and it is in
preview edition, that should be fine with us for now.

-- 
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-01 Thread Jake
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.



Re: [appengine-java] Re: Scheduled Tasks aborted early

2010-03-01 Thread John Patterson
When you get the Request was aborted after waiting too long ...  
message there will be no stack trace because your code is never run.   
Rest assured you can run tasks for 30 seconds - I do it myself.


Context listeners are run on every loading request so why do you say  
that splitting your code will not reduce start up time?  Surely if  
there is less code to initialise it will take less time no?


Could you post your log file of requests before and after the error?

On 2 Mar 2010, at 00:17, Eugene Kuleshov wrote:



 John, I hear you, but I am quite certain that there is no other
requests. It happen in a middle of the night when there is no users
and the failing request is initiated by the GAE's own cron, so there
is no refresh of the pages, nor any requests for css.

 With Spring framework, the most of the initialization happens in
either startup servlet or context listener, so splitting application
won't address the issue.

 Another problem is that request is terminated without providing any
stack trace, so it is rather hard to debug issue on a live system.

 regards,
 Eugene


On Mar 1, 12:10 pm, John Patterson jdpatter...@gmail.com wrote:

Hi Eugene,

All it takes are two requests to see that error - the first to start
the application loading and then any other request (even a request  
for
a css file or refreshing the page) will wait 10 seconds and then  
throw
that exception.  It is rare that a single page does not need more  
than

one request.

In my opinion this loading request problem is the biggest hidden
gotcha that should be written in big red letters on the introduction
page.  It could end up requiring you to discard the frameworks you  
are

accustomed to using.

Something which helped me was to split my app into an admin version
and a user facing client version.  That reduced the loading time of
the client version significantly.

On 1 Mar 2010, at 23:35, Eugene Kuleshov wrote:


John,



 My application is hardly used right now, so there is certainly NO
other requests coming in. So, I still don't understand why execution
is cut after 10 seconds instead of promised 30 seconds.



 With such limitation GAE for Java is practically making impossible
to use the most popular web framework (i.e. Spring MVC + Spring
Security + Spring Core), but I'd be interested to hear how you can
replace such stack with something based on Guice.



 regards,
 Eugene



On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:

You get this message when you app is still starting while other
requests come in.  The only current solution is to reduce start up
time - pinging is not a satisfactory solution because you still get
frequent loading requests.  With Guice I was able to reduce  
star up
by using a non AOP version which did no bytecode enhancement.   
Also,

try delaying initialising components until they are needed.



On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:



 I have Java application deployed on the appengine and it has
several
job definitions. However I see that Scheduled Tasks are aborted
within
10 seconds from the start, even so corresponding FAQ entry  
states 30

seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li
...



 This is a big problem for any applications using Springframework,
which has startup time about 20 seconds.



 Here is corresponding entry from the log file for one of the
executions of such scheduled task.



---
  1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
 See details



 0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET /fetch.htm?...
HTTP/1.1 500 0 - - ipsc-stats.appspot.com



  2. W 02-28 02:45PM 49.160



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



 Can you please advise what could be done in such and if I am
missing
anything obvious?



 Thanks



 Eugene



--
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 
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-java@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 

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

2010-03-01 Thread Valentino Hankypants
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: Scheduled Tasks aborted early

2010-03-01 Thread Eugene Kuleshov
John,

  I've posted the pretty much complete log in my very first message.
If I read it correctly the request took 10012ms and it haven't used
any CPU (0cpu_ms) and there was NO other requests within 30 minutes
around that time.
  More over, if I kick the very same url as defined in cron.xml
manually from the browser, it works. So, the issue seem only affects
requests coming from the cron.xml

  The only thing I could do to to avoid execution of context listener
(besides of dropping Spring MVC and Spring Security) is split
application into a two separate apps, but then I won't be able to
access the same data storage.

  regards,
  Eugene


On Mar 1, 12:41 pm, John Patterson jdpatter...@gmail.com wrote:
 When you get the Request was aborted after waiting too long ...  
 message there will be no stack trace because your code is never run.  
 Rest assured you can run tasks for 30 seconds - I do it myself.

 Context listeners are run on every loading request so why do you say  
 that splitting your code will not reduce start up time?  Surely if  
 there is less code to initialise it will take less time no?

 Could you post your log file of requests before and after the error?

 On 2 Mar 2010, at 00:17, Eugene Kuleshov wrote:



   John, I hear you, but I am quite certain that there is no other
  requests. It happen in a middle of the night when there is no users
  and the failing request is initiated by the GAE's own cron, so there
  is no refresh of the pages, nor any requests for css.

   With Spring framework, the most of the initialization happens in
  either startup servlet or context listener, so splitting application
  won't address the issue.

   Another problem is that request is terminated without providing any
  stack trace, so it is rather hard to debug issue on a live system.

   regards,
   Eugene

  On Mar 1, 12:10 pm, John Patterson jdpatter...@gmail.com wrote:
  Hi Eugene,

  All it takes are two requests to see that error - the first to start
  the application loading and then any other request (even a request  
  for
  a css file or refreshing the page) will wait 10 seconds and then  
  throw
  that exception.  It is rare that a single page does not need more  
  than
  one request.

  In my opinion this loading request problem is the biggest hidden
  gotcha that should be written in big red letters on the introduction
  page.  It could end up requiring you to discard the frameworks you  
  are
  accustomed to using.

  Something which helped me was to split my app into an admin version
  and a user facing client version.  That reduced the loading time of
  the client version significantly.

  On 1 Mar 2010, at 23:35, Eugene Kuleshov wrote:

  John,

   My application is hardly used right now, so there is certainly NO
  other requests coming in. So, I still don't understand why execution
  is cut after 10 seconds instead of promised 30 seconds.

   With such limitation GAE for Java is practically making impossible
  to use the most popular web framework (i.e. Spring MVC + Spring
  Security + Spring Core), but I'd be interested to hear how you can
  replace such stack with something based on Guice.

   regards,
   Eugene

  On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:
  You get this message when you app is still starting while other
  requests come in.  The only current solution is to reduce start up
  time - pinging is not a satisfactory solution because you still get
  frequent loading requests.  With Guice I was able to reduce  
  star up
  by using a non AOP version which did no bytecode enhancement.  
  Also,
  try delaying initialising components until they are needed.

  On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:

   I have Java application deployed on the appengine and it has
  several
  job definitions. However I see that Scheduled Tasks are aborted
  within
  10 seconds from the start, even so corresponding FAQ entry  
  states 30
  seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li
  ...

   This is a big problem for any applications using Springframework,
  which has startup time about 20 seconds.

   Here is corresponding entry from the log file for one of the
  executions of such scheduled task.

  ---
    1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
       See details

       0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET /fetch.htm?...
  HTTP/1.1 500 0 - - ipsc-stats.appspot.com

    2. W 02-28 02:45PM 49.160

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

   Can you please advise what could be done in such and if I am
  missing
  anything obvious?

   Thanks

   Eugene

  --
  You received this message because you are 

[appengine-java] Re: lost sub entity

2010-03-01 Thread Gunnar
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 {
                         tx.begin();
                         ListMyEntity results = (ListMyEntity)
  query.execute();
                         if (results.iterator().hasNext()) {
                                 for (MyEntity e : results) {
                                         ListSubEntity list =
  e.getMyList();
                                         SubEntity first =
  list.remove(0);
                                         boolean ok =  
  list.add(first);
                                         if (!ok) {

  System.err.println(could not add first);
                  

[appengine-java] Re: lost sub entity

2010-03-01 Thread Gunnar
Hi,
I have not defined any fetch group, should I? If so how should I do
that?
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 {
                         tx.begin();
                         ListMyEntity results = (ListMyEntity)
  query.execute();
                         if (results.iterator().hasNext()) {
                                 for (MyEntity e : results) {
                                         ListSubEntity list =
  e.getMyList();
                                         SubEntity first =
  list.remove(0);
                                         boolean ok =  
  list.add(first);
                                         if (!ok) {

  System.err.println(could not add first);
                                         }
                                         

Re: [appengine-java] Re: Scheduled Tasks aborted early

2010-03-01 Thread John Patterson
The pasted log is a bit hard to read... but it looks to me like two  
requests.  One at 02-28 02:45PM 39 and another at 02-28 02:45PM  
49.   Or is that just the way it printed?


The idea is to split the app into different _versions_ not different  
apps.  Then they use the same datastore but apart from that act almost  
like separate apps.  In my situation my admin app takes care of all  
the loading and processing data - kicking off tasks etc.


On 2 Mar 2010, at 00:54, Eugene Kuleshov wrote:


John,

 I've posted the pretty much complete log in my very first message.
If I read it correctly the request took 10012ms and it haven't used
any CPU (0cpu_ms) and there was NO other requests within 30 minutes
around that time.
 More over, if I kick the very same url as defined in cron.xml
manually from the browser, it works. So, the issue seem only affects
requests coming from the cron.xml

 The only thing I could do to to avoid execution of context listener
(besides of dropping Spring MVC and Spring Security) is split
application into a two separate apps, but then I won't be able to
access the same data storage.

 regards,
 Eugene


On Mar 1, 12:41 pm, John Patterson jdpatter...@gmail.com wrote:

When you get the Request was aborted after waiting too long ...
message there will be no stack trace because your code is never run.
Rest assured you can run tasks for 30 seconds - I do it myself.

Context listeners are run on every loading request so why do you say
that splitting your code will not reduce start up time?  Surely if
there is less code to initialise it will take less time no?

Could you post your log file of requests before and after the error?

On 2 Mar 2010, at 00:17, Eugene Kuleshov wrote:




 John, I hear you, but I am quite certain that there is no other
requests. It happen in a middle of the night when there is no users
and the failing request is initiated by the GAE's own cron, so there
is no refresh of the pages, nor any requests for css.



 With Spring framework, the most of the initialization happens in
either startup servlet or context listener, so splitting application
won't address the issue.



 Another problem is that request is terminated without providing any
stack trace, so it is rather hard to debug issue on a live system.



 regards,
 Eugene



On Mar 1, 12:10 pm, John Patterson jdpatter...@gmail.com wrote:

Hi Eugene,


All it takes are two requests to see that error - the first to  
start

the application loading and then any other request (even a request
for
a css file or refreshing the page) will wait 10 seconds and then
throw
that exception.  It is rare that a single page does not need more
than
one request.



In my opinion this loading request problem is the biggest hidden
gotcha that should be written in big red letters on the  
introduction

page.  It could end up requiring you to discard the frameworks you
are
accustomed to using.


Something which helped me was to split my app into an admin  
version
and a user facing client version.  That reduced the loading  
time of

the client version significantly.



On 1 Mar 2010, at 23:35, Eugene Kuleshov wrote:



John,



 My application is hardly used right now, so there is certainly NO
other requests coming in. So, I still don't understand why  
execution

is cut after 10 seconds instead of promised 30 seconds.


 With such limitation GAE for Java is practically making  
impossible

to use the most popular web framework (i.e. Spring MVC + Spring
Security + Spring Core), but I'd be interested to hear how you can
replace such stack with something based on Guice.



 regards,
 Eugene



On Feb 28, 11:55 pm, John Patterson jdpatter...@gmail.com wrote:

You get this message when you app is still starting while other
requests come in.  The only current solution is to reduce start  
up
time - pinging is not a satisfactory solution because you still  
get

frequent loading requests.  With Guice I was able to reduce
star up
by using a non AOP version which did no bytecode enhancement.
Also,
try delaying initialising components until they are needed.



On 1 Mar 2010, at 08:45, Eugene Kuleshov wrote:



 I have Java application deployed on the appengine and it has
several
job definitions. However I see that Scheduled Tasks are aborted
within
10 seconds from the start, even so corresponding FAQ entry
states 30
seconds.http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Li
...


 This is a big problem for any applications using  
Springframework,

which has startup time about 20 seconds.



 Here is corresponding entry from the log file for one of the
executions of such scheduled task.



---
  1. 02-28 02:45PM 39.147 /fetch.htm?... 500 10012ms 0cpu_ms 0kb
 See details


 0.1.0.1 - - [28/Feb/2010:14:45:49 -0800] GET / 
fetch.htm?...

HTTP/1.1 500 0 - - ipsc-stats.appspot.com



  2. W 02-28 02:45PM 49.160



 Request was aborted after waiting too long to attempt to
service
your request. Most likely, this 

Re: [appengine-java] Re: lost sub entity

2010-03-01 Thread John Patterson

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 {
   tx.begin();
   ListMyEntity results = (ListMyEntity)
query.execute();
   if (results.iterator().hasNext()) {
   for (MyEntity e : results) {
   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);
   

Re: [appengine-java] Re: Expires header automatically added (bug?)

2010-03-01 Thread Ikai L (Google)
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%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.



Re: [appengine-java] How to migrate data from an existing database to APP Engine?

2010-03-01 Thread Ikai L (Google)
You'll need to write a script that exports from your relational database and
uploads using the bulk loader:

http://code.google.com/appengine/docs/python/tools/uploadingdata.html

Schemas won't map 1:1, so be sure you understand what changes you'll have to
make to your persistence model before doing this.

On Sun, Feb 28, 2010 at 7:50 PM, HugoMatus hugoomarma...@gmail.com wrote:

 Hi,

 I looked at APP Engine for the first time this weekend and understand
 clearly the steps to create a new application and persist new data to
 APP Engine. What I could not find an answer for is:

 How to migrate existing data from a relational database to APP Engine
 so that I can then migrate a small app that queries the data and
 allows user to modify or add new records?

 Thanks,

 HugoMatus

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



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

2010-03-01 Thread Ikai L (Google)
Since you're using Flash, you won't need to use long polling. XMPP seems
like the way to go here.

On Mon, Mar 1, 2010 at 1:08 AM, Miguel maenguida...@gmail.com wrote:

 You can use Memcache:


 http://code.google.com/intl/en/appengine/docs/java/memcache/usingjcache.html


 On 28 feb, 08:58, 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 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] Re: Scheduled Tasks aborted early

2010-03-01 Thread Eugene Kuleshov
On Mar 1, 1:19 pm, John Patterson jdpatter...@gmail.com wrote:

 The pasted log is a bit hard to read... but it looks to me like two  
 requests.  One at 02-28 02:45PM 39 and another at 02-28 02:45PM  
 49.   Or is that just the way it printed?

  Just one request. That is how it looks in the log browser at the web
UI.

 The idea is to split the app into different _versions_ not different  
 apps.  Then they use the same datastore but apart from that act almost  
 like separate apps.  In my situation my admin app takes care of all  
 the loading and processing data - kicking off tasks etc.

  I see, it is an interesting, yet quite weird workaround.

  regards,
  Eugene

-- 
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: Scheduled Tasks aborted early

2010-03-01 Thread John Patterson


On 2 Mar 2010, at 02:18, Eugene Kuleshov wrote:

 Just one request. That is how it looks in the log browser at the web
UI.


OK then could you post the logs surrounding that one request?  Expanded.

--
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: Scheduled Tasks aborted early

2010-03-01 Thread Eugene Kuleshov
John,

  There was no requests more then 30 minutes before that one and more
then 30 minutes after that. So, I don't think those requests would
matter.

  Take care

  Eugene


On Mon, Mar 1, 2010 at 2:24 PM, John Patterson jdpatter...@gmail.com wrote:

 On 2 Mar 2010, at 02:18, Eugene Kuleshov wrote:

  Just one request. That is how it looks in the log browser at the web
 UI.

 OK then could you post the logs surrounding that one request?  Expanded.

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


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



Re: [appengine-java] Re: App Engine and Spring slow start up

2010-03-01 Thread Rusty Wright

Try using the old way with xml configuration for wiring your beans together.  
The word on the street is that Spring's component scanning takes a lot of time.


luijar wrote:

Nope, I am still seeing it. It's quite frustrating. I even tried to
reduce Spring init time by removing schema validation from the
application context init. But, that does not seem to work. I am using
Spring annotations and component scanning to autowire my beans, I
wonder if using plain XML configuration will make autowiring faster.


On Feb 23, 9:14 pm, charming30 charmin...@gmail.com wrote:

Has the above mentioned offline precompilatio in 1.3.1 been able to
solve your issue, I plan to use Spring on Java for my Business App
which is complex and could be based on SOA. Kindly let me know if your
issue was resolved or reduced by using the above fix.

On Feb 20, 12:05 am, luijar luis.j.aten...@gmail.com wrote:


I believe my development environment was on 1.3.0. That might be
something to look at, although it seems that probably it's a very
small overhead, do you have any metrics that would give some evidence
as to how much overhead is offline precompilation adding?
Thanks
On Feb 18, 2:04 pm, Don Schwarz schwa...@google.com wrote:

Have you deployed your application with the 1.3.1 SDK?  That release turned
on offline precompilation by default, which is an optimization that may
help.
On Thu, Feb 18, 2010 at 7:59 AM, Alex chasov...@gmail.com wrote:

Hi,
It appeared that long init problem is well known for Grails users:
http://jira.codehaus.org/browse/GRAILSPLUGINS-1736
I wasted couple of weeks to create app I cannot run. Hope that
SpringSource and Google can solve the issue.
On Feb 17, 7:41 pm, Stephan Hartmann hartm...@metamesh.de wrote:

The problem is that the initialization of your app takes longer than 30
seconds.
Pinging your app doesn't help when the app is restarted due to

redeployment

or maintenance, or when high traffic demands a second instance.
You should try to reduce your startup time.
regards,
Stephan
2010/2/17 luijar luis.j.aten...@gmail.com

Great, all of our projects areSpringenabled lol. But I guess it's
good that we are not the only ones seeing this, hopefully it gets a
little more visibility. We have a cron job (1 min) that tries to keep
our application alive by hitting a URL, but it does not do a very good
job. It's frustrating and we don't even have access to the 500 page to
tell the user to retry or go somewhere else.
On Feb 17, 11:21 am, oth other...@gmail.com wrote:

Yes we have seen this problem a lot. Per our tests, an application
becomes idle after a minute of non activity. So, the unfortunate
reality is that you need to keep your app alive by simulating

activity

on it. Or go the nonSpringroute.
Thanks
On Feb 16, 4:14 pm, luijar luis.j.aten...@gmail.com wrote:

Hello Google App Engine forum,
  We have been seeing ever since we deployed our applications
(currently 3 of them) that when our application instances become

idle

(they have not been hit for x amount of seconds) subsequent

requests

return with a 500 response. Logs show a hard deadline exceeded

error

com.google.apphosting.runtime.HardDeadlineExceededError: This

request

(32306ebe63b71ab0) started at 2010/02/12 20:39:11.984 UTC and was
still executing at 2010/02/12 20:39:41.225 UTC.
at

com.google.appengine.runtime.Request.process-32306ebe63b71ab0(Request.java)

And the first line of the log message has the following :
02-12 12:39PM 14.088
javax.servlet.ServletContext log: InitializingSpringroot
WebApplicationContext
Question:
Has anyone else seen this behavior? How long does it take for an
application instance to become idle?
Thanks

--
You received this message because you are subscribed to the Google

Groups

Google App Engine forJava 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

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




--
0x2B | ~0x2b  --  Hamlet

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

Re: [appengine-java] logging not working this

2010-03-01 Thread Ikai Lan
What's your application ID?

On Fri, Feb 26, 2010 at 7:00 AM, oceandrive rams...@gmail.com wrote:

 GAE logging is not working this morning? Anyone has the same issue.
 The last log for me was at 02-26 06:00AM 03.975.

 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%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] Re: lost sub entity

2010-03-01 Thread Gunnar
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 {
                         tx.begin();
                         ListMyEntity results = (ListMyEntity)
  query.execute();
                         if (results.iterator().hasNext()) {
                                 for (MyEntity e : results) {
                                         ListSubEntity list =
  e.getMyList();
            

[appengine-java] Re: App Engine and Spring slow start up

2010-03-01 Thread luijar
Thanks for the advice, I'll try that.

On Mar 1, 2:31 pm, Rusty Wright rwright.li...@gmail.com wrote:
 Try using the old way with xml configuration for wiring your beans together.  
 The word on the street is that Spring's component scanning takes a lot of 
 time.



 luijar wrote:
  Nope, I am still seeing it. It's quite frustrating. I even tried to
  reduce Spring init time by removing schema validation from the
  application context init. But, that does not seem to work. I am using
  Spring annotations and component scanning to autowire my beans, I
  wonder if using plain XML configuration will make autowiring faster.

  On Feb 23, 9:14 pm, charming30 charmin...@gmail.com wrote:
  Has the above mentioned offline precompilatio in 1.3.1 been able to
  solve your issue, I plan to use Spring on Java for my Business App
  which is complex and could be based on SOA. Kindly let me know if your
  issue was resolved or reduced by using the above fix.

  On Feb 20, 12:05 am, luijar luis.j.aten...@gmail.com wrote:

  I believe my development environment was on 1.3.0. That might be
  something to look at, although it seems that probably it's a very
  small overhead, do you have any metrics that would give some evidence
  as to how much overhead is offline precompilation adding?
  Thanks
  On Feb 18, 2:04 pm, Don Schwarz schwa...@google.com wrote:
  Have you deployed your application with the 1.3.1 SDK?  That release 
  turned
  on offline precompilation by default, which is an optimization that may
  help.
  On Thu, Feb 18, 2010 at 7:59 AM, Alex chasov...@gmail.com wrote:
  Hi,
  It appeared that long init problem is well known for Grails users:
 http://jira.codehaus.org/browse/GRAILSPLUGINS-1736
  I wasted couple of weeks to create app I cannot run. Hope that
  SpringSource and Google can solve the issue.
  On Feb 17, 7:41 pm, Stephan Hartmann hartm...@metamesh.de wrote:
  The problem is that the initialization of your app takes longer than 30
  seconds.
  Pinging your app doesn't help when the app is restarted due to
  redeployment
  or maintenance, or when high traffic demands a second instance.
  You should try to reduce your startup time.
  regards,
  Stephan
  2010/2/17 luijar luis.j.aten...@gmail.com
  Great, all of our projects areSpringenabled lol. But I guess it's
  good that we are not the only ones seeing this, hopefully it gets a
  little more visibility. We have a cron job (1 min) that tries to keep
  our application alive by hitting a URL, but it does not do a very good
  job. It's frustrating and we don't even have access to the 500 page to
  tell the user to retry or go somewhere else.
  On Feb 17, 11:21 am, oth other...@gmail.com wrote:
  Yes we have seen this problem a lot. Per our tests, an application
  becomes idle after a minute of non activity. So, the unfortunate
  reality is that you need to keep your app alive by simulating
  activity
  on it. Or go the nonSpringroute.
  Thanks
  On Feb 16, 4:14 pm, luijar luis.j.aten...@gmail.com wrote:
  Hello Google App Engine forum,
    We have been seeing ever since we deployed our applications
  (currently 3 of them) that when our application instances become
  idle
  (they have not been hit for x amount of seconds) subsequent
  requests
  return with a 500 response. Logs show a hard deadline exceeded
  error
  com.google.apphosting.runtime.HardDeadlineExceededError: This
  request
  (32306ebe63b71ab0) started at 2010/02/12 20:39:11.984 UTC and was
  still executing at 2010/02/12 20:39:41.225 UTC.
          at
  com.google.appengine.runtime.Request.process-32306ebe63b71ab0(Request.java)
  And the first line of the log message has the following :
  02-12 12:39PM 14.088
  javax.servlet.ServletContext log: InitializingSpringroot
  WebApplicationContext
  Question:
  Has anyone else seen this behavior? How long does it take for an
  application instance to become idle?
  Thanks
  --
  You received this message because you are subscribed to the Google
  Groups
  Google App Engine forJava 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
  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 forJava 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.

 --
 0x2B | ~0x2b  --  Hamlet

-- 
You received this message 

Re: [appengine-java] Re: lost sub entity

2010-03-01 Thread John Patterson

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 {
   tx.begin();
   ListMyEntity results =  
(ListMyEntity)

query.execute();
   if (results.iterator().hasNext()) {
   for (MyEntity e : results) {
   ListSubEntity list =
e.getMyList();
   SubEntity first =
list.remove(0);

[appengine-java] Re: Spring MVC - File upload problem

2010-03-01 Thread Sebastian Cartier
Hi
my first solution i wrote isn't working any more. I had to add

beans = {
 
multipartResolver(is.hax.spring.web.multipart.StreamingMultipartResolver)
}

to /grails-app/conf/spring/resources.xml
Now it works again

@Markus: you can not use byte-arrays with google app engine. You have
to use blobs! See my previous solution.
I put the library in myApplication/lib

On 2 Feb., 03:08, Markus Paaso markus.pa...@gmail.com wrote:
 Hi

 I tried it with Grails 1.2.0 and app-engine plugin 0.8.8 but got just
 an another error:

 java.lang.NoClassDefFoundError: Could not initialize class
 org.apache.commons.fileupload.disk.DiskFileItem
         at org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem
 (DiskFileItemFactory.java:196)
         at org.apache.commons.fileupload.FileUploadBase.parseRequest
 (FileUploadBase.java:358)
         at
 org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest
 (ServletFileUpload.java:126)
         at
 org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest
 (CommonsMultipartResolver.java:155)

 my controller:

         def imageInstance = new Image(imageParams)
         def f = request.getFile('imageData')
         imageInstance.imageData = f.getBytes()
         Image.withTransaction {
                 if(imageInstance.save(flush:true)) {
                     flash.message = Image ${imageInstance.id} created
                     redirect(action:show,id:imageInstance.id)
                 }
                 else {
                     render(view:'create',model:[imageInstance:imageInstance])
                 }
         }

 and domain-class:

 import javax.persistence.*;
 // import com.google.appengine.api.datastore.Key;

 @Entity
 class Image implements Serializable {

     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     Long id
     byte[] imageData

     static constraints = {
         id visible:false
     }

 }

 It seems like the multipart resolver is not replaced with the new one.
 I placed the jar file into myApplication/lib and GRAILS_HOME/lib
 directories.
 Maybe I didn't place the jar to the right directory?
 Would you like to tell more about how you got it to work?

 Markus

 On 2 helmi, 00:00, Sebastian Cartier sebi.cart...@gmail.com wrote:

  this works also for grails!
  Add the library to your lib directory and add
      bean id=multipartResolver

  class=is.hax.spring.web.multipart.StreamingMultipartResolver
      /bean
  to your applicationContext.xml

  For saving the image in a google blob i used the following functions:
          @Persistent
          Blob imageBlob

          byte [] getImage(){
                  if(imageBlob){
                          imageBlob.getBytes()
                  }else{
                          null;
                  }
          }

          void setImage(byte [] imageBytes){
                  imageBlob = new Blob(imageBytes)
          }

-- 
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] Task queue not starting the action when expected

2010-03-01 Thread Ikai L (Google)
Tasks aren't guaranteed to execute immediately. Task queues execute when
there is capacity:
http://code.google.com/appengine/docs/python/taskqueue/overview.html#Task_Execution

It may or may not be related to 1.3.1. What % of your requests see this
delay?

On Thu, Feb 25, 2010 at 3:05 PM, Jerome jerome.mou...@gmail.com wrote:

 Hello,

 We have been using task queues for a few months without problem. We
 handle actions that must execute right away.

 At the time of the release of 1.3.1, we noticed that sometimes, some
 tasks will take 1 to 2 minutes to start, but in the task queue, the
 ETA shows as a date in the past (like 0:01:12 ago), usually 1 second
 or so after the creation time.

 This is not a consistent issue. I might works perfectly (task being
 kicked in within 1 second of creation) for several times and suddenly,
 the next task takes 1.5 minutes to get started.

 Our task queue is empty when we see this issue.
 Our queue is setup with a max rate of 5/s and a bucket size of 1.

 Any idea of what we can do to work around or solve this new issue?

 Jerome

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



Re: [appengine-java] Defining composite indexes

2010-03-01 Thread Ikai L (Google)
That's challenging. If there's a finite set of possible property names, you
can generate all these ahead of time using queries on your local datastore
instance. If not, you may want to reconsider using the property name as
metadata for exactly the reasons you mentioned. For properties that require
composite indexing, you can use a key and value property with indexable
values so composite indexing is possible.

On Fri, Feb 26, 2010 at 1:02 AM, AGS Rest agsr...@gmail.com wrote:

 I use the low level App Engine data store API, as it gives me the
 flexibility of having defining schemas on the fly, as Entities on the
 app engine don't really need a schema.

 Normally, if i needed to define a composite index that is based on an
 Entity's property and its ancestor; i can do so by defining an index
 in datastore-indexes.xml (by configuration). However, as the name of
 the property in this case is / can be determined only during the
 creation of the Entity itself, how can i mark properties of the Entity
 on which i need the composite index to be created?

 Is there a hook in the Datastore API that i can take advantage of ?
 Any insight would be 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.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] Re: Is there an equivalent of Python GeoModel project in Java?

2010-03-01 Thread Torquester
I tried out the Java Geomodel http://code.google.com/p/javageomodel/

The query used in the example provided on the project page seems
strange to me. The example uses a ListString parameter (containing
the cells of the bounding box) and passes it to a query which filters
the ListString (geocells) property of the entity class. When I
execute that query I get following error: Collection parameters are
only supported when filtering on primary key.

Is it possible to have a query in appengine where the entity has a
ListString property (which is not a primary key) and you want to
know if that property contains one of the values provided by a second
ListString?


I'm also wondering if the resolution of the cells can be changed. The
results I get are inaccurate (I'm getting some false positives when I
do a bounding box search).


class GeoObject {
  @Persistent
  ListString geocells;
  ...
}

// Transform this to a bounding box
BoundingBox bb = new BoundingBox(latNE, lonNE, latSW, lonSW);

// Calculate the geocells list to be used in the queries (optimize
list of cells that complete the given bounding box)
ListString cells = Geocell.best_bbox_search_cells(bb, null);
// In Google App Engine, you'll have something like below. In
hibernate (or whatever else), it might be a little bit different.
String queryString = select from GeoObject where
geocellsParameter.contains(geocells);
Query query = pm.newQuery(query);
query.declareParameters(String geocellsParameter);
query.declareParameters(String geocellsP);
ListGeoObject objects = (ListGeoObject) query.execute(cells);



On Feb 8, 11:24 pm, Ikai L (Google) ika...@google.com wrote:
 Looks like someone ported the Python code to Java for GeoHash:

 http://stackoverflow.com/questions/2060219/google-app-engine-geohashing

 Also seems like a pretty good explanation of GeoHashing in general.





 On Thu, Feb 4, 2010 at 10:16 AM, mianor lefebvre.rom...@gmail.com wrote:
  Hi,

  I am trying to implement geolocation search with GAE in Java using
  GeoPt.
  But due to restrictions on Datastore, bounding box queries are also
  not supported in App Engine because there need to be two inequalities
  on two independent properties (latitude and longitude).

  There seems to be a solution with Geohash but every thing I found is
  based on GAE Python. Is there anything based on Java or can I use
  Geomodel (http://code.google.com/p/geomodel/) from Python in my Java
  applications?

  Thanks for your help!

  Romain

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

2010-03-01 Thread Felipe
JPA 2.0 Support. When

-- 
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: Spring MVC - File upload problem

2010-03-01 Thread yjun hu
hi, i got a demo here.
http://hapeblog.appspot.com/blog.shtml?id=2002

On Tue, Mar 2, 2010 at 4:36 AM, Sebastian Cartier sebi.cart...@gmail.comwrote:

 Hi
 my first solution i wrote isn't working any more. I had to add

 beans = {

 multipartResolver(is.hax.spring.web.multipart.StreamingMultipartResolver)
 }

 to /grails-app/conf/spring/resources.xml
 Now it works again

 @Markus: you can not use byte-arrays with google app engine. You have
 to use blobs! See my previous solution.
 I put the library in myApplication/lib

 On 2 Feb., 03:08, Markus Paaso markus.pa...@gmail.com wrote:
  Hi
 
  I tried it with Grails 1.2.0 and app-engine plugin 0.8.8 but got just
  an another error:
 
  java.lang.NoClassDefFoundError: Could not initialize class
  org.apache.commons.fileupload.disk.DiskFileItem
  at
 org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem
  (DiskFileItemFactory.java:196)
  at org.apache.commons.fileupload.FileUploadBase.parseRequest
  (FileUploadBase.java:358)
  at
  org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest
  (ServletFileUpload.java:126)
  at
 
 org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest
  (CommonsMultipartResolver.java:155)
 
  my controller:
 
  def imageInstance = new Image(imageParams)
  def f = request.getFile('imageData')
  imageInstance.imageData = f.getBytes()
  Image.withTransaction {
  if(imageInstance.save(flush:true)) {
  flash.message = Image ${imageInstance.id} created
  redirect(action:show,id:imageInstance.id)
  }
  else {
 
 render(view:'create',model:[imageInstance:imageInstance])
  }
  }
 
  and domain-class:
 
  import javax.persistence.*;
  // import com.google.appengine.api.datastore.Key;
 
  @Entity
  class Image implements Serializable {
 
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  Long id
  byte[] imageData
 
  static constraints = {
  id visible:false
  }
 
  }
 
  It seems like the multipart resolver is not replaced with the new one.
  I placed the jar file into myApplication/lib and GRAILS_HOME/lib
  directories.
  Maybe I didn't place the jar to the right directory?
  Would you like to tell more about how you got it to work?
 
  Markus
 
  On 2 helmi, 00:00, Sebastian Cartier sebi.cart...@gmail.com wrote:
 
   this works also for grails!
   Add the library to your lib directory and add
   bean id=multipartResolver
 
   class=is.hax.spring.web.multipart.StreamingMultipartResolver
   /bean
   to your applicationContext.xml
 
   For saving the image in a google blob i used the following functions:
   @Persistent
   Blob imageBlob
 
   byte [] getImage(){
   if(imageBlob){
   imageBlob.getBytes()
   }else{
   null;
   }
   }
 
   void setImage(byte [] imageBytes){
   imageBlob = new Blob(imageBytes)
   }

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




-- 
dream or truth

-- 
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: App Engine and Spring slow start up

2010-03-01 Thread yjun hu
i got the same problem too, there is no better way to resolve it, i just try
to hitting a url with cron job.

On Tue, Mar 2, 2010 at 3:50 AM, luijar luis.j.aten...@gmail.com wrote:

 Thanks for the advice, I'll try that.

 On Mar 1, 2:31 pm, Rusty Wright rwright.li...@gmail.com wrote:
  Try using the old way with xml configuration for wiring your beans
 together.  The word on the street is that Spring's component scanning takes
 a lot of time.
 
 
 
  luijar wrote:
   Nope, I am still seeing it. It's quite frustrating. I even tried to
   reduce Spring init time by removing schema validation from the
   application context init. But, that does not seem to work. I am using
   Spring annotations and component scanning to autowire my beans, I
   wonder if using plain XML configuration will make autowiring faster.
 
   On Feb 23, 9:14 pm, charming30 charmin...@gmail.com wrote:
   Has the above mentioned offline precompilatio in 1.3.1 been able to
   solve your issue, I plan to use Spring on Java for my Business App
   which is complex and could be based on SOA. Kindly let me know if your
   issue was resolved or reduced by using the above fix.
 
   On Feb 20, 12:05 am, luijar luis.j.aten...@gmail.com wrote:
 
   I believe my development environment was on 1.3.0. That might be
   something to look at, although it seems that probably it's a very
   small overhead, do you have any metrics that would give some evidence
   as to how much overhead is offline precompilation adding?
   Thanks
   On Feb 18, 2:04 pm, Don Schwarz schwa...@google.com wrote:
   Have you deployed your application with the 1.3.1 SDK?  That release
 turned
   on offline precompilation by default, which is an optimization
 that may
   help.
   On Thu, Feb 18, 2010 at 7:59 AM, Alex chasov...@gmail.com wrote:
   Hi,
   It appeared that long init problem is well known for Grails users:
  http://jira.codehaus.org/browse/GRAILSPLUGINS-1736
   I wasted couple of weeks to create app I cannot run. Hope that
   SpringSource and Google can solve the issue.
   On Feb 17, 7:41 pm, Stephan Hartmann hartm...@metamesh.de wrote:
   The problem is that the initialization of your app takes longer
 than 30
   seconds.
   Pinging your app doesn't help when the app is restarted due to
   redeployment
   or maintenance, or when high traffic demands a second instance.
   You should try to reduce your startup time.
   regards,
   Stephan
   2010/2/17 luijar luis.j.aten...@gmail.com
   Great, all of our projects areSpringenabled lol. But I guess it's
   good that we are not the only ones seeing this, hopefully it gets
 a
   little more visibility. We have a cron job (1 min) that tries to
 keep
   our application alive by hitting a URL, but it does not do a very
 good
   job. It's frustrating and we don't even have access to the 500
 page to
   tell the user to retry or go somewhere else.
   On Feb 17, 11:21 am, oth other...@gmail.com wrote:
   Yes we have seen this problem a lot. Per our tests, an
 application
   becomes idle after a minute of non activity. So, the unfortunate
   reality is that you need to keep your app alive by simulating
   activity
   on it. Or go the nonSpringroute.
   Thanks
   On Feb 16, 4:14 pm, luijar luis.j.aten...@gmail.com wrote:
   Hello Google App Engine forum,
 We have been seeing ever since we deployed our applications
   (currently 3 of them) that when our application instances
 become
   idle
   (they have not been hit for x amount of seconds) subsequent
   requests
   return with a 500 response. Logs show a hard deadline exceeded
   error
   com.google.apphosting.runtime.HardDeadlineExceededError: This
   request
   (32306ebe63b71ab0) started at 2010/02/12 20:39:11.984 UTC and
 was
   still executing at 2010/02/12 20:39:41.225 UTC.
   at
  
 com.google.appengine.runtime.Request.process-32306ebe63b71ab0(Request.java)
   And the first line of the log message has the following :
   02-12 12:39PM 14.088
   javax.servlet.ServletContext log: InitializingSpringroot
   WebApplicationContext
   Question:
   Has anyone else seen this behavior? How long does it take for
 an
   application instance to become idle?
   Thanks
   --
   You received this message because you are subscribed to the
 Google
   Groups
   Google App Engine forJava 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.comgoogle-appengine-java%2B
 unsubscr...@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
 

[appengine-java] multiple inserts/update/delete problem

2010-03-01 Thread legendlink
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.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.