[appengine-java] java.io.IOException: unexpected response from remote api when using Remote API to connect to local dev server

2011-12-09 Thread Stefan
Hi everyone,

I am trying to use the Remote API as described in [1] to connect to
the local data store. But when I call the RemoteApiInstaller's
install() method I always get the mentioned exception. Here is the
complete trace:

Exception in thread main java.io.IOException: unexpected response
from remote api: {rtok: null, app_id: myID}

at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.getAppIdFromServer(RemoteApiInstaller.java:
319)
at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.loginImpl(RemoteApiInstaller.java:
276)
at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.login(RemoteApiInstaller.java:
237)
at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.install(RemoteApiInstaller.java:
106)
at
util.kisimporter.KisCsvImporter.setupRemoteDatastoreService(KisCsvImporter.java:
290)
at
util.kisimporter.KisCsvImporter.configureUsingLocalDevServer(KisCsvImporter.java:
266)
at util.kisimporter.KisCsvImporter.main(KisCsvImporter.java:106)

Anybody else having this problem? Or better yet: a solution? :)

Best,
Stefan

[1] 
http://code.google.com/appengine/docs/java/tools/remoteapi.html#Configuring_Remote_API_on_the_Client

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



[appengine-java] Re: java application upload help

2011-12-09 Thread Stefan
Hi Prasad,

looks like you have an invalid character in one of the files in your
project:

On Dec 9, 4:20 am, madushka.prasadgmail.com
madushka.pra...@gmail.com wrote:
 SEVERE: Invalid character in 
 filename:www.facebook.com_login.php_login_attempts
 =1.php
 Dec 10, 2011 2:45:41 AM
 com.google.appengine.tools.admin.AppVersionUpload addFil
 e
 SEVERE: Invalid character in filename: 
 __static__/www.facebook.com_login.php_log
 in_attempts=1.php

Maybe that is the cause of your problem?

Best,
Stefan

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



[appengine-java] Deploying two apps to one datastore memcache

2011-12-09 Thread Mat Jaggard
I currently have an app which has two distinct parts.

One is a public facing part which relies on basic servlets and very
few dependencies - it is dynamic and uses the datastore and memcache
extensively but I need this part to scale quickly and efficiently with
as low a cost as possible.

The second part is essentially an administration interface, it's much
heavier, makes use of Guice, Cambridge templates, Objectify and I'm
just about to add a fairly heavy library.

I can make the first part load on app engine in just over a second,
but once I add in the extra features needed for the second part, start-
up takes over 10 seconds. This is probably fine, but I'd like to serve
people quicker than that, and I might get lots of traffic very
suddenly which could cause lots of new instances to start at once. So,
is it possible to separate these but have them access the same
datastore and memcache? Can I use different versions of the app for
this? Is that the only way? Will different versions load separately
in a way that will work correctly for scaling?

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



[appengine-java] Re: Deploying two apps to one datastore memcache

2011-12-09 Thread Max
How about deploy as two versions? So that different versions of instance 
are loaded independently. 

With regards to admin console, you might be interested at 
Yaachttp://code.google.com/p/yaac/. 
So that you don't have to develop some general admin functions in your 
version again.

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



[appengine-java] Conversion API: Best way to track down conversion issues?

2011-12-09 Thread Daniel Florey
Hi,
I'm getting started with the new Conversion API. While it works like a 
charm for some documents (html-pdf) I end up with empty pdf's for others.
The pdf's seem to be generated with Prince (princexml.com), so I've 
downloaded the latest release to track down the issue.
Prince converts the documents just fine, so I'm wondering which version is 
used on GAE?
Or is there another way to get more debug info?

Thanks,
Daniel

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



Re: [appengine-java] Error 500 when my application on google app engine.

2011-12-09 Thread Bruno Fuster
Can you send the error stack trace ?

Did you enable sessions at appengine-web.xml ?



On Fri, Dec 9, 2011 at 4:55 AM, binit topiwala binit.00...@gmail.comwrote:

 I am able to run  my application well on localhost, but getting error when
 trying to run on GAE.

 My appid: http://movieflixapp.appspot.com

 Also, I'm not able to use HttpSession in my web application.

 I'm attching my code files above.

 What I'm actually doing is like, storing the data into the datastore, and
 then retrieving it from the datastore and then storing it in the
 httpsession variables, also I'm trying to fetch the data from the data from
 the datastore in the a.jsp itself, but it's not running too on google app.

 Error: Server Error The server encountered an error and could not
 complete your request.

 If the problem persists, please 
 reporthttp://code.google.com/appengine/community.html your
 problem and mention this error message and the query that caused it.
 Thank you.

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




-- 
Bruno Fuster

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



[appengine-java] Re: Conversion API: Best way to track down conversion issues?

2011-12-09 Thread Daniel Florey
Everything works fine now! I've been just messing up the pdf document by 
streaming it to the client with the wrong encoding...

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



[appengine-java] Error forcing a logout and redirect

2011-12-09 Thread hendrix.jason
I'm trying to force a logout and redirect by using this code from a
jsp page:
pageContext.forward(userService.createLogoutURL(../pageName.jsp));

This works in the dev environment, but not on the GAE servers.  There
I get this error: Error: NOT_FOUND

I get the same error if I change ../pageName.jsp to pageName.jsp.

If I place the contents of userService.createLogoutURL(../
pageName.jsp) in to a hyperlink and click it from a jsp page, it
works ok.

What could be 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-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: datastore.delete() not deleting objects and not generating exceptions

2011-12-09 Thread hendrix.jason
Have you tried surrounding the select and delete queries in once
transaction?
See: http://code.google.com/appengine/docs/java/datastore/transactions.html

There is no reason it shouldn't work otherwise, but it may be worth a
shot.

Also, with it being the same 213 objects, maybe those particular
objects are corrupt.  Have you tried to manually delete them from the
admin console?

On Dec 8, 6:22 pm, Michael michael.ol...@gmail.com wrote:
 I have an hourly cron job that deletes data from the datastore older than
 one month (this data is archived elsewhere for long term storage).  The
 first run of that cron job on Tuesday after the datastore came back up
 behaved quite unusually, ended with java.lang.OutOfMemoryError: Java heap
 space, and hasn't completed once since then.  While it is possible that
 this is pure coincidence, I'm wondering if something done during the
 maintenance resulted in this behavior.  I have been unable to get this cron
 job to run correctly since then.

 The job is quite simple, and has been running happily for about a year; I
 will present the idea here for brevity and attach the source for those
 interested.  In essence the job does the following:
 - retrieve at most 500 entities older than 1 month by their keys only
 - send all resulting keys as a list to datastore.delete()
 - repeat until no results are returned

 The first run after maintenance produced the attached log-excerpt.txt.  The
 brief version is the following:
 - deleted 500 objects
 - deleted 465 objects
 - deleted 213 objects (repeated 395 times)
 - out of memory

 It seems that, after actually deleting the first 752 objects of the query,
 the datastore got stuck on the next 213.  The same 213 objects were sent
 repeatedly to datastore.delete().  No exceptions were generated, but the
 data was obviously not deleted.

 The next attempt (the job was retried since it crashed) produced almost
 identical output.  This time, it actually deleted 174 objects, then tried
 to delete the same 213 objects over and over until it, too, crashed with an
 OutOfMemoryError.  The run after that actually deleted 8 objects before it
 crashed in the same manner.  This continued until the error ran my
 application out of quota for the day, at which point I got a notification
 email and went to go pause the queue that these jobs run under.

 Note, I am not on the high replication datastore.  I do not know why this
 is happening, but it is currently an insurmountable obstacle.  I tried
 unpausing the queue temporarily and running the problematic job, and this
 time I did not even get the previously frustrating but informative output;
 instead, I merely got the A serious problem was encountered . . . message
 on both runs.

 Any help in getting this fixed or understanding the problem would be
 greatly appreciated.

  log-excerpt.txt
 60KViewDownload

  DeleteOldDataServer.java
 4KViewDownload

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



[appengine-java] Re: Securing cron urls / task urls using UserService and not using web.xml

2011-12-09 Thread hendrix.jason
There is probably a better way, but you could look at the user agent
string (I see in my logs that the user agent string for pages launched
by cron look like AppEngine-Google; (+http://code.google.com/
appengine).

Also, cron jobs are executed as admin.  You may be able to use the
userService.isUserAdmin() functionality, although I haven't tested
that.

Thanks,
Jason

On Dec 8, 5:08 am, Raphael André Bauer raphael.andre.ba...@gmail.com
wrote:
 Hi,

 I am currently trying to secure my urls that are accessed by cron jobs / 
 tasks.

 Normally I would use web.xml like that:

     security-constraint
         web-resource-collection
             web-resource-nameProtected Area/web-resource-name
             url-pattern/cron/*/url-pattern
         /web-resource-collection
         auth-constraint
             role-nameadmin/role-name
         /auth-constraint
     /security-constraint

 However, I got a constraint, where these urls should be allowed to be
 triggered by other authentification mechanisms.

 Therefore I tried to use the UserService if a authenticated user is
 hitting the url. I though cron is an authenticated user...

 UserService userService = UserServiceFactory.getUserService();

 if (!userService.isUserLoggedIn()) {

     //do nothing



 } else if (!userService.isUserAdmin()) {
     //do nothing
 }

 //allow stuff to work...

 }

 But I do not get a logged in user when cron is programmatically hitting my 
 urls.

 Is there a way to determine if google app engine is hitting my urls
 without using web.xml security constraints?

 Thanks,

 Best,

 Raphael

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



Re: [appengine-java] Re: Securing cron urls / task urls using UserService and not using web.xml

2011-12-09 Thread Matthew Jaggard
Raphael, is is the isUserLoggedIn() that returns false or the isUserAdmin()?
If the first returns false but the second returns true (which would make
SOME sense I guess!) then you could refactor your code to only run if
isUserAdmin() is true, rather than them both having to be true.

I have no idea, just a guess I'm afraid.

Mat.

On 9 December 2011 23:45, hendrix.jason hendrix.ja...@gmail.com wrote:

 There is probably a better way, but you could look at the user agent
 string (I see in my logs that the user agent string for pages launched
 by cron look like AppEngine-Google; (+http://code.google.com/
 appengine).

 Also, cron jobs are executed as admin.  You may be able to use the
 userService.isUserAdmin() functionality, although I haven't tested
 that.

 Thanks,
 Jason

 On Dec 8, 5:08 am, Raphael André Bauer raphael.andre.ba...@gmail.com
 wrote:
  Hi,
 
  I am currently trying to secure my urls that are accessed by cron jobs /
 tasks.
 
  Normally I would use web.xml like that:
 
  security-constraint
  web-resource-collection
  web-resource-nameProtected Area/web-resource-name
  url-pattern/cron/*/url-pattern
  /web-resource-collection
  auth-constraint
  role-nameadmin/role-name
  /auth-constraint
  /security-constraint
 
  However, I got a constraint, where these urls should be allowed to be
  triggered by other authentification mechanisms.
 
  Therefore I tried to use the UserService if a authenticated user is
  hitting the url. I though cron is an authenticated user...
 
  UserService userService = UserServiceFactory.getUserService();
 
  if (!userService.isUserLoggedIn()) {
 
  //do nothing
 
 
 
  } else if (!userService.isUserAdmin()) {
  //do nothing
  }
 
  //allow stuff to work...
 
  }
 
  But I do not get a logged in user when cron is programmatically hitting
 my urls.
 
  Is there a way to determine if google app engine is hitting my urls
  without using web.xml security constraints?
 
  Thanks,
 
  Best,
 
  Raphael

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



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



[appengine-java] Re: Securing cron urls / task urls using UserService and not using web.xml

2011-12-09 Thread BoulderGae
The user service will always return null when cron is calling.  The
way to tell that cron is calling is to check for the X-AppEngine-
Cron header.  It is set by the cron service and is stripped from all
other calls to your URLs.  That is the best you can do until the GAE
cron service is better integrated into the user service.

scott

On Dec 8, 4:08 am, Raphael André Bauer raphael.andre.ba...@gmail.com
wrote:
 Hi,

 I am currently trying to secure my urls that are accessed by cron jobs / 
 tasks.

 Normally I would use web.xml like that:

     security-constraint
         web-resource-collection
             web-resource-nameProtected Area/web-resource-name
             url-pattern/cron/*/url-pattern
         /web-resource-collection
         auth-constraint
             role-nameadmin/role-name
         /auth-constraint
     /security-constraint

 However, I got a constraint, where these urls should be allowed to be
 triggered by other authentification mechanisms.

 Therefore I tried to use the UserService if a authenticated user is
 hitting the url. I though cron is an authenticated user...

 UserService userService = UserServiceFactory.getUserService();

 if (!userService.isUserLoggedIn()) {

     //do nothing



 } else if (!userService.isUserAdmin()) {
     //do nothing
 }

 //allow stuff to work...

 }

 But I do not get a logged in user when cron is programmatically hitting my 
 urls.

 Is there a way to determine if google app engine is hitting my urls
 without using web.xml security constraints?

 Thanks,

 Best,

 Raphael

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