[appengine-java] Re: Instance startup/shutdown and sessions

2010-07-26 Thread Jake
Hey,

Yes, sessions are stored in the datastore, make use of the memcache,
and behave as expected regardless of which instances are serving your
user.  However, you still face the same 1MB limit and this system,
obviously, only applies to values saved in the session; any class or
application variables are not maintained.

Jake

On Jul 26, 7:02 am, Marcel Overdijk marceloverd...@gmail.com wrote:
 So GAE makes sure the preserve session data between shutting down/
 starting up instances. Nice.

 On Jul 26, 12:44 pm, Shawn Brown big.coffee.lo...@gmail.com wrote:

   What happens if between logged in user navigates to another page and
   the GAE instance was shutdown?
   I understand a new instance is started but what happened to the
   session data?

  AFAIK session data is persisted to big table.

   Also, how is startup/shutdown of instances related to session-timeout
   in web.xml?

   session-config
      session-timeout30/session-timeout
   /session-config

  AFAIK there is no connection.  An instance will not be kept warm
  because there is an open session.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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] new version problem

2010-07-09 Thread Jake Stayman
I just deployed a new version 1-1 of my application.  It works fine on
the local dev server, and uploads successfully.  But when I try to
access it at http://1-1.latest.appname.appspot.com, I get the
following message:

Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this
error message and the query that caused it.

How do I find out more about the problem?  Are there error logs
available?  When I look under Admin Logs and Logs, there is no
indication that I even tried to access this new version of the
application.

Thanks for any help.
- john


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



[appengine-java] Re: Frustrations with Performance

2010-07-07 Thread Jake
Hey,

Are you getting frequent instance restarts?  Check the log for loading
requests.  This has been known to happen on sites with little-to-no
traffic.

Solution?  None, but if this issue is affecting you, star this:
http://code.google.com/p/googleappengine/issues/detail?id=2931

Jake

On Jul 7, 11:54 am, praseed prase...@gmail.com wrote:
 Folks,

 I hope I have the right audience.

 I am an Independent Software Vendor (read: small software business)
 and I have developed a GWT/GAE product.

 Things were good during development (plugin et al). I was able to get
 features developed quickly.

 However, the application performance these days has been dicey to say
 the least.

 A simple click of a button tends to get 5 to 6 seconds to respond at
 times. Dont have any concurrent users right now. The Appspot dashboard
 does not show any issues and I am well below the quota.

 I have upgraded to the latest GAE engine.

 The App is absolutely horrendous to use due to this. As an ISV, I
 cannot demo this to my prospective customers and I cant market the
 cloud availability, Google performance etc.., -- coz that seems to be
 the downfall of my app.

 The App performs way better on my laptop. The moment it is deployed,
 it is bloody slow.

 I am aware of the current datastore issues at Google. Is that the sole
 reason for this , almost pervasive issue?

 Google AppEngine for Business has been announced. Any time tables?
 Will it address these issues?

 Can someone address this? How about other developers? Can anyone chime
 in here...

 Cheers
 Strawman

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Application restart for almost every request? What happened?

2010-06-29 Thread Jake
Hey,

Actually, what you probably want to do is star this issue:
http://code.google.com/p/googleappengine/issues/detail?id=2931

It's been happening for awhile now, but generally only to low-traffic
users, so it hasn't gotten much attention.  Creeping up in the list,
though!

Jake

On Jun 29, 4:44 am, Simon qila...@gmail.com wrote:
 You probably want to have a read of the following FAQ 
 -http://code.google.com/appengine/kb/java.html#What_Is_A_Loading_Request

 On Jun 29, 4:13 am, opok vir...@gmail.com wrote:

  Error Message: This request caused a new process to be started for
  your application, and thus caused your application code to be loaded
  for the first time. This request may thus take longer and use more CPU
  than a typical request for your application.

  My App just read a cache string with small size (if not exist query
  from database) and then output the response, why it always turns out
  that it need to restart the whole application? It happens in 95% of
  incoming requests.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Application restart for almost every request? What happened?

2010-06-29 Thread Jake
I think this is more supportive of not being able to use GAE for
anything casual :)  Serious applications don't seem to suffer from
this problem.

Jake

On Jun 29, 9:28 am, Max max.at.xam...@gmail.com wrote:
 This is really one of the core problems why you cannot use GAE for
 anything serious. Even if you get enough traffic, some users suffer
 from instance recycling every second (read the comments at the issue).

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Discussion for Best Practices For App Engine With Example

2010-06-28 Thread Jake
Hey all,

I've seen a lot of posts like this that are overwhelmed with getters/
setters.  I wonder why more people haven't started to use lombok?
http://projectlombok.org/  It is, by far, the best tool I've found
when programming Java.  I'm just wondering why it's not more commonly
used.

Jake

On Jun 28, 5:02 pm, RAVINDER MAAN rsmaan...@gmail.com wrote:
 I have set up this project athttp://code.google.com/p/forumdiscussion/
 Please look at it and let me know if I need to change something.

 2010/6/28 Andrés Cerezo acerezoguil...@gmail.com



  You can share source code with a svn from eclipse, look at
 http://www.youtube.com/watch?v=15jItreEX1Mit's an installation and
  investigate about svn and google codes.

  2010/6/28 RAVINDER MAAN rsmaan...@gmail.com

  I am sorry for long post .But i just want to know about other peoples view
  on this .In a way I just want to know what is the best way to implement 
  this
  specification.May be it can be example project for other people .
     I am new to GAE so i dont know where to put its code and how to discuss
  it with other people.I am sorry for that can anyone suggest me the best way
  to discuss it with other people and how to share code ?
  Thanks .

   --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.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.

 --
 Regards,
 Ravinder Singh Maan

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-14 Thread Jake
Hey Rahul,

See 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/b57e6c4895333fa8/f5196d61f7f2
for an official discussion of this issue.  The first post talks about
discouraged workarounds, but doesn't cite the 60-second ping
specifically.  This was the result, though, of a string of prior
threads that discussed this issue and workaround.  As you can see from
the date, this is not a new problem.  Again, I used the 60-second ping
for awhile and it really didn't solve the problem - just ensured that
the loading requests happened every 60 seconds :)

As for the framework, good point.  I use Wicket which is pretty
powerful.  I've gotten it down to about 3-4 seconds load.  One plugin
had a dependency on Spring that I removed.  As discussed here:
http://code.google.com/p/objectify-appengine/wiki/BestPractices#Automatic_Scanning
anything that scans the classpath can be pretty demanding.

That being said, I'm not currently using my deployed application for
demonstrations - I use a development server hosted on our own
machines.  My hope is that the restart issue will be resolved someday.

Jake

On Jun 11, 11:07 am, Rahul rahul.jun...@gmail.com wrote:
 Jake,

 Is there any official comments on this from google which says that it
 discourage the pinging every 60 seconds or so.

 Also if we have some framework which we will always like to have if
 doing some production application then what is the way out.

 Thanks,
 Rahul

 On Jun 11, 10:16 am, Jake jbrooko...@cast.org wrote:

  Hi Mark,

  Yes, you can do better than 4.5 seconds without a framework.  Also,
  there are layers that can be placed over the low level datastore (e.g
  Objectify) that add ease-of-use without noticeable additions to the
  startup time.

  The 60 second pinging thing is, indeed, done by some users and is
  officially discouraged by Google.  At one point, I set up a similar
  pinging feature and found that it really didn't work.  Theoretically
  it should, but the pings just caused loading requests every minute or
  so, which simply reduced the likelihood that a user would see the
  loading request; it didn't solve the problem.

  Jake

  On Jun 11, 7:32 am, Mark mar...@gmail.com wrote:

   Hi, just joining in, trying to sum up:

   In the best case (if we only use the low level datastore + no
   frameworks on top) we can only hope that a fresh restart of our app
   will take 4.5 seconds?

   However if at least one user is hitting the site every 60 seconds from
   somewhere in the world, then our app should be kept alive and no need
   for restarts?

   Not that I'm planning on doing it, but what prevents developers from
   simply pinging the site every 60 seconds to force the app to stay in
   memory? I ask what prevents it because if I play by the rules, I'm
   going to get penalized if other developers are 'cheating' and doing
   the artificial pinging,

   Thanks

   On Jun 9, 5:49 am, Jake jbrooko...@cast.org wrote:

Hey Tin,

Several people were using GAE's built in timing mechanism to ping the
server to accomplish the same thing.  Google came out and officially
discouraged this as it tends to throw off any attempts they are
currently making to fix the problem.  I can't tell people what to do,
but I opted to stop using this hack in the hopes that they will solve
the problem.

Besides, you'll notice that this hack doesn't really work over the
long run.  It will essentially restart your server every minute and
won't really prevent the loading request from falling on your users
instead of on your ping.

Jake

On Jun 8, 1:54 pm, Tin tin.c...@gmail.com wrote:

 Hi all:

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

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

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



[appengine-java] Re: MD5 Hash

2010-06-11 Thread Jake
Hey,

Nothing additional on the build path.  I am using Enterprise Edition
of Java.  I'm pretty sure the security package falls under Standard
Edition, but meh.  Who knows?

Jake

On Jun 10, 4:59 pm, Michael mrher...@gmail.com wrote:
 I am using eclipse, do I need to add it to my build path?  I don't
 think I need to since it is not an external library?

 I'll play around with it some more. Hopfully I can find something.

 Michael

 On Jun 10, 3:35 pm, Jake jbrooko...@cast.org wrote:

  Hey,

  The method below works fine for me.  No extra dependencies.  Just
  worked.  So, not at all helpful other than perhaps something wonky
  with your java install?

  Jake

  import java.security.MessageDigest;

  private static String md5Hex (String email) {
          try {
                  MessageDigest md = MessageDigest.getInstance(MD5);
                  // more stuff
          } catch (Exception ex) {
                  /* No Action */
          }

  }

  On Jun 10, 2:42 pm, Michael mrher...@gmail.com wrote:

   Any ideas on what is wrong then?

   On Jun 10, 1:03 pm, Nacho Coloma icol...@gmail.com wrote:

That should not be your 
problem:http://code.google.com/appengine/docs/java/jrewhitelist.html

I am using MD5 in AppEngine without issues.

On Jun 10, 3:17 pm, Michael mrher...@gmail.com wrote:

 Hi,

 I am pretty new to app engine (and Java) and I am seem to have run in
 to a wall.  I want to do an MD5 hash and I was trying to use the
 java.security package, but I get:
  [ERROR] Line 3: The import java.security cannot be resolved

 I am thinking that it is because app engine can't use java.security?

 Here is the MD5 code I have

 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 ...
 try {
 MessageDigest digest = java.security.MessageDigest.getInstance(MD5);
 digest.update(test.getBytes());
 PW = digest.digest().toString();

 } catch (NoSuchAlgorithmException e) {
 }

 Am I doing something wrong, or is there a different way to get a MD5
 hash?  I also need to do the same thing client side using GWT if their
 is any advice for that too.

 Thanks
 Michael

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-11 Thread Jake
Hi Mark,

Yes, you can do better than 4.5 seconds without a framework.  Also,
there are layers that can be placed over the low level datastore (e.g
Objectify) that add ease-of-use without noticeable additions to the
startup time.

The 60 second pinging thing is, indeed, done by some users and is
officially discouraged by Google.  At one point, I set up a similar
pinging feature and found that it really didn't work.  Theoretically
it should, but the pings just caused loading requests every minute or
so, which simply reduced the likelihood that a user would see the
loading request; it didn't solve the problem.

Jake


On Jun 11, 7:32 am, Mark mar...@gmail.com wrote:
 Hi, just joining in, trying to sum up:

 In the best case (if we only use the low level datastore + no
 frameworks on top) we can only hope that a fresh restart of our app
 will take 4.5 seconds?

 However if at least one user is hitting the site every 60 seconds from
 somewhere in the world, then our app should be kept alive and no need
 for restarts?

 Not that I'm planning on doing it, but what prevents developers from
 simply pinging the site every 60 seconds to force the app to stay in
 memory? I ask what prevents it because if I play by the rules, I'm
 going to get penalized if other developers are 'cheating' and doing
 the artificial pinging,

 Thanks

 On Jun 9, 5:49 am, Jake jbrooko...@cast.org wrote:

  Hey Tin,

  Several people were using GAE's built in timing mechanism to ping the
  server to accomplish the same thing.  Google came out and officially
  discouraged this as it tends to throw off any attempts they are
  currently making to fix the problem.  I can't tell people what to do,
  but I opted to stop using this hack in the hopes that they will solve
  the problem.

  Besides, you'll notice that this hack doesn't really work over the
  long run.  It will essentially restart your server every minute and
  won't really prevent the loading request from falling on your users
  instead of on your ping.

  Jake

  On Jun 8, 1:54 pm, Tin tin.c...@gmail.com wrote:

   Hi all:

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

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

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



[appengine-java] Re: MD5 Hash

2010-06-10 Thread Jake
Hey,

The method below works fine for me.  No extra dependencies.  Just
worked.  So, not at all helpful other than perhaps something wonky
with your java install?

Jake

import java.security.MessageDigest;

private static String md5Hex (String email) {
try {
MessageDigest md = MessageDigest.getInstance(MD5);
// more stuff
} catch (Exception ex) {
/* No Action */
}
}


On Jun 10, 2:42 pm, Michael mrher...@gmail.com wrote:
 Any ideas on what is wrong then?

 On Jun 10, 1:03 pm, Nacho Coloma icol...@gmail.com wrote:

  That should not be your 
  problem:http://code.google.com/appengine/docs/java/jrewhitelist.html

  I am using MD5 in AppEngine without issues.

  On Jun 10, 3:17 pm, Michael mrher...@gmail.com wrote:

   Hi,

   I am pretty new to app engine (and Java) and I am seem to have run in
   to a wall.  I want to do an MD5 hash and I was trying to use the
   java.security package, but I get:
    [ERROR] Line 3: The import java.security cannot be resolved

   I am thinking that it is because app engine can't use java.security?

   Here is the MD5 code I have

   import java.security.MessageDigest;
   import java.security.NoSuchAlgorithmException;
   ...
   try {
   MessageDigest digest = java.security.MessageDigest.getInstance(MD5);
   digest.update(test.getBytes());
   PW = digest.digest().toString();

   } catch (NoSuchAlgorithmException e) {
   }

   Am I doing something wrong, or is there a different way to get a MD5
   hash?  I also need to do the same thing client side using GWT if their
   is any advice for that too.

   Thanks
   Michael

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-09 Thread Jake
Hey Tin,

Several people were using GAE's built in timing mechanism to ping the
server to accomplish the same thing.  Google came out and officially
discouraged this as it tends to throw off any attempts they are
currently making to fix the problem.  I can't tell people what to do,
but I opted to stop using this hack in the hopes that they will solve
the problem.

Besides, you'll notice that this hack doesn't really work over the
long run.  It will essentially restart your server every minute and
won't really prevent the loading request from falling on your users
instead of on your ping.

Jake

On Jun 8, 1:54 pm, Tin tin.c...@gmail.com wrote:
 Hi all:

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

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

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-07 Thread Jake
Hey,

The logs show what is being GET for any message.  When loading some
pages, I noticed that, beyond the initial delay of the page, I saw an
8s delay on one of the javascript files that was referenced in the
code.  When I checked the GAE logs, I saw a startup request for the
initial GET for the HTML and then one immediately following GET for
the javascript file.  I suppose it is possible that this was a new
instance spawning (instead of a restart), but I find that unlikely
since I was the only user of my application.  Or, if it is the case
that GAE needs to spawn multiple JVMs to support one full page
request, I think that is a problem :)

Anyways, end result is that from a period of inactivity with no
instances running, I went to my homepage once and saw two loading
requests in the logs right after one another for that single page
load.  This has happened more than once.  Granted, it's now been a
couple of weeks since I last tested this behavior, but I haven't heard
any feedback on my issue to suggest that it has changed.

Jake

On Jun 5, 8:45 pm, Thomas mylee...@gmail.com wrote:
 Hi Jake:

     I am curious about how do you know there were 2 startup during one
 request? Did you submit an issue about the phenomenon?

 On 6月6日, 上午2時34分, Jake jbrooko...@cast.org wrote:

  Hey Thomas,

  I get it all the time - to the point where all of my demonstration
  applications are using the development server hosted on a non-GAE
  machine :)  Anyways, Ikai is (was) aware of the issue from awhile
  back, but I'm not sure it's taking priority.

  Jake

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-07 Thread Jake
Hey,

Here's a concrete example.  One page load, 3 loading requests: one for
the library page, another for a CSS file for that page, and a third
for an image on that page.  The end result, after a lot of
optimization, is 24 seconds from initial page arrival to full
display.  And, it's likely that by the time the page has displayed,
the JVM instance has shut down and the next user interaction will
cause another loading request.

05-27 08:59AM 16.068 /resources/indira/img/buttons/share_o.png 200
4665ms 4160cpu_ms 1kb Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5;
en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe)
05-27 08:59AM 20.707
This request caused a new process to be started for your application,
and thus caused your application code to be loaded for the first time.
This request may thus take longer and use more CPU than a typical
request for your application.

05-27 08:59AM 05.109 /resources/org.apache.wicket.Application/css/
tht.css 200 4014ms 3946cpu_ms 0kb Mozilla/5.0 (Macintosh; U; Intel Mac
OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe)
05-27 08:59AM 09.100
This request caused a new process to be started for your application,
and thus caused your application code to be loaded for the first time.
This request may thus take longer and use more CPU than a typical
request for your application.

05-27 08:58AM 56.380 /library;jsessionid=fU8dpFQMEe1Ec3BqNEY2vQ 200
8394ms 8142cpu_ms 170api_cpu_ms 3kb Mozilla/5.0 (Macintosh; U; Intel
Mac OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/
3.6.3,gzip(gfe)
05-27 08:59AM 04.773
This request caused a new process to be started for your application,
and thus caused your application code to be loaded for the first time.
This request may thus take longer and use more CPU than a typical
request for your application.

Thanks!

Jake

On Jun 7, 9:40 am, Jake jbrooko...@cast.org wrote:
 Hey,

 The logs show what is being GET for any message.  When loading some
 pages, I noticed that, beyond the initial delay of the page, I saw an
 8s delay on one of the javascript files that was referenced in the
 code.  When I checked the GAE logs, I saw a startup request for the
 initial GET for the HTML and then one immediately following GET for
 the javascript file.  I suppose it is possible that this was a new
 instance spawning (instead of a restart), but I find that unlikely
 since I was the only user of my application.  Or, if it is the case
 that GAE needs to spawn multiple JVMs to support one full page
 request, I think that is a problem :)

 Anyways, end result is that from a period of inactivity with no
 instances running, I went to my homepage once and saw two loading
 requests in the logs right after one another for that single page
 load.  This has happened more than once.  Granted, it's now been a
 couple of weeks since I last tested this behavior, but I haven't heard
 any feedback on my issue to suggest that it has changed.

 Jake

 On Jun 5, 8:45 pm, Thomas mylee...@gmail.com wrote:

  Hi Jake:

      I am curious about how do you know there were 2 startup during one
  request? Did you submit an issue about the phenomenon?

  On 6月6日, 上午2時34分, Jake jbrooko...@cast.org wrote:

   Hey Thomas,

   I get it all the time - to the point where all of my demonstration
   applications are using the development server hosted on a non-GAE
   machine :)  Anyways, Ikai is (was) aware of the issue from awhile
   back, but I'm not sure it's taking priority.

   Jake

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-07 Thread Jake
Hi all,

@Thomas:  I will look into that, thank you.  The way we generate our
pages in this framework, however, involves some interesting dynamic
generation of image URLs that are mounted within the application
itself.  It ends up being a bit more complicated than just displaying
one string or another for the src attribute.  Whether this is a good
practice on GAE is certainly up for debate, but I presume this
wouldn't help the frequent restart issue, correct?  It just means that
fewer files would be able to trigger a restart?

@Tin:  I'm not sure I understand what I will learn from this.  From
what I understand, contextDestroyed() is never called so all I would
see is an additional log statement near GAE's loading request logging
line?  I've never used a ServletContextListener, so perhaps it has
other features that I'm not aware of?

Thanks!

Jake

On Jun 7, 11:41 am, Tin tin.c...@gmail.com wrote:
 Hi Jack:

 I suggest that maybe you can write a ServletContextListener to monitor
 the web instance reloading issue, for our testing we just put a info
 logging in the contextInitialized(..) method:

 public void contextInitialized(ServletContextEvent evt) {
   log.info(Web context inited.);

 }

 And modify the DEFAULT logging level to INFO in the logging.properties
 file. If the web instance was reloaded, we could trace this in the
 logging messages.

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-05 Thread Jake
Hey Thomas,

I get it all the time - to the point where all of my demonstration
applications are using the development server hosted on a non-GAE
machine :)  Anyways, Ikai is (was) aware of the issue from awhile
back, but I'm not sure it's taking priority.

Jake

On Jun 4, 1:33 am, Thomas mylee...@gmail.com wrote:
 On 6月4日, 下午12時02分, Jake jbrooko...@cast.org wrote:

  I understand that there can be problems with everyone having a full-
  time reserved JVM.  My problem is simply that the instance restarts
  too frequently.  I mean, honestly, one SINGLE page request results in
  TWO application restarts?  Even if you get it down to 4 seconds,
  that's 8-10 seconds just for the page to load.

    I personally have never seen the two continuous app loading in a
 single request before. Maybe you should open an issue to let google
 guy's help you.

  I confess, I'm not an expert on the technology involved.  Is it
  technologically difficult to say, if a JVM gets any traffic, hold it
  open for 5 minutes at a minimum.  This can be cheated by the keep
  alive pinging that people are doing, but perhaps that can be ignored
  and only external traffic counts?

    I guess google can't tell the 'keep alive' tasks from normal tasks
 without reverse engineering the code. Banning 'keep alive' task will
 kill the normal tasks also probably.

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-03 Thread Jake
Hello,

If you don't like this general behavior, please star this issue:
http://code.google.com/p/googleappengine/issues/detail?id=2931

I see comments like this pop up all the time, but we must be a rarity.

Anyways, regarding the pay to reserve JVM see this issue:
http://code.google.com/p/googleappengine/issues/detail?id=2456

I personally don't like this solution as it seems to be paying for
minimum functionality.

Thanks!

Jake



On Jun 3, 9:34 am, Tin tin.c...@gmail.com wrote:
 Dear Thomas:

 Thanks for your quickly reply very much !!!

  2. Wait for 'paid to reserve JVM feature'.

 Do you have more information about this ?

  3. Use lightweight framework.

 What lightweight framework did you mean for ?
 In this testing we just using Servlet and JSP that's recommend by GAE.

 Thank you again !!!

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



[appengine-java] Re: Performance issue for GAE auto-restart

2010-06-03 Thread Jake
I understand that there can be problems with everyone having a full-
time reserved JVM.  My problem is simply that the instance restarts
too frequently.  I mean, honestly, one SINGLE page request results in
TWO application restarts?  Even if you get it down to 4 seconds,
that's 8-10 seconds just for the page to load.

I confess, I'm not an expert on the technology involved.  Is it
technologically difficult to say, if a JVM gets any traffic, hold it
open for 5 minutes at a minimum.  This can be cheated by the keep
alive pinging that people are doing, but perhaps that can be ignored
and only external traffic counts?

Jake

On Jun 3, 8:21 pm, Thomas mylee...@gmail.com wrote:
      I use struts 1.2.x + Spring 2.0 initially. But quickly I realized
  I had to get rid of Spring in order to decrease the startup time. So I
  wrote a TidyDelegationProxy (tidy means TIny DependencY injector) to
  replace Spring's struts proxy. I successfully reduced the startup CPU
  time from 12+ seconds to 6 seconds.

    Correct some mistakes.
    I use struts 1.2.x + Spring 2.0 + JDO initially. But quickly I
 realized I had to get rid of Spring and JDO in order to decrease the
 startup time. So I
 used slim3 and wrote a TidyDelegationProxy to replace Spring's struts
 proxy. I successfully reduced the startup CPU time from 12+ seconds to
 6 seconds.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: What Framework to use?

2010-05-24 Thread Jake
I'm also using Wicket and it works well.  I have had some difficulties
with GAE but, after many months of debugging, I do not believe they
are related to Wicket.  Sometimes, I have a pretty long startup time,
but it is never during the actual Wicket startup (from filter init to
app ready) - it's always the 3-8 seconds before the filter
initializes.  The framework itself is great.

Jake

On May 21, 10:30 pm, nicolas melendez nfmelen...@gmail.com wrote:
 chose the Wicket way!



 On Fri, May 21, 2010 at 7:22 PM, jnizet jni...@gmail.com wrote:
  I have used Stripes on GAE : seehttps://memwords.appspot.com/and
 http://code.google.com/p/memwords/for the sources. It's a very
  elegant and productive action-based framework, which works very well
  on GAE. I have a 5-10 seconds cold startup time on GAE, but once it's
  started, it flies.

  JB.

  On May 21, 9:40 pm, Rusty Wright rwright.li...@gmail.com wrote:
   Stripes.  http://www.stripesframework.org/display/stripes/Home

   On 2010-05-21 09:29, hurray! wrote:

I am looking for a web framework to use on GAE that
1. Provides pretty URLs
2. Makes passing data to views easier.
3. Is productive.

I tried Grails for a small app, but the startup time was too long.

I am curious what framework do you guys use for a small to medium
sizeapp (that gets a few hundred visits per day)? Please advise based
on your production level experience on GAE.

   --
   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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  .
   For more options, visit this group athttp://
  groups.google.com/group/google-appengine-java?hl=en.

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

 --
 NM (Nicolás Meléndez)
 Java Software Developer

 A) Google App Engine works:

 1)http://www.clasificad.com.ar- Local free classifieds for  housing, sale,
 services, local community, curses,jobs, and events - GAE/J + Wicket + YUI

 2)http://www.chessk.com- Massive multiplayer chess online - GAE/J +
 Applets + Wicket

 B) Linkedin:http://ar.linkedin.com/in/nicolasmelendez

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

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



[appengine-java] Re: Best method to set up nested classes in Objectify

2010-05-24 Thread Jake
Hey,

I'll try to answer this, but I'm not an expert - would love to hear an
expert's opinion of my answer.

When you say inside, it can be a bit misleading to me.  If you're
talking about Embedded classes, the entire object is fetched, so that
wouldn't help for #1 or #2.  If you are just talking about a field
reference to another object, e.g.

public class A {

  private Long id;
  private B child;
}

then I don't believe B will be fetched unless explicitly accessed.
At least, that is what the GAE Relationship Documentation for JDO
implies.  I think Objectify is missing some documentation on how this
behavior works (or does it even work?).  Regardless, your concerns
about Option #3 may still exist in Option #1 if Objectify doesn't
support cascading deletes, etc.  I'm pretty sure Option #2 doesn't
work in any scenario.

Anyways, I use Option #3 and it works quite well.  Your concerns are
valid, but can be handled with proper programming.

Jake

On May 22, 3:07 pm, Michael mrher...@gmail.com wrote:
 Hi,

 I am new to app engine (using it with GWT).  I have a class with a lot
 of data in it.  nearly 100% of the time my program only needs two of
 the fields.  I want to break it up in to two classes: A (with the data
 needed often) and B (less common data).  Class A is also sent back and
 fourth from the client and server often, so I think it's important
 that I can just send class A and not B to keep bandwidth down. How
 should I set it up, I see a few different ways
 1 B inside of A
 2 A Inside of B
 3 A with a key to B

 Method 1 seems bad because I can't send A to the client without
 sending all of B.  I am really new to Objectify, can I fetch just A
 (querying on one of the parameters) using method 2?  Method 3 seems
 the only working way, but then I run the risk of a B with no A
 pointing to it or A pointing to  B that doesn't exist if something
 happens while deleting.  Is there a good way to avoid this?  Or should
 I just keep all of my data in one large class?

 What do you think is the best method?

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

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



[appengine-java] Re: What Framework to use?

2010-05-24 Thread Jake
Hey,

I also dropped JDO in favor of Objectify.  I tried loading your site 4
times in the span of about 4 minutes: 3 times the delay was over 9
seconds, sometimes up to 15 seconds.  I presume those were loading
requests as the delay was all located in the initial request.  These
still remain my biggest complaints with GAE: low traffic sites see
loading requests make up 30-50% of their requests and the
unpredictable delay between request and filter init() on such loading
requests.

Jake

On May 24, 11:31 am, nicolas melendez nfmelen...@gmail.com wrote:
 You can see my wicket and gae app, the start up time is aceptable because it
 doesn't use jdo. Www.clasificad.com.ar

 El may 24, 2010 10:30 a.m., Jake jbrooko...@cast.org escribió:

 I'm also using Wicket and it works well.  I have had some difficulties
 with GAE but, after many months of debugging, I do not believe they
 are related to Wicket.  Sometimes, I have a pretty long startup time,
 but it is never during the actual Wicket startup (from filter init to
 app ready) - it's always the 3-8 seconds before the filter
 initializes.  The framework itself is great.

 Jake

 On May 21, 10:30 pm, nicolas melendez nfmelen...@gmail.com wrote:

  chose the Wicket way!

  On Fri, May 21, 2010 at 7:22 PM, jnizet jni...@gmail.com wrote:
   I have used Stripes on GAE : seehttps://memwords.appspot.com/and
  http://code.google.com/p/memwords/forthe sources. It's a very
   elegant and productive action-...
   google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com

 google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com



   .
For more options, visit this group athttp://
   groups.google.com/group/google-appengin...
   google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com

 google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com



   .
   For more options, visit this group at
  http://groups.google.com/group/google-appengine-j...

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

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



[appengine-java] Re: App Engine cold starts and overly aggressive cycling

2010-05-06 Thread Jake
My big wonder all along is why only some people get it and not
others.  My restarts have always happened frequently - sometimes 1-2
restarts within the same page load.  But, evidenced by my issue post,
most people don't have this problem.  Did you change anything
recently?

Anyways, just more incentive to get your app startup time to under
500ms :)

Jake

On May 6, 1:56 am, brianl licht...@gmail.com wrote:
 This is quite an UGLY UGLY issue.  GAEJ was working great till now.
 May have to start looking for alternatives.  Seeing restarts within a
 few seconds to a few minutes of one another...

 05-05 10:41PM 29.289 This request caused a new process to be started
 for your application,
 ...
 05-05 10:41PM 22.310 This request caused a new process to be started
 for your application,
 ...
 05-05 10:39PM 22.960 This request caused a new process to be started
 for your application,

 GWT 2.0.3, GAEJ 1.3.3, RemoteServiceServlets, Objectify 2.1.

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

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



[appengine-java] Re: WARNING: This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take

2010-05-05 Thread Jake
I believe the general thought is that any persistence problems caused
by a recycled application are to be expected and you should work to
handle those issues.  Sessions can be used to hold state, but
application variables need to be able to recover from an application
restart (or a newly spawned instance).  As for lasting longer, I
totally agree - I'm also running mine on a small scale and reload
requests happen far too frequently.  See and Star:
http://code.google.com/p/googleappengine/issues/detail?id=2931

Jake

On May 5, 9:48 am, Christian Goudreau goudreau.christ...@gmail.com
wrote:
 And what about app that will no see their traffic grows ?

 Mine is mostly an intranet and it's annoying to see how slow it is because
 of those sleep time... Is it possible to make them last longer ? I even get
 some persistance problems when it goes to sleep...

 I'm using guiceFilters with the command pattern and I have to do a simple
 put in two-three request each time because of that.

 Christian

 On Thu, Apr 22, 2010 at 3:19 PM, Ikai L (Google) ika...@google.com wrote:



  You're getting this warning because your requests are mostly loading
  requests. As your traffic grows, this will go away, since less of your
  requests will be startup requests. It's there to tell you that your app
  isn't running slow - it's taking more time than it normally should because
  of initialization.

  Nevertheless, I think the general feedback has been it's a great feature,
  but I'd like to turn it off or hide it. I'l raise this with the team.

  On Thu, Apr 22, 2010 at 3:33 AM, Abhimanyu Saxena 
  abhimanyusax...@gmail.com wrote:

  so what does it mean? I am repeatedly getting this warning with my
  app... is there anything that I can do for it ?

  On Apr 22, 7:24 am, Tristan tristan.slomin...@gmail.com wrote:
   Is it possible to make it an INFO and not a WARNING? Should I start an
   issue? As a programmer, I really don't have any direct control over
   this. All the WARNINGS are just masking other important issues that
   should be warnings.

   On Apr 21, 1:33 pm, Ikai L (Google) ika...@google.com wrote:

Yep, we're rolling this out slowly with the 1.3.3 release to let
  developers
know that some requests are slow because they are startup requests.

On Wed, Apr 21, 2010 at 6:09 AM, Tristan tristan.slomin...@gmail.com
  wrote:

 Hey,

 I started seeing when a task queue starts now:

 WARNING: 200 OK
 This request caused a new process to be started for your
  application,
 and thus caused your application code to be loaded for the first
  time.
 This request may thus take longer and use more CPU than a typical
 request for your application.

 instead of this

 WARNING: 500
 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.

 I like it. Is this the expected behavior from now on?

 Tristan

 --
 You received this message because you are subscribed to the Google
  Groups
 Google App Engine for Java group.
 To post 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
 .
 For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.

--
Ikai Lan
Developer Relations, Google App Engine
Twitter:http://twitter.com/ikai
Delicious:http://delicious.com/ikailan


Google App Engine links:
Blog:http://googleappengine.blogspot.com
Twitter:http://twitter.com/app_engine
Reddit:http://www.reddit.com/r/appengine

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

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

  --
  You received this message

[appengine-java] Re: Cold starts

2010-04-29 Thread Jake
I feel paying for a warm JVM instance doesn't really fall in with what
I want.  When I first started GAE, someone from Google hinted that a
single JVM should stay warm for quite some time (perhaps up to an
hour?) from a single hit.  In my application, users can expect to sit
on a page for 30+ seconds.  As a result, I would say at least 30-40%
of my requests are loading requests.

Jake

On Apr 28, 2:01 am, Richard richard.wat...@gmail.com wrote:
 Done, thanks. I had also starred the pay-for-instances but it was far
 too noisy a topic!

 On Apr 27, 7:16 pm, Jake jbrooko...@cast.org wrote:



  Star this?  :)

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

  On Apr 27, 4:33 am, Richard richard.wat...@gmail.com wrote:

   My app has a *lot* of cold starts. Sometimes after 2 or 3 minutes,
   which seems very aggressive. I've let it go, tried to be good and
   waited for it to improve. Today I tried Pingdom and set it to a
   minute. Instant improvement.

   Googleistas, I really, really don't like doing that. I'll likely
   switch it off because I'm trying to be a good citizen, but the system
   is really driving bad behaviour - I imagine anyone who vaguely depends
   on GAE for money is pinging the heck out of their apps. Any chance
   we're going to get it sorted soon?

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

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

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

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



[appengine-java] Re: Cold starts

2010-04-27 Thread Jake
Star this?  :)

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

On Apr 27, 4:33 am, Richard richard.wat...@gmail.com wrote:
 My app has a *lot* of cold starts. Sometimes after 2 or 3 minutes,
 which seems very aggressive. I've let it go, tried to be good and
 waited for it to improve. Today I tried Pingdom and set it to a
 minute. Instant improvement.

 Googleistas, I really, really don't like doing that. I'll likely
 switch it off because I'm trying to be a good citizen, but the system
 is really driving bad behaviour - I imagine anyone who vaguely depends
 on GAE for money is pinging the heck out of their apps. Any chance
 we're going to get it sorted soon?

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

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



[appengine-java] Re: App Engine cold starts and overly aggressive cycling

2010-04-23 Thread Jake
Another wicket user!

I'm down to about 2-3 seconds for the WicketFilter init(), which
includes the Application init().  Since I figure I'm only allowed
about 2-3 seconds, I realized that it was either give up Wicket or
give up JDO.  So, I swapped out JDO for Objectify and couldn't be
happier.  You may want to look into that.  Objectify can also use the
MemCache if you're getting by key, which (I believe) means that
multiple instance restarts will be able to use the same cached data
for speedier recovery.

I don't want to hijack this thread, but if you have a moment, I'd love
for you to take a look one of my Wicket/GAE issues at
http://apache-wicket.1842946.n4.nabble.com/GAE-loses-shared-resources-td1883638.html
to see if you have any advice.

Thanks!

Jake

On Apr 22, 1:32 pm, Esteban Ignacio Masoero emaso...@getsense.com.ar
wrote:
 Yes, I've done the same thing. In my case, the numbers about initialization
 are these:

 3 sec - gae (apparently some internal thing)
 2 sec - presentation framework initialization (wicket in my case)
 4 sec - 2 sec for pm factory creation + 2 sec for 2/3 queries I make
 1 sec - wicket and maybe some other gae stuff

 I'm working on reducing my 4 sec part, but it's really dificult, because the
 queries are done with a pk, so I think I can't do anything else.

 By the way, I voted your issue! Hope Google guys give this matter some
 urgent attention, because I think it's really serious problem.

 Regards,

 Esteban



 On Thu, Apr 22, 2010 at 12:34 PM, Jake jbrooko...@cast.org wrote:
  I'm also still seeing this issue.  I have an open ticket here:
 http://code.google.com/p/googleappengine/issues/detail?id=2931but
  it's not getting much attention :)

  Anyways, I've seen this as encouragement to make my startup time much
  more efficient, so I guess that's a good thing :)  My remaining issue
  is that there is a delay (2-10 seconds) between the initial request
  and when my servlet filter is initialized.  Unless I'm mistaken, I
  have no control over that.

  Jake

  On Apr 21, 4:34 pm, Esteban Ignacio Masoero emaso...@getsense.com.ar
  wrote:
   Hi there:

   I'm experiencing the same issue. From what we've seen, after 5 minutes of
   being accessed, our app gets cycled out. Are there any news about this?
   Has anyone created an isue about this problem?

   Thanks,

   Esteban

   On Wed, Mar 3, 2010 at 1:24 PM, Robert Lancer robert.lan...@gmail.com
  wrote:

Me too App ID ArachnoDB loading GData and its dependencies, happens
about every 2 minutes on average, I will add in a logger and follow up
but I can tell a load request from a normal request.

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

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

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

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

 Any other information you can provide would be helpful.

 --
 Ikai Lan
 Developer Programs Engineer, Google App Engine

--
You received this message because you are subscribed to the Google
  Groups
Google App Engine for Java group.
To post to this group, send email to
google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com

.
For more options, visit this group at
   http://groups.google.com/group/google-appengine-java?hl=en.

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

[appengine-java] Re: App Engine cold starts and overly aggressive cycling

2010-04-22 Thread Jake
I'm also still seeing this issue.  I have an open ticket here:
http://code.google.com/p/googleappengine/issues/detail?id=2931 but
it's not getting much attention :)

Anyways, I've seen this as encouragement to make my startup time much
more efficient, so I guess that's a good thing :)  My remaining issue
is that there is a delay (2-10 seconds) between the initial request
and when my servlet filter is initialized.  Unless I'm mistaken, I
have no control over that.

Jake

On Apr 21, 4:34 pm, Esteban Ignacio Masoero emaso...@getsense.com.ar
wrote:
 Hi there:

 I'm experiencing the same issue. From what we've seen, after 5 minutes of
 being accessed, our app gets cycled out. Are there any news about this?
 Has anyone created an isue about this problem?

 Thanks,

 Esteban

 On Wed, Mar 3, 2010 at 1:24 PM, Robert Lancer robert.lan...@gmail.comwrote:



  Me too App ID ArachnoDB loading GData and its dependencies, happens
  about every 2 minutes on average, I will add in a logger and follow up
  but I can tell a load request from a normal request.

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

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

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

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

   Any other information you can provide would be helpful.

   --
   Ikai Lan
   Developer Programs Engineer, Google App Engine

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

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group 
 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: How to exclude the optional jars for deployment?

2010-04-21 Thread Jake
 be appreciated :)

Jake

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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 exclude the optional jars for deployment?

2010-04-21 Thread Jake
Forgot to post the relevant pom.xml bits:


dependencies
  !-- Insert Many Workspace Dependencies Here --
  dependency
groupIdcom.googlecode.objectify/groupId
artifactIdobjectify/artifactId
version2.1/version
  /dependency
  dependency
groupIdnet.sf.saxon/groupId
artifactIdsaxon/artifactId
version9.1.0.8/version
  /dependency
  dependency
groupIdnet.sf.saxon/groupId
artifactIdsaxon-dom/artifactId
version9.1.0.8/version
  /dependency
  dependency
groupIdjavax.servlet/groupId
artifactIdservlet-api/artifactId
version2.5/version
typejar/type
scopeprovided/scope
  /dependency
  dependency
groupIdorg.apache.geronimo.specs/groupId
artifactIdgeronimo-jpa_3.0_spec/artifactId
version1.1.1/version
typejar/type
scopecompile/scope
  /dependency
  dependency
groupIdnet.sf.jsr107cache/groupId
artifactIdjsr107cache/artifactId
version1.1/version
typejar/type
scopecompile/scope
  /dependency
/dependencies

build
  plugins
plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-war-plugin/artifactId
  configuration
warSourceDirectory${basedir}/src/main/webapp/warSourceDirectory
  /configuration
/plugin
plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-compiler-plugin/artifactId
  version2.1/version
  configuration
compilerVersion1.6/compilerVersion
source${jdk.version.source}/source
target${jdk.version.target}/target
  /configuration
/plugin
  /plugins
/build




On Apr 21, 1:54 pm, Jake jbrooko...@cast.org wrote:
 No problem :)

  Hm, I think that if you had chosen to set the This project has a war
  directory setting, and set it to src/main/webapp, this error could have
  gone away.

 Yup, I discovered that eventually - it was all about the ordering.  I
 think the best solution here would either give a more specific step-by-
 step process for GAE users (since the current correct path is to
 follow the instructions for non-Java EE Eclipse users) and/or have the
 error message that pops up give a hint about setting the WAR
 directory.

  I think for runtime, they are referring to the server on which your
  application will run. The best thing was indeed to select none, because
  App Engine's server is not one of the choices. The default configuration is
  a good choice too, unless you want to add other stuff, like Web Services,
  JSF, etc..

  We should improve the doc in our FAQ.

 I'm a cog in a slightly larger programming machine.  So, when it comes
 to Eclipse, I know just enough to get my applications running and then
 I spend all my time in the Java trenches.  I know it's not Google's
 job to write FAQs for Eclipse, but you did such a great job with the
 other steps (in description) that it would be nice to have
 explanations here.  As you say, the default worked, but you suggest
 adding other stuff like Web Services and JSF which, I'll admit, I
 know nothing about those words other than I see them a lot on these
 forums :)  The GAE documentation frequently points people to other
 places where they can learn about non-GAE technologies - I hope that
 you do it here, too :)

  Looks like we need to have some sort of break-out in the FAQ for those users
  that are working with App Engine-only projects.

 Yes, please, if only to point to the correct help documents
 elsewhere.  Again, by a hint from someone else in another forum, I
 followed the steps for non-Java EE Eclipse users (even though I use
 the Eclipse Java EE version).

  Couldn't you have gone back to Use Specific SDK, and chosen the one listed
  on your build path (instead of having to use one of the SDKs that are
  installed with the plugin)?

 I apologize...I have since had to wipe this test project (and the
 Eclipse installation) for completely unrelated reasons, so I can't
 reproduce anything at the moment - though I still have the pom.xml.
 From memory, though, I believe changing the option in the Google menus
 did not change the SDK that was listed in the Eclipse build path.

  Can you elaborate on the pom.xml-related problem? Was this GPE reporting an
  error, or the Maven plugin?

 Again, from memory, the errors were symptomatic of missing Jar files
 during compile time and/or duplicate Jar files - GPE was not reporting
 any errors at this point.  I'm not sure what the best solution is when
 mixing maven with the plugin (and I'm certainly not the best person to
 ask about it).  However, it seems that if someone is dead set on using
 maven, then perhaps all jar files should be loaded via maven and the
 GPE could generate a pom.xml with the necessary base files.

  How did you end up fixing the problem? Was geronimo_jpa missing from the
  pom.xml?

 Yes, I put geronimo_jpa back in my pom.xml, which I think is strange
 since it was listed on the build path along with the other dozen+ GAE
 jars.  This goes back to my previous comment

[appengine-java] Re: How to exclude the optional jars for deployment?

2010-04-15 Thread Jake
Hello,

Thanks for the help.  This is quite a long, detailed post, but
hopefully it will help generate some documentation.

I started by making an exact copy of an existing Maven/GAE project
that I've been working on.  The pom.xml file for that project has a
few build commands that run embedded ANT scripts that call the
executables in the SDK direcotry that either run the instance locally
or deploy it.  Everything is done within Eclipse.

So, I've taken that copy, Right Clicked in Eclipse, Google-App Engine
Settings...

I check Use Google App Engine and try to set the Application ID, but
it claims that the appengine-web.xml is missing.  It is currently
there under src/main/webapp/WEB-INF where the standard Maven would
place it.  Without the ability at this point to designate where to
find the file, I'm stuck unless I choose to create a new project
according to the GPE FAQ.

So, I create a new Dynamic Web Project per the FAQ.  I'm not really
sure what to set for Runtime or Configuration, either because I'm an
eclipse newb or I'm not entirely certain how this will run in the
end.  I set that project up, copy over all of my code/resources and
the pom.xml and enable Maven Dependency Management.  At this point, it
looks like a clean maven package and I pull out all of my ANT scripts
from the pom.xml (since I shouldn't need them now).

I'm using Eclipse for Java EE.  Continuing with the FAQ, it talks
about enabling GWT, which I do not want to do.  Elsewhere, it was
suggested that I look at the FAQ for users who are not using Eclipse
for Java EE.

So, I set the This project has a WAR directory (and, at this point
realize I could probably have done that on my original application
without starting from scratch and copying over the files).  I am able
to enable Google App Engine for this project, but I get a few build
path errors.  For example, I accidentally selected a missing SDK at
first.  Selecting the correct path for the SDK in the Google Screen
didn't seem to remove the previous bad path, so I'm doing that
manually.  It also complained about the existing GAE files in my
pom.xml, but did so in a roundabout way.

I tried doing a Maven Package per the FAQ, but it claimed
javax.persistence did not exist.  I see geronimo_jpa on the google
supplied list of resources in my build path, but it's not working?
Anyways, put it back in my pom.xml and it packaged into the  /target/
directory.  (At some point, I also removed all folders from ORM
enhancement since I use Objectify).

Finally, I ran as a WebApplication.  On the bright side, I'm getting
completely different problems now :)  I'm getting files not found:

javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
113)
at org.mortbay.xml.XmlParser.init(XmlParser.java:69)

WARNING: Nested in javax.xml.parsers.FactoryConfigurationError:
Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found:
java.lang.ClassNotFoundException: org/apache/xerces/jaxp/
SAXParserFactoryImpl
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)

I'm not an expert on XML parsing - it's a small miracle I got it
working in the first place under my old deployment methods.  Here are
my dependencies:

net.sf.saxon - saxon - 9.1.0.8
net.sf.saxon - saxon-dom - 9.1.0.8
xml-resolver - 1.2
xml-apis - 1.3.03

Do I know the difference between Xerces and Saxon?  Nope.  Do I care
what I use?  Nope.  Do I know if that was even a valid question?
Nope.  I used Saxon merely because I was getting some errors with
Xerces back in the day, so I presumed GAE was somehow incompatible.  I
see this bug report: 
http://code.google.com/p/googleappengine/issues/detail?id=1367
However, I don't really understand it and/or what I need to do :)
Regardless, it was working fine *without* GPE, so I presume my issue
is a GPE bug, not an AppEngine bug.

What did I do differently this time?  I believe it has something to do
with Maven Packaging options (WAR vs JAR), and failing to refresh the
target folder in Eclipse.  I don't think that was the actual folder
I was selecting the first time I ran the Web Application when I tried
this last.  So, documentation there could be helpful.  I think I was
diving deep into the WTP temp folder when I couldn't figure it out.

So, it looks now as if my dependencies are somehow failing with GPE,
instead of the entire thing failing.  I'm going to leave the entire
post there so you can see my process (and perhaps update some FAQs to
help make it simpler.

Thanks for any help in advance!

Jake

Jake


On Apr 14, 10:57 am, Rajeev Dayal rda...@google.com wrote:
 Hey Jake,

 I just took a look at the thread that you mentioned. Could you describe the
 problems that you were running into (on the original thread)? I can try and
 help you out.

 Rajeev

 On Tue, Apr 13, 2010 at 10:21 AM, John Patterson jdpatter

[appengine-java] Re: How to exclude the optional jars for deployment?

2010-04-13 Thread Jake
I tried using GPE 1.3 here:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/2212abc544b3cef5/
However, I never managed to get it working properly and gave up after
a few hours.  I currently use plain maven with an Ant script to run
the command line GAE tools.  I'll probably dive back into the plugin
at some point, but I'm not sure it has flexibility as its main focus.
I mean, the latest SDK (1.3.2) isn't even in the central repository
yet :)

Jake

On Apr 12, 11:19 am, Rajeev Dayal rda...@google.com wrote:
 +[Keith]

 @Jake: Actually, version 1.3 of the Google Plugin for Eclipse is far more
 maven-friendly. What problems are you running into? 
 Seehttp://code.google.com/eclipse/docs/faq.html#gwt_with_mavenfor more
 information.

 On Fri, Apr 9, 2010 at 7:22 PM, Jake jbrooko...@cast.org wrote:
  Or you could forgo the plugin and use maven to build/upload your
  projects.  Then, you determine the jars to be included.  This was the
  primary reason that I wanted the plugin to support maven, but that
  became non-trivial and the documentation wasn't very helpful.

  Jake

  On Apr 9, 10:05 am, Rajeev Dayal rda...@google.com wrote:
   Unfortunately, there is no great way to disable all of the JDO-related
   features on a given App Engine project. If you could, file a feature
  request
   for this in the issue tracker.

   The best way to exclude these jars would be to remove them from your
   war/WEB-INF/lib directory, and when the plugin complains that they're
   missing, add them to the list of exclusions of jars that are on the build
   path but are not required to be on the server's runtime classpath.
   Unfortunately, you'll have to re-do this step if you switch SDKs.

   On Fri, Apr 9, 2010 at 4:39 AM, dflorey daniel.flo...@gmail.com wrote:
I don't need JDO etc. in my app as I'm using the native datastore.
What is the easiest way to exclude these jars from deploy to app
engine?
Would be very nice if the Google Plugin would provide some options for
disabling datanucleus. I have to disable the builder etc. for each
project manually.

--
You received this message because you are subscribed to the Google
  Groups
Google App Engine for Java group.
To post to this group, send email to
google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com

.
For more options, visit this group at
   http://groups.google.com/group/google-appengine-java?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  .
  For more 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: Delay between Load Request and Filter Init

2010-04-09 Thread Jake
Regarding the startup time...

I do have some additional jars, but I feel I've balanced this out by
removing several GAE jars (anything related to JDO/Datanucleus).  I'm
mostly wondering about the different times: 2 seconds vs. 15 seconds
and everything in between.  Without some consistency, I don't know how
to troubleshoot it.  I thought it had been solved at one point, but
then it returned.

Regarding being in the cloud...

Yeah, I suppose so.  I'm just wondering how to work this if
Application state can never be relied upon - in this case, the URL is
based on Application state and I'm not sure how MemCache would work.
If it were a few missing images here and there, that would be fine - a
page refresh does the trick.  But based on my experience, this will be
more frequent than not.  Oh, well - no one said it would be easy.  Is
there perhaps a way to determine the difference between an initial
request (e.g. I've clicked a link to go to a new page) and an image/
resource request required for that page?  If so, I could then restart
the entire process if the application drops in the middle.

Thanks!

Jake

On Apr 9, 3:58 am, François Masurel fm2...@mably.com wrote:
 Hi Jake,

 You're in the cloud, there is no guarantee at all that requests from
 your page will be served by the same server instance.  May be you
 should use MemCache instead of memory to store your URLs.

 François

 On 9 avr, 02:12, Jake jbrooko...@cast.org wrote:

  Ok, now this is getting silly :)

  My application gets a page request that contains some images.  My
  application has some specialized logic that mounts images with
  different states on a custom URL that is stored in the applications
  memory - that URL is returned in the HTML.  The web browser then,
  obviously, requests the image at the custom URL.  Unfortunately, in
  the 3 seconds between the request for the page and the request for the
  image, the application restarted and lost the custom URL.

  Thoughts?  Is there no way to ensure that the application stays alive
  during a complete page request?  Now that I think about it, I guess
  there's nothing that differentiates a complete set of page requests
  from a single image request - either of which can be a loading
  request.

  To date, this has happened at least 3-4 times - I just didn't see it
  as a problem until an image was requested.  I'm the only traffic for
  the time being.

  Thanks!

  Jake

  On Apr 7, 2:52 pm, Jake jbrooko...@cast.org wrote:

   Hello,

   I'm currently using the Wicket Framework which is simply a
   javax.servlet.Filter.  I have a quick little logging statement in the
   init() method of the filter which, I believe, is the absolute first
   thing that should run on a loading request.

   I've been working hard to minimize the startup time for my
   application, but now I've discovered a delay between the initial GET
   request and the log statement in the init() function that is anywhere
   between 2 seconds and 15 seconds.  I suppose I can live with the 2
   seconds, but 15 seconds is pushing it :)

   04-07 11:41AM 41.583

   75.150.73.225 - - [07/Apr/2010:11:42:14 -0700] GET / HTTP/1.1 500 0
   - Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3)
   Gecko/20100401 Firefox/3.6.3,gzip(gfe) jacob-brookover.appspot.com

   D 04-07 11:41AM 53.341

   org.cast.google.TestFilter init: Initializing Filter

   I've been fuddling around with a lot of things, so I'm far from a
   standard implementation at this point.  I'm hoping someone can tell
   me what I can do to remove such a delay.

   Thanks!

   Jake

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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 exclude the optional jars for deployment?

2010-04-09 Thread Jake
Or you could forgo the plugin and use maven to build/upload your
projects.  Then, you determine the jars to be included.  This was the
primary reason that I wanted the plugin to support maven, but that
became non-trivial and the documentation wasn't very helpful.

Jake

On Apr 9, 10:05 am, Rajeev Dayal rda...@google.com wrote:
 Unfortunately, there is no great way to disable all of the JDO-related
 features on a given App Engine project. If you could, file a feature request
 for this in the issue tracker.

 The best way to exclude these jars would be to remove them from your
 war/WEB-INF/lib directory, and when the plugin complains that they're
 missing, add them to the list of exclusions of jars that are on the build
 path but are not required to be on the server's runtime classpath.
 Unfortunately, you'll have to re-do this step if you switch SDKs.

 On Fri, Apr 9, 2010 at 4:39 AM, dflorey daniel.flo...@gmail.com wrote:
  I don't need JDO etc. in my app as I'm using the native datastore.
  What is the easiest way to exclude these jars from deploy to app
  engine?
  Would be very nice if the Google Plugin would provide some options for
  disabling datanucleus. I have to disable the builder etc. for each
  project manually.

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

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



[appengine-java] Re: Delay between Load Request and Filter Init

2010-04-08 Thread Jake
Ok, now this is getting silly :)

My application gets a page request that contains some images.  My
application has some specialized logic that mounts images with
different states on a custom URL that is stored in the applications
memory - that URL is returned in the HTML.  The web browser then,
obviously, requests the image at the custom URL.  Unfortunately, in
the 3 seconds between the request for the page and the request for the
image, the application restarted and lost the custom URL.

Thoughts?  Is there no way to ensure that the application stays alive
during a complete page request?  Now that I think about it, I guess
there's nothing that differentiates a complete set of page requests
from a single image request - either of which can be a loading
request.

To date, this has happened at least 3-4 times - I just didn't see it
as a problem until an image was requested.  I'm the only traffic for
the time being.

Thanks!

Jake



On Apr 7, 2:52 pm, Jake jbrooko...@cast.org wrote:
 Hello,

 I'm currently using the Wicket Framework which is simply a
 javax.servlet.Filter.  I have a quick little logging statement in the
 init() method of the filter which, I believe, is the absolute first
 thing that should run on a loading request.

 I've been working hard to minimize the startup time for my
 application, but now I've discovered a delay between the initial GET
 request and the log statement in the init() function that is anywhere
 between 2 seconds and 15 seconds.  I suppose I can live with the 2
 seconds, but 15 seconds is pushing it :)

 04-07 11:41AM 41.583

 75.150.73.225 - - [07/Apr/2010:11:42:14 -0700] GET / HTTP/1.1 500 0
 - Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3)
 Gecko/20100401 Firefox/3.6.3,gzip(gfe) jacob-brookover.appspot.com

 D 04-07 11:41AM 53.341

 org.cast.google.TestFilter init: Initializing Filter

 I've been fuddling around with a lot of things, so I'm far from a
 standard implementation at this point.  I'm hoping someone can tell
 me what I can do to remove such a delay.

 Thanks!

 Jake

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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] Delay between Load Request and Filter Init

2010-04-07 Thread Jake
Hello,

I'm currently using the Wicket Framework which is simply a
javax.servlet.Filter.  I have a quick little logging statement in the
init() method of the filter which, I believe, is the absolute first
thing that should run on a loading request.

I've been working hard to minimize the startup time for my
application, but now I've discovered a delay between the initial GET
request and the log statement in the init() function that is anywhere
between 2 seconds and 15 seconds.  I suppose I can live with the 2
seconds, but 15 seconds is pushing it :)

04-07 11:41AM 41.583

75.150.73.225 - - [07/Apr/2010:11:42:14 -0700] GET / HTTP/1.1 500 0
- Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3,gzip(gfe) jacob-brookover.appspot.com

D 04-07 11:41AM 53.341

org.cast.google.TestFilter init: Initializing Filter

I've been fuddling around with a lot of things, so I'm far from a
standard implementation at this point.  I'm hoping someone can tell
me what I can do to remove such a delay.

Thanks!

Jake

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



[appengine-java] Re: App Engine Beginner + JDO beginner... Strange issue with Query

2010-03-31 Thread Jake
Hey Guit,

Could you also post the data object class code (Espace.class)?

In the meantime, you can also try some debugging alternatives with
http://www.datanucleus.org/products/accessplatform_1_0/jdo/jdoql.html
as your guide.

Jake

On Mar 30, 6:36 pm, Guit lemoin...@gmail.com wrote:
 Anybody ? Someone look at my class and say to me ot should work but it
 doesn t and i habe still no ide why ... Please :)
 On 30 mar, 00:09, Guit lemoin...@gmail.com wrote:

  Hi everybody,
  I am trying to build my application and i am facing a very strange
  issue : here is the code :
  PersistenceManager pm=PMF.get().getPersistenceManager();

                          Query query=pm.newQuery(Espace.class);
                          //query.setFilter(nom == paramAuthor);
                          //query.declareParameters(java.lang.String 
  paramAuthor);
                          ListEspace results ;
                          results=(ListEspace) query.execute();//_66);
                          for (int i=0;iresults.size();i++){
                                  Espace es=results.get(i);
                                  System.out.println(es.getNom());
                          }
                          return results;
  When i run it i obtain a long list of name :
  ...
  _65
  _66
  _67
  ...

  When I remove comment and execute the query , i have no result...
  I really don't understand why...
  If you have an idea... it would be very nice to help me :)
  Guit

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Signed Applet + Precompilation

2010-03-24 Thread Jake
Hello,

Yes I'm serving it out of WEB-INF/lib and I see that you're right - I
can try to place it as a static file elsewhere.  All of my code/build
scripts, though, assume JAR files are in the /lib directory.  At least
I have a workaround, though.  And no, I'm not signing all of the jars
- the audio one just requires it to access the system microphone.

Thanks for the help!

Jake

On Mar 23, 12:58 pm, Don Schwarz schwa...@google.com wrote:
 Are you serving the applet out of WEB-INF/lib somehow?  We should only be
 processing jars in that directory.

 If you're serving this files to clients you should be able to either place
 it outside of WEB-INF and let it be served as any other static file, or
 store it somewhere other than WEB-INF/lib and serve it via a servlet.

 Or perhaps you're signing all of your jars, including those in WEB-INF/lib?
  If so, is that necessary?

 On Tue, Mar 23, 2010 at 11:05 AM, Jake jbrooko...@cast.org wrote:
  Hey all,

  I have a signed java applet (voice recorder) that I've been using on
  GAE/J for the past few months.  I use maven-jar-signer to do the
  signing.  Everything had been working great but I upgraded to SDK
  1.3.1 and saw that precompilation was causing the following error:

  failed wicket.google
  java.lang.SecurityException: SHA1 digest error for org/cast/
  audioapplet/AudioFileReceive.class
         at com.google.appengine.runtime.Request.process-
  e18bb0e261bbe9d3(Request.java)
         at sun.security.util.ManifestEntryVerifier.verify(Unknown Source)
         at java.util.jar.JarVerifier.processEntry(Unknown Source)
         at java.util.jar.JarVerifier.update(Unknown Source)
         at java.util.jar.JarVerifier$VerifierStream.read(Unknown Source)
         at sun.misc.Resource.getBytes(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
  ...

  If I skip the applet signing or skip the precompilation, then the
  instance starts but then either I can't use the applet or it takes a
  long time to start up - which is difficult since I'm one of those
  users whose instance restarts every 10 seconds or so :)

  Thoughts?  Solutions?

  Thanks!

  Jake

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

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



[appengine-java] Re: GPE 1.3 Tutorial?

2010-03-24 Thread Jake
Hello,

I would very much appreciate an FAQ for GAE + Maven - there are
several blogs/plugins/etc that attempt to set it up in a haphazard
way, but I feel like there should be a stable, Google-approved
method.  I personally have my own hacked together situation that works
about as well as anyone has described, but it's not perfect/clean/etc.

The key difficulty for me seems to be that in non-GAE projects,
Eclipse/Maven can resolve dependencies in the Workspace cleanly,
without running 'mvn install' on each one.  I haven't found a GAE
solution that does that and hoped the GPE would solve that.

Thanks for the info!

Jake

On Mar 24, 12:34 am, jd jdpatter...@gmail.com wrote:
 On Mar 24, 3:53 am, Keith Platfoot kplatf...@google.com wrote:

  It is still possible to
  use the Google Plugin for Eclipse with an App Engine project, but it may
  require a few hacks or manual steps in order to keep the runtime WAR
  directory in sync with your changes.  

 I found this Eclipse plugin, FileSync, really useful to keep /src/main/
 webapp in sync with /target/myapp-deploy-dir/

 http://andrei.gmxhome.de/filesync/usage.html

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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] Signed Applet + Precompilation

2010-03-23 Thread Jake
Hey all,

I have a signed java applet (voice recorder) that I've been using on
GAE/J for the past few months.  I use maven-jar-signer to do the
signing.  Everything had been working great but I upgraded to SDK
1.3.1 and saw that precompilation was causing the following error:

failed wicket.google
java.lang.SecurityException: SHA1 digest error for org/cast/
audioapplet/AudioFileReceive.class
at com.google.appengine.runtime.Request.process-
e18bb0e261bbe9d3(Request.java)
at sun.security.util.ManifestEntryVerifier.verify(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarVerifier$VerifierStream.read(Unknown Source)
at sun.misc.Resource.getBytes(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
...

If I skip the applet signing or skip the precompilation, then the
instance starts but then either I can't use the applet or it takes a
long time to start up - which is difficult since I'm one of those
users whose instance restarts every 10 seconds or so :)

Thoughts?  Solutions?

Thanks!

Jake

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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 do I write data in my Google App Engine Datastore to com.google.appengine.api.datastore.Text

2010-03-12 Thread Jake
Hey,

I presume setMethod() refers to a getter/setter.  So, your persisted
class would look like:

@Persistent
Text text;

public void setText(String s) {
   this.text = new Text(s);
}

public String getText() {
   return this.text.getValue()
}

The App Engine API is your friend:  
http://code.google.com/appengine/docs/java/javadoc/

Jake

On Mar 11, 8:37 pm, Tristan tristan.slomin...@gmail.com wrote:
 Lloyd,

 String reallyLong = It was the best of times, it was the worst of
 times. (...) ..;

 Text myText = new Text(reallyLong);

 I don't understand your reference to setMethod().

 Cheers!

 On Mar 10, 10:53 pm, Lloyd cled...@gmail.com wrote:

  I have persistent object, with a string property that often is over
  500 charachters. Google App Engine says I need to save it as a
  com.google.appengine.api.datastore.Text.

  How do I either convert a String type to a
  com.google.appengine.api.datastore.Text type so I can use a
  setMethod() on the property, or otherwise get my long sting data into
  that persistent value?

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



[appengine-java] Re: maven-datanucleus-plugin using JDO when JPA specified?

2010-03-08 Thread Jake
Hey,

It is my understanding that Datanucleus uses JDO for its core
functionality and only provides JPA as an interface - JDO libraries
are still required.  I'm basing this on
http://www.datanucleus.org/products/accessplatform_2_0/index.html and
the Dependencies and Architecture links in the menu.  Perhaps that
is related?

Jake

On Mar 4, 2:02 pm, tkinsella troy.kinse...@shaw.ca wrote:
 Hello,

 I'm trying to enhance my JPA entities using the maven-datanucleus-
 plugin.

 I have the following plugin configuration:

 plugin
   groupIdorg.datanucleus/groupId
   artifactIdmaven-datanucleus-plugin/artifactId
   version2.0.0-release/version
   configuration
     mappingIncludes**/*.class/mappingIncludes
     verbosetrue/verbose
     enhancerNameASM/enhancerName
     apiJPA/api
   /configuration
   executions
     execution
       phasecompile/phase
       goals
         goalenhance/goal
       /goals
     /execution
   /executions
 /plugin

 When I try to install the module, I get this:
 INFO: DataNucleus Enhancer : Using ClassEnhancer ASM for API JDO
 [INFO]
 
 [ERROR] BUILD FAILURE
 [INFO]
 
 [INFO] Compilation failure
 error: Exception thrown while constructing Processor object: javax/jdo/
 PersistenceManagerFactory

 So, I'm wondering why it says it picked JDO when I specified JPA in my
 configuration.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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] Having aggressive instance restarts?

2010-03-05 Thread Jake
Hello all,

My application has been having very frequent restarts, even under
load.  In some cases, the application restarts on every single
request.  I've been in contact with some GAE folks, but the most
recent e-mail suggested that I encourage others to post similar
trends and expose holes in our monitoring.

So, if you have this problem, please make it known.  I'm not talking
about slow startup - I'm talking about frequent restarts.  To me,
frequent means a restart less than 30 minutes from the previous
request.

Jake

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



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

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

Jake

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

 greatz

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

  Hey,

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

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

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

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

  Jake

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

          private static final long serialVersionUID = 1L;

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

          @Persistent
          private String name;

          @Persistent
          private String mimeType;

          @Persistent(defaultFetchGroup=true)
          private Blob data;

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

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

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

  }

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

   hello together,

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

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

   greatz
   flo

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



[appengine-java] 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: 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.



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



[appengine-java] Re: Possible to cause instance recycling?

2010-02-26 Thread Jake
Hey Ikai,

Nope, not deliberately trying to force a cycle.  I'm just trying to
figure out if it's my fault for the continued aggressive recycling.
Some people complain about losing the instance after an hour, but I'm
losing it after 5 seconds.

I'm certainly aware that a new deployment causes an instance restart -
I should hope so!  That's not what is happening here.

You suggest being able to crash the instance - is there something I
might be doing to cause that in the cloud?  Again, I'm not seeing any
exceptions or errors in my log file and all works fine in local-mode
and on a different version in Tomcat.

I'm certainly willing to share any/all source code to help debug this
problem.  We're experimenting with GAE, but we'll need something that
stays up under load for demonstrations in Q2.

Thanks!

Jake

On Feb 26, 1:41 pm, Ikai L (Google) ika...@google.com wrote:
 Are you trying to force it to cycle? A deploy will do that, but there's a
 limit to the number of deploys you can do a day. Beyond that, the only way
 to unintentionally cause it to cycle would be to crash the instance, I
 suppose. It doesn't sound like that is what is happening here.



 On Thu, Feb 25, 2010 at 2:11 PM, Jake jbrooko...@cast.org wrote:
  Hey all,

  I know that instance recycling times are not ideal - that's not my
  problem here.  I'm wondering if it is possible to unintentionally
  cause GAE to drop your instance and restart it?

  I'm using the Wicket framework.  Everything works locally, but when I
  deployed today, I experienced 5 instance restarts in the span of three
  minutes - each restart is 15-20 seconds.

  I'm not seeing any exceptions in the logs.  My quotas, load, etc are
  all fine (practically non-existent).  Application behavior is perfect
  - just with delays.

  The only strenuous thing I'm doing is loading/processing a 350K XML
  document into a Java object when the instance starts.

  AppID:  http://jacob-brookover.appspot.com

  Look at the Library and Start Reading the first two pages of Call of
  the Wild.

  This project is a port of an existing project that has gone through
  pretty rigorous testing, usage.

  Thanks!

  Jake

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post 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 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

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



[appengine-java] Re: Problem with persistance

2010-02-25 Thread Jake
You may want to look into the JDO fetch groups, hollow returns of
objects, makeTransient, and other items having to do with what is
fetched and what remains accessible after the persistence manager is
closed.  The DataNucleus documentation is a pretty good place to look
at that.  I'm somewhat new to this, but had similar troubles and found
my answers there.

Jake

On Feb 25, 8:36 am, datanucleus andy_jeffer...@yahoo.com wrote:
  interpretation of this error is that either the child object was not
  saved in the database, or it was not fetched from the database.

 GAE/J has some DB viewer, so debugging if it is actually in the
 database is kinda step 1. Then look at the log, since that is why it
 exists

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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] Possible to cause instance recycling?

2010-02-25 Thread Jake
Hey all,

I know that instance recycling times are not ideal - that's not my
problem here.  I'm wondering if it is possible to unintentionally
cause GAE to drop your instance and restart it?

I'm using the Wicket framework.  Everything works locally, but when I
deployed today, I experienced 5 instance restarts in the span of three
minutes - each restart is 15-20 seconds.

I'm not seeing any exceptions in the logs.  My quotas, load, etc are
all fine (practically non-existent).  Application behavior is perfect
- just with delays.

The only strenuous thing I'm doing is loading/processing a 350K XML
document into a Java object when the instance starts.

AppID:  http://jacob-brookover.appspot.com

Look at the Library and Start Reading the first two pages of Call of
the Wild.

This project is a port of an existing project that has gone through
pretty rigorous testing, usage.

Thanks!

Jake

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Problem with persistance

2010-02-24 Thread Jake
http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned_One_to_One_Relationships

You create a bidirectional one-to-one relationship using fields on
both classes, with an annotation on the child class's field to declare
that the fields represent a bidirectional relationship. The field of
the child class must have a @Persistent annotation with the argument
mappedBy = ..., where the value is the name of the field on the
parent class.

From what I see, you have it backwards, with the annotation in the
parent class.

Jake

On Feb 24, 4:26 am, Anton Klotz dipl.ing.akl...@googlemail.com
wrote:
 Hi,

 could please somebody tell me, what I'm doing wrong here?

 Here is one child datastructure I want to persist:

 @PersistenceCapable

 public class OfferDetails {

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

         @Persistent
         private String mOfferDescription;

         @Persistent
         private Offer mOffer;

         public OfferDetails ()
         {

         }

         public OfferDetails (String offerDesc)
         {
                 this ();
                 mOfferDescription = offerDesc;
         }

 }

 And here is the parent

 @PersistenceCapable(identityType = IdentityType.APPLICATION,
 detachable=true)

 public class Offer {
         @PrimaryKey
         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
         private Key mId;

         @Persistent(mappedBy=mOffer)
         private OfferDetails mOfferDetails;

 public Offer( OfferDetails offerDetails)
         {
                 this();
                 mOfferDetails = offerDetails;
         }

 }

 Here is the presistance routine:

 public class OfferDataAccess {
           private static final long serialVersionUID = -7037344095742126014L;
           private PersistenceManager pm;

           public OfferDataAccess ()
           {
                   pm = PMF.get().getPersistenceManager();
           }

         public void persistOffer (Offer offer)
         {
                 pm.currentTransaction().begin();
                 try {
                         pm.makePersistent(offer);
                         pm.currentTransaction().commit();
                 } finally {
                         if (pm.currentTransaction().isActive())
                                 pm.currentTransaction().rollback();
                         pm.close();
                 }
         }

 And here is the call of the persistance routine:
 class CreateOfferActionCommand
 {
         public void execute() {
                 mOfferDB = new OfferDataAccess ();
                 mOffer = new Offer (mOfferDetails);
                 mOfferDB.persistOffer (mOffer);

 }
 }

 Now if I run this code, I get following errormessage:

 java.lang.IllegalStateException: Primary key for object of type
 OfferDetails is null.
         at
 org.datanucleus.store.appengine.EntityUtils.getPkAsKey(EntityUtils.java:
 152)
         at
 org.datanucleus.store.appengine.DatastoreFieldManager.getKeyForObject(DatastoreFieldManager.java:
 625)
         at
 org.datanucleus.store.appengine.DatastoreFieldManager.getParentKeyFromParentField(DatastoreFieldManager.java:
 634)
         at
 org.datanucleus.store.appengine.DatastoreFieldManager.establishEntityGroup(DatastoreFieldManager.java:
 591)
         at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess(DatastorePersistenceHandler.java:
 338)
         at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:
 246)
         at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:
 235)
         at
 org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:
 3185)
         at
 org.datanucleus.state.JDOStateManagerImpl.makePersistent(JDOStateManagerImpl.java:
 3161)
         at
 org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:
 1298)
         at
 org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:
 1175)
         at
 org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:
 669)
         at
 org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:
 694)
         at
 com.sparradar.server.datamodel.offer.OfferDataAccess.persistOffer(OfferDataAccess.java:
 29)
         at
 com.sparradar.server.action.actioncommands.CreateOfferActionCommand.execute(CreateOfferActionCommand.java:
 60)
         at
 info.rk.vaadinapp.manager.urldispatching.URLActionDispatcher.handleURI(URLActionDispatcher.java:
 90)
         at com.vaadin.ui.Window.handleURI(Window.java:358)
         at
 com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleURI(AbstractCommunicationManager.java:
 1830)
         at
 com.vaadin.terminal.gwt.server.CommunicationManager.handleURI(CommunicationManager.java

[appengine-java] Re: Google App Engine : web-app being hibernated ?

2010-02-18 Thread Jake
Hey all,

Look at (and perhaps post on)
http://groups.google.com/group/google-appengine-java/browse_thread/thread/b57e6c4895333fa8/

I've gotten to the point where the instance recycling happens every
few seconds (but then works for a bit until I pause).  Currently, my
application is essentially non-functional in a deployed state and the
1-minute ping trick didn't seem to be much help as even that failed to
keep it up and running.  On the bright side, I'm pretty sure Ikai and
others are working on it.

Jake

On Feb 17, 6:00 pm, Brian bwa...@gmail.com wrote:
 It is unknown. Google won't tell or guarantee a time, because it will
 change vs on traffic to your app, traffic to other apps, number of
 apps running, number of servers Google has dedicated to Google App
 Engine, etc. etc. etc.

 Could be up forever, or could be up 1 second before a shutdown. Can't
 code anything that depends on your instance being up instantly, or it
 won't scale well or be guaranteed to work.

 On Feb 17, 12:56 pm, Henning henning2...@hotmail.de wrote:

  Hi,

  do you know the exact time ?

  I noticed too that sometimes a request can take up to 20 seconds.
  I am using for the front-end flash/flex which allows me to request a
  status information every 15 seconds (at the moment). I already needed
  this status info for proprietary session handling and the so-called
  maintenance shut down.
  After the first request which can take a lot of time, everything goes
  smooth. I wonder at what time intervals I should set my alive
  handler.
  The first idea was about 3 minutes but that is maybe too slow.

  Best regards,
  Henning

  On Feb 17, 7:40 pm, Brian bwa...@gmail.com wrote:

   Yes. The actual time to hibernate is really short, closer to 1-2
   minutes than 1 hour.

   Until this is fixed in some way, you need to either be willing to
   accept the huge wait for free hosting, or code some kind of task to
   ping your app every 60 seconds...

   On Feb 16, 11:17 pm, netcompetency netcompete...@gmail.com wrote:

Hi all,
i have some labs on Google App Engine and find some strange yet
consistent behaviour. My app is based on Spring/JPA. No error/
exception and working properly. The issue is with performance.

If we are not using the apps for some time --- for example for an hour
--- the application is like being hibernated. It needs time to
response to the first request.

Is this the case ? Is there an documentation on this ?

Cheers,

Eko Budhi S

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



[appengine-java] Re: Using socket with GAE

2010-02-18 Thread Jake
I can confirm that URLConnection's getOutputStream() works like a
charm when my client-side applet needs to send an object to my GAE
application.

Jake

On Feb 18, 10:24 am, Conor Power iamco...@gmail.com wrote:
 You should be able to do the equivalent over http as what you are doing /
 would like to do over the socket. And if that's the case there should not be
 any constraints for you.

 cowper

 On Thu, Feb 18, 2010 at 12:01 AM, med@gmail.com med@gmail.comwrote:

  Hi Everyone,

  I am a beginner in using GAE, and I was wondering if it was possible
  to use socket for getting simple msg from the client as it's essential
  in my application.

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

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Editing records in datastore (using JAVA)

2010-02-18 Thread Jake
The Google App Engine instructions focus on JDO for the datastore
implementation.  JDO doesn't have the traditional update function.
You either modify it and close the persistence manager that returned
the object (it knows it changed and updates accordingly) or you just
persist the object again with the same ID to overwrite it.

See: 
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Updating_an_Object

I believe JPA has an update feature, but if you're new to it I suggest
JDO since it has better documentation in GAE.

Jake

On Feb 18, 10:55 am, Manjoor manjoora...@gmail.com wrote:
 I have been searching for sample java program to add, edit and delete
 records. I found many example showing how to add and delete records
 but not a single about editing. Do anyone have a sample source link to
 show how to edit a record ???

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Problems using a ThreadLocal variable

2010-02-17 Thread Jake
Hey,

There are a fair number of posts on how to implement Wicket on GAE.
E.g. 
http://www.danwalmsley.com/2009/04/08/apache-wicket-on-google-app-engine-for-java/

I'm currently working on a pretty large Wicket/GAE project and, while
I've hit a few hiccups, everything has worked in the long run.  Two
quick comments:

1.  Poor detaching/coding practices in Wicket fill up the Session very
quickly.  Since the examples use HttpSession to back the Wicket
Session, and GAE has a max of 1MB on the HttpSession, you need to be
careful.
2.  File uploads need to be tweaked.  I can't find the files right
now, but a small bit of searching turns up someone who has created a
good workaround using the datastore.

Jake

On Feb 16, 6:24 pm, Brian bwa...@gmail.com wrote:
 I have not used Wicket myself, but have you 
 seenhttp://groups.google.com/group/google-appengine-java/web/will-it-play...
 ?  It looks like Wicket must be massaged a little to work...

 On Feb 16, 3:36 pm, Esteban Masoero emaso...@getsense.com.ar wrote:

  Hi there:

  Since today, my app started to have problems when using a ThreadLocal
  variable. I'm using wicket framework, and it happens that the first
  request to the page is fine, but sometimes I get an exception caused by
  wicket saying that the app (which is stored in a threadlocal variable)
  is not found (is null).
  I didn't make any change to the framework related to that, I only made
  some minor changes that have no relation to this problem.
  Has anyone experienced something alike? Can any guy from google give
  some hint about this?

  Thanks,

  Esteban

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: DataStore Error 1000000 characters, but I'm not persisting

2010-02-10 Thread Jake
I've discovered my issue - Apache Wicket.  Wicket has it's own Session
that stores data in an ISessionStore.  Normally, this is backed by a
Disk, but can be backed with an HttpSession if set properly.  The
trick is that it stores a lot of state with each page, which I can
change now that I know the issue - prior to this point, my pages were
simple HTML.

My new question is this:  when does the HttpSession become persisted?
Are setAttribute(), getAttribute() calls to HttpSession equivalent to
datastore queries?  In that case, would I see a performance
improvement using MemCache with the HttpSession as a fallback?

Thanks!

Jake

On Feb 10, 11:23 am, Don Schwarz schwa...@google.com wrote:
 How much data are you storing in your session?  Currently, the serialized
 representation of a sessions contents must be  the 1MB entity limit.

 On Tue, Feb 9, 2010 at 12:46 PM, Jake jbrooko...@cast.org wrote:
  Hello,

  I'm getting the following error:

  java.lang.IllegalArgumentException: string property _values is too
  long.  It cannot exceed 100 characters.

  The trick is, I'm not persisting any Blobs and certainly none called
  _values.  I do have one object with a Blob field, but I'm not
  persisting anything to that field to cause the above exception.  Also,
  this is a new issue and that Blob has been in my application for
  awhile.  All I'm doing is viewing pages that query the datastore.  My
  admin panel doesn't show any quota issues.

  My newest change is that I'm uploading a 350K XML file (a book),
  applying some XSLT translation using Saxon and storing the result in
  an application variable, and displaying certain chunks of that file
  depending on the clicked page.

  I do have sessions enabled, which I fear is related, but I'm not sure
  how to resolve this.

  Thanks in advance for any help!

  Jake

  /titlepage
  java.lang.IllegalArgumentException: string property _values is too
  long.  It cannot exceed 100 characters.
         at

  com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
  33)
         at

  com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
  60)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $2.run(DatastoreServiceImpl.java:163)
         at

  com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:
  30)
         at

  com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
  151)
         at

  com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
  131)
         at

  com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
  123)
         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

[appengine-java] Re: Persistence with JPA + GAE

2010-02-09 Thread Jake
Hey,

I don't play with JPA too much, but I saw this:
http://www.datanucleus.org/products/datanucleus/jpa/transactions.html

Jake

On Feb 9, 10:55 am, Johan Vallejo jvall...@vnperu.com wrote:
 Hi Jake,
 Now i have this error
 Log :javax.persistence.PersistenceException: Transaction is still active. You 
 should always close your transactions correctly using commit() or rollback().
 this is my code :
             EntityManager cn2 = emf.get().createEntityManager();   
     distritos dist2 = cn2.find(distritos.class, id);
     evento e = new evento();
     e.setDistrito(dist2);
     Date fecha = new Date();
     e.setFechaCreacion(fecha);
     try{ 
     cn2.getTransaction().begin(); 
     cn2.persist(e);
     cn2.getTransaction().commit();
     response.getWriter().write(ok);   
     }finally{
     cn2.close();
     }
 Distrito :
 @Entity
 public class distritos implements Serializable {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Extension (vendorName=datanucleus, key=gae.encoded-pk, value=true)
     Key id;
     --getter and setter--
 El 08/02/2010 03:37 p.m., Jake escribió:Hello, The Google Datastore has four 
 ways that you can store a Primary Key ID: String, Long, and two variations on 
 Google's own Key object. If you want to create a parent/child relationship 
 between two persisted objects (in your case, evento is the parent and 
 distritos is the child), then you need to use Google's Key object as the 
 primary ID. 
 See:http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#KeysIf
  the class is used as a child class in a relationship, the key field must 
 be of a type capable of representing an entity group parent: either a Key 
 instance, or a Key value encoded as a string. So, you have two options: 1. 
 Change your Long id values to Key id values. 2. Instead of storing private 
 distritos distrito directly in your evento object, store a reference to the 
 id: private Long distrito_id Jake On Feb 6, 4:06 pm, 
 chevellejvall...@vnperu.comwrote:Hi I am new in the list, in these days i 
 am trying save data between two entity beans using JPA but without success, i 
 am cheking the log nd says: Uncaught exception from servlet 
 javax.persistence.PersistenceException: Error in meta-data for 
 beans.distritos.id: Cannot have a java.lang.Long primary key and be a child 
 object (owning field is beans.evento.distrito). this is my servlet:           
   Long id = Long.parseLong(request.getParameter(idDistrito));             
 response.setContentType(text/html);             EntityManager cn = 
 emf.get().createEntityManager();             Query q = cn.createQuery(SELECT 
 d FROM distritos d WHERE d.id = :codigo);             
 q.setParameter(codigo,id);             distritos dist = (distritos) 
 q.getSingleResult();             EntityManager cn2 = 
 emf.get().createEntityManager();             cn2.getTransaction().begin();    
          evento e = new evento();             e.setDistrito(dist);            
  Date fecha = new Date();             e.setFechaCreacion(fecha);             
 try{                 cn2.persist(e);                 
 response.getWriter().write(ok);             }finally{                 
 cn2.getTransaction().commit();                 cn2.close();             } 
 this is my entity bean Evento: @Entity public class evento implements 
 Serializable {     @Id     @GeneratedValue(strategy = 
 GenerationType.IDENTITY)     Long id;     
 @Temporal(javax.persistence.TemporalType.DATE)     private Date 
 fechaCreacion;     @JoinColumn     @OneToMany(cascade = CascadeType.ALL)     
 private distritos distrito;    --getter and setter-- Distrito: @Entity public 
 class distritos implements Serializable {     @Id     
 @GeneratedValue(strategy = GenerationType.IDENTITY)     Long id;     private 
 String distrito;     --getter and setter-- i hope anyone help me, Thank! Johan

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



[appengine-java] DataStore Error 1000000 characters, but I'm not persisting

2010-02-09 Thread Jake
Hello,

I'm getting the following error:

java.lang.IllegalArgumentException: string property _values is too
long.  It cannot exceed 100 characters.

The trick is, I'm not persisting any Blobs and certainly none called
_values.  I do have one object with a Blob field, but I'm not
persisting anything to that field to cause the above exception.  Also,
this is a new issue and that Blob has been in my application for
awhile.  All I'm doing is viewing pages that query the datastore.  My
admin panel doesn't show any quota issues.

My newest change is that I'm uploading a 350K XML file (a book),
applying some XSLT translation using Saxon and storing the result in
an application variable, and displaying certain chunks of that file
depending on the clicked page.

I do have sessions enabled, which I fear is related, but I'm not sure
how to resolve this.

Thanks in advance for any help!

Jake

/titlepage
java.lang.IllegalArgumentException: string property _values is too
long.  It cannot exceed 100 characters.
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
33)
at
com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
60)
at com.google.appengine.api.datastore.DatastoreServiceImpl
$2.run(DatastoreServiceImpl.java:163)
at
com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:
30)
at
com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
151)
at
com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
131)
at
com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
123)
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

[appengine-java] Re: App Engine cold starts and overly aggressive cycling

2010-02-08 Thread Jake
Hey all,

Since Ikai's post on January 22nd, I haven't had much trouble with my
instance rebooting unexpectedly.  However, today the problem has
returned.  I'm getting instance restarts within a minute or two of
each other on a somewhat regular basis - sometimes even within a few
seconds of each other, caused by my first request.

Jake

On Jan 30, 3:06 pm, Edwin Hautus ehau...@gmail.com wrote:
 I am having this problem for the last week or two after months of good
 performance and very little recycling.
 As my app start up time is around 15 seconds this is really hitting my
 user experience in a negative way.

 On Jan 16, 12:32 am, Ikai Lan i...@google.com wrote:

  Hey everybody,

  We've been seeing more and more reports of applications being cycled out
  overly aggressively, resulting in some folks implementing (discouraged)
  workarounds to keep their application from being cycled out.

  - What is your application ID?

 salsa-amsterdam

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

 I have some logging which is executed on startup

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

 Can be as little as a minute.

  - What time or days does this seem to happen?

 Seems to happen all the time.

  - What frameworks or libraries are you loading?

 Just the plain Servlet API and Groovy.

  Any other information you can provide would be helpful.

 Start up time of the app is about 10 seconds and involves some on the
 fly compilation of Groovy scripts.

  Ikai Lan
  Developer Programs Engineer, Google App Engine

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



[appengine-java] Re: JDO model issue

2010-02-08 Thread Jake
Hey,

Relationships in GAE are a bit picky.  It is my understanding that you
can only persist children by way of persisting their parents.  So, in
your case, both Race and Runner are children of Result and you would
only persist the two result objects - the dependent children would be
persisted automatically.  I'm willing to bet, though, that a single
race object cannot be the child of two different parent objects,
though I'm not certain.  The details are all here:
http://code.google.com/appengine/docs/java/datastore/relationships.html

For the most part, I've found that parent/child relationships are only
useful when the two are highly related - usually when I'm extending a
class to provide more data.  (e.g. Race - RaceDetails).

The easy way to get around this is to store the objects in unowned
relationships, referencing other objects by IDs as described in
http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned_Relationships.
Then, with some fancy getters/setters that automatically query the
Datastore, you end up with the same result.  See my example below.

If anyone has any other advice, though, please contribute.  I haven't
found a great way to handle this and I'm trying to avoid using GAE
specific libraries to help.

Jake

public class Race {

   private Key id;
   ...
}

public class Result {

   private Key id;
   private Key raceId;

   public Race getRace() {
   //query datastore with getObjectById(Race.class, raceId);
   }
}

On Feb 6, 7:15 pm, Rodolphe rde...@gmail.com wrote:
 Hello,

 I am very new to appengine, and I am trying a very basic model exemple: A
 Race class is linked to a Runner class through a Result class

 When I am running the folloging code (the full code is attached):
         Race race = new Race(Paris, new Date(), 10);

         Runner runner1 = new Runner(Smith);
         Runner runner2 = new Runner(John);

         Result result1 = new Result(race, runner1, 1);
         Result result2 = new Result(race, runner2, 2);

         PersistenceManager pm = PMF.get().getPersistenceManager();
         try {
             race = pm.makePersistent(race);

             runner1 = pm.makePersistent(runner1);
             runner2 = pm.makePersistent(runner2);

             pm.makePersistent(result1);
             pm.makePersistent(result2);
         } finally {
             pm.close();
         }

 I get the following error:
 Detected attempt to establish Result(4) as the parent of Runner(2) but the
 entity identified by Runner(2) has already been persisted without a parent.
 A parent cannot be established or changed once an object has been persisted.
 org.datanucleus.store.appengine.FatalNucleusUserException: Detected attempt
 to establish Result(4) as the parent of Runner(2) but the entity identified
 by Runner(2) has already been persisted without a parent.  A parent cannot
 be established or changed once an object has been persisted.
     at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch(DatastoreRelationFieldManager.java:204)
     at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager$1.setObjectViaMapping(DatastoreRelationFieldManager.java:125)
     at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager$1.apply(DatastoreRelationFieldManager.java:104)
     at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(DatastoreRelationFieldManager.java:78)
     at
 org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(DatastoreFieldManager.java:812)
     at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess(DatastorePersistenceHandler.java:288)
     at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:241)
     at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:225)
     at
 org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:3185)
     at
 org.datanucleus.state.JDOStateManagerImpl.makePersistent(JDOStateManagerImpl.java:3161)
     at
 org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1298)
     at
 org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1175)
     at
 org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:669)
     at
 org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:694)
     at race.TestRace.test2(TestRace.java:58)

 Any idea how I could solve this ?

 Thank you in advance
 Rodolphe

  TestRace.java
 3KViewDownload

  Race.java
 1KViewDownload

  Result.java
 1KViewDownload

  Runner.java
 1KViewDownload

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

[appengine-java] Re: Google Plugin for Eclipse 1.3 plans

2010-02-08 Thread Jake
I'm hoping for a good way to resolve workspace dependencies in
Eclipse.  The m2eclipse plugin does this well, but that doesn't play
nicely with the maven-war-plugin, so it doesn't work for GAE.  Running
a Maven Install on each workspace dependency before deploying,
however, is still nicer than having to manually generate/copy jar
files.  I'm pretty new to Eclipse/Maven/GAE, so I don't know if it's
possible, but I'm hopeful! :)

Jake

On Feb 6, 12:40 pm, 杨浩 skzr@gmail.com wrote:
 Where's the lastest plugin update sites for GAE Plugin?
 I will to test it!

 2010/2/6 Philippe Marschall philippe.marsch...@gmail.com

  Sounds like a good start. Ideally the maven eclipse plugin [1] could
  be configured to automatically generate the configuration for the
  Google Plugin and M2Eclipse [2] picking that up as well. Also an
  archetype would help quick starting. I assume you're aware that you
  get the most benefit out of that only when there are up to date Maven
  artifacts wit good metadata in a publicly available repo, preferably
  Maven central.

   [1]http://maven.apache.org/eclipse-plugin.html
   [2]http://m2eclipse.sonatype.org/

  Cheers
  Philippe

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Persistence with JPA + GAE

2010-02-08 Thread Jake
Hello,

The Google Datastore has four ways that you can store a Primary Key
ID:  String, Long, and two variations on Google's own Key object.  If
you want to create a parent/child relationship between two persisted
objects (in your case, evento is the parent and distritos is the
child), then you need to use Google's Key object as the primary ID.
See:  
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys
If the class is used as a child class in a relationship, the key
field must be of a type capable of representing an entity group
parent: either a Key instance, or a Key value encoded as a string.
So, you have two options:

1.  Change your Long id values to Key id values.
2.  Instead of storing private distritos distrito directly in your
evento object, store a reference to the id: private Long distrito_id

Jake

On Feb 6, 4:06 pm, chevelle jvall...@vnperu.com wrote:
 Hi
 I am new in the list, in these days i am trying save data between two
 entity beans using JPA but without success, i am cheking the log nd
 says:

 Uncaught exception from servlet
 javax.persistence.PersistenceException: Error in meta-data for
 beans.distritos.id: Cannot have a java.lang.Long primary key and be a
 child object (owning field is beans.evento.distrito).

 this is my servlet:
             Long id =
 Long.parseLong(request.getParameter(idDistrito));
             response.setContentType(text/html);
             EntityManager cn = emf.get().createEntityManager();

             Query q = cn.createQuery(SELECT d FROM distritos d WHERE
 d.id = :codigo);
             q.setParameter(codigo,id);
             distritos dist = (distritos) q.getSingleResult();

             EntityManager cn2 = emf.get().createEntityManager();
             cn2.getTransaction().begin();

             evento e = new evento();
             e.setDistrito(dist);
             Date fecha = new Date();
             e.setFechaCreacion(fecha);

             try{
                 cn2.persist(e);
                 response.getWriter().write(ok);
             }finally{
                 cn2.getTransaction().commit();
                 cn2.close();
             }

 this is my entity bean

 Evento:
 @Entity
 public class evento implements Serializable {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     Long id;

     @Temporal(javax.persistence.TemporalType.DATE)
     private Date fechaCreacion;

     @JoinColumn
     @OneToMany(cascade = CascadeType.ALL)
     private distritos distrito;

    --getter and setter--

 Distrito:
 @Entity
 public class distritos implements Serializable {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     Long id;
     private String distrito;

     --getter and setter--

 i hope anyone help me, Thank!

 Johan

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post 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: Referencing projects

2010-01-21 Thread Jake
Hi Maurits,

I've achieved what you're looking for, but it wasn't easy.  If anyone
has a better solution, I'm all ears.

First of all, to do it manually, you can Right-click any project in
Eclipse and Export it to a JAR file - which can then be saved in your
GAE lib/ folder.  But, this has to be done each time you make a
change.

I'm currently using Maven in Eclipse to manage and build my projects
(this copies those external JAR files each time) and then the maven-
antrun-plugin to call the GAE command line scripts that run/upload my
project.  Now that it's set up, it is a single click to run/upload,
despite being dependent on several other Eclipse Projects and 3rd
Party plugins.

This website was the most helpful in setting that up:
http://twelves.blogspot.com/2009/04/google-appengine-maven-pom.html

Most notably, I did not use the maven-gae-plugin that is mentioned
frequently around the interwebs - I was never able to get it working
properly.

I've pasted the applicable bits of my Maven POM file below - that
might be helpful.  This is all based on MacOS commands, but I believe
Windows is similar.  If you choose not to use Maven, the applicable
ANT bits will still be helpful.

Good Luck!

Jake


project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://
www.w3.org/2001/XMLSchema-instance
  xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd;
groupIdorg.example/groupId
artifactIdproject/artifactId
packagingwar/packaging

properties
gae.sdk.location/Applications/eclipse/plugins/
com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141120/
appengine-java-sdk-1.3.0/gae.sdk.location
/properties

repositories
repository
idMVNSearch/id
nameMVNSearch/name
urlhttp://www.mvnsearch.org/maven2/url
/repository
repository
idDataNucleus/id
urlhttp://www.datanucleus.org/downloads/maven2//url
/repository
/repositories

dependencies
dependency
groupIdcom.google.appengine/groupId
artifactIdappengine-api-1.0-labs/artifactId
version1.3.0/version
/dependency
dependency
groupIdcom.google.appengine.orm/groupId
artifactIddatanucleus-appengine/artifactId
version1.0.4.1/version
exclusions
exclusion

artifactIddatanucleus-core/artifactId
groupIdorg.datanucleus/groupId
/exclusion
/exclusions
/dependency
dependency
groupIdorg.datanucleus/groupId
artifactIddatanucleus-core/artifactId
version1.1.6/version
/dependency
dependency
groupIdorg.datanucleus/groupId
artifactIddatanucleus-jpa/artifactId
version1.1.5/version
/dependency
dependency
groupIdorg.example/groupId
artifactIdotherproject/artifactId
version0.0.1-SNAPSHOT/version
/dependency
/dependencies

build
finalName${project.artifactId}/finalName
resources
resource
filteringfalse/filtering
directorysrc/main/resources/directory
/resource
resource
filteringfalse/filtering
directorysrc/main/java/directory
includes
include**/include
/includes
excludes
exclude**/*.java/exclude
/excludes
/resource
resource
directorysrc/main/webapp//directory
includes
include**/*.xml/include
/includes
/resource
/resources
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-war-plugin/artifactId
configuration

warSourceDirectory${basedir