[appengine-java] Many "Request was aborted after waiting too long to attempt to service your request" errors

2009-12-16 Thread Fabrizio
Hello,

I have a cron job (1/m).  I get many random errors like:
12-16 06:43AM 34.115 /"myurl.."   500 10020ms 0cpu_ms 0kb
"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."

I think it's not caused by "simultaneous dynamic request limit". I
make only 1 request/minute.
I also noticed an high time (more than 1ms).


When it works, the log is like this:
  12-16 06:48AM 20.059 /"myurl..."   200 156ms 191cpu_ms
95api_cpu_ms 0kb


Why some requests work and other crash? I don't change anything
between them.


   Fabrizio

--

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




[appengine-java] Re: Many "Request was aborted after waiting too long to attempt to service your request" errors

2009-12-17 Thread Fabrizio
> If your cron job has to wait longer than 10 seconds while your app is
> reloading you will get this message.  Do you also see a "loading
> request" in the logs just after or before this error message?  If so
> then it is interesting that despite your 1 minute "ping", engine is
> still swapping out your app.

I also get warning like
"com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue
$SystemLoader loadFinalizer: Not allowed to access system class
loader..."

In another thread, someone said these warnings are related to "loading
requests".

Have you any idea/suggestion?


   fabrizio


--

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] JDO Query limit? 1000?

2009-12-17 Thread Fabrizio
(Perhpas it's a FAQ but I haven't found the response...)

I use JDO to access the DataStore. Is there any limit on the number of
items a query can return? I read of a limit of 1000 but I have done
some tests with more than 2000 entries. I can get all the items
without error.

PersistenceManager pm = PMF.get().getPersistenceManager();
List persons = (List) pm.newQuery(  "select from " +
Person.class.getName()).execute();

Is there any limit?

   fabrizio

--

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 Query limit? 1000?

2009-12-17 Thread Fabrizio
I don't understand.  Can you explain a bit more?
I've tried this code. It works and I get 1490 items. Why?

PersistenceManager pm = PMF.get().getPersistenceManager();
Query qry = pm.newQuery("select from " + Person.class.getName() + "
where _age > 4");
qry.setRange(10,1500);
List persons = (List) qry.execute();


  fabrizio


On Dec 17, 3:17 pm, abhi  wrote:
> You sure will get all results , specially on offline mode , but you
> cant do paging in query for more than
> 1000 results ,with Query query = pm.newQuery(YORRQUERY);
>                 query.setRange(0 , 1001);

--

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 Query limit? 1000?

2009-12-17 Thread Fabrizio
It also works on Google App server !Very strange


My test jsp page:



<%
PersistenceManager pm = PMF.get().getPersistenceManager();
Query qry = pm.newQuery("select from " + Person.class.getName() + "
where _age > 4");
qry.setRange(10,1500);
List persons = (List) qry.execute();
%>
SIZE:<%=persons.size()%>

<% for (Person p : persons) {  %>
<%=p.getID()%>
<%  }
pm.close();  %>

.



On Dec 17, 4:08 pm, abhi  wrote:
> That will work only on local mode , if you use it on server you will
> get .
> ... threw an unexpected exception: java.lang.IllegalArgumentException:
> offset may not be above 1000  ..

--

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 Query limit? 1000?

2009-12-18 Thread Fabrizio
Stephen, you're right. I tested setRange(1200, 1500) and I get an
exception.

I'd like to understand more about that. Why datastore limits the first
parameter (skip) and not also the second?
I was thinking that the limit of a query was 1000 items. I was wrong.
So, I can get 5000 items with problem, but I cannot skip the first
1000.  Quite strange... IMHO

   fabrizio

On Dec 17, 10:39 pm, stephenp  wrote:
> He meant setRange(1001, 2000) will fail. Datastore will only let you
> skip the first 1000. If you try to skip past more than 1000 you'll get
> an error. In your code, you're only skipping the first 10 "setRange
> (10,1500)".
>
> Stephen

--

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: Accessing GMail Inbox

2009-12-21 Thread Fabrizio
AFAIK from GAW you can only communicate on port 80 and 443 (hhttp and
https). And you must use the Url Fetch service.

  fabrizio


On Dec 20, 5:36 pm, Pion  wrote:
> Thehttp://java.sun.com/products/javamail/FAQ.html#gmailshows how to
> access Gmail Inbox using JavaMail.
>     //String host = "imap.gmail.com;
>     String host = "pop.gmail.com;
>     String username = "user";
>     String password = "passwd";
>     // ...
>     //Store store = session.getStore("imaps");
>     Store store = session.getStore("pop3s");
>     store.connect(host, username, password);
>     // ...
>
> I tried the above code and deployed it on GAE. I received the
> following log:
>
>         Unable to locate provider for protocol: pop3s
>
> I switched to 'Store store = session.getStore("imaps");', It gave me
> similar error.
>
>         Unable to locate provider for protocol: imaps
>
> I am using GAE 1.3.0.
>
> Please advise if this is even possible. If yes, what did I do wrong?
> Thanks in advance for your help.

--

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




[appengine-java] Re: Many "Request was aborted after waiting too long to attempt to service your request" errors

2010-01-15 Thread Fabrizio
I continue to get the errors. I really don't understand. My app is
very low traffic. But I have a cron. It fires every minute and does a
very little and fast job (normally  "/myurl 200 59ms 80cpu_ms
21api_cpu_ms 0kb").
But sometime I get "/myurl 500 10002ms 0cpu_ms 0kb".  Today rate is
10%, so I get 1 error every 10 request!.

I really don't understand. I have no idea.  :(((

I only noticed the presence of the warning
"com.google.appengine.repackaged.com.google.common.base.FinalizableReferenc
eQueue" in the near requests (before or after).  But, as John
said, it harmless.

Google guys, please, help me and the other with the same issue.


   Fabrizio



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




[appengine-java] Re: Many "Request was aborted after waiting too long to attempt to service your request" errors

2010-01-15 Thread Fabrizio
John,

my app is very very simple. It does not use external frameworks or
libraries.

   fabrizio
  
> I think currently the only solution is to make you app  
> start up faster.  
-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Many "Request was aborted after waiting too long to attempt to service your request" errors

2010-01-21 Thread Fabrizio
Since 10 hours I see no more errors!  I'm very happy!   :)))
(now: 2010-01-22 7:40 utc)

I haven't changed anything and no deploy.
Google Team, what have you done?

FYI, a couple of screenshot of the dashboard graph:

http://gs.fhtino.it/download/GAE2_no_more_error1.png?attredirects=0
http://gs.fhtino.it/download/GAE2_no_more_error2.png?attredirects=0


  Fabrizio


-- 
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: Post/Get to a servlet from another servlet

2010-01-25 Thread Fabrizio
Consider using queue.
At the end of your servlet, enqueue a call to the same servlet and
pass one or more parameters with the "next" item to process.
Example:  /myservlet?nextID=90


  Fabrizio


On Jan 26, 5:07 am, edarroyo  wrote:
> I'm sorry if this is a stupid question, but is it possible to do a
> post request to another servlet from within a servlet?
>
> ..

-- 
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: Object property cannot accept null values.

2010-02-04 Thread Fabrizio
Use Double instead of double.
Double is an Object --> can be null.


  fabrizio


On Feb 5, 3:23 am, dreamy  wrote:
> I have create lot of Object in past. when  I add a property " private
> double price;" to this object today .but  i query the record again,the
> exception is throw:
>
> java.lang.NullPointerException: Datastore entity with kind
> PurchaseBilling and key PurchaseBilling(178) has a null property named
> price.  This property is mapped to
> com.datong.drp.model.PurchaseBilling.price, which cannot accept null
> values.
>
> I must clear all data and insert again? is there any other method to
> add this property?

-- 
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-13 Thread Fabrizio
Jake,

you don't manage null values.



I normally write:

@Persistent
private Text Data;

public void setData(String data) {
if (data == null)
this.Data = null;
else
this.Data = new Text(data);
}

public String getData() {
if (this.Data == null)
return null;
else
return this.Data.getValue();
}



   fabrizio


On Mar 12, 8:22 pm, Jake  wrote:
> 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

-- 
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] PdfBox text extraction & GAE

2010-04-20 Thread Fabrizio
If anyone is interested...

PdfBox text extration & GAE
How to do text extraction from pdf files using PdfBox on Google App
Engine
http://fhtino.blogspot.com/2010/04/pdfbox-text-extration-gae.html

fabrizio

-- 
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] TaskOptions.countdownMillis not used

2010-04-22 Thread Fabrizio
Hello,

I need to add a task in the TaskQueue. But I need a small delay before
exectution (2 seconds). I use countdownMillis(long) to delay the
execution.  But execution starts immediatelly. I don't understand if
my code is wrong or if there is a problem with countdownMillis.

My code is:

Queue queue = QueueFactory.getQueue(queueName);
TaskOptions taskOpts = TaskOptions.Builder.url(url);
taskOpts.countdownMillis(delay);
taskOpts.method(Method.GET);
queue.add(taskOpts);


   Thank you for help


fabrizio

-- 
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: TaskOptions.countdownMillis not used

2010-04-23 Thread Fabrizio
delay = 2000


On Apr 23, 12:03 am, "Max Ross (Google)" 
wrote:
> What is the value of the delay variable?

-- 
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: TaskOptions.countdownMillis not used

2010-04-23 Thread Fabrizio
Production.


On Apr 23, 3:02 pm, James  wrote:
> Are you seeing this on the dev server or in production?  I vaguely
> recall reading somewhere that the dev server always executes
> immediately(??).
>
> James

-- 
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: TaskOptions.countdownMillis not used

2010-04-25 Thread Fabrizio
Hello Max,

I noticed it because I got wrong data. So I checked the logs.
But, now, I'm trying to reprocude the issue but I cannot. The delay is
good.
I'll continue the test and I'll let you know.

Thank you for your help.


   fabrizio




On Apr 23, 10:40 pm, "Max Ross (Google)" 
wrote:
>  The difference between 2 seconds and immediate isn't much.  How are you
> measuring?  Do you have logs that show the time at which the task was
> enqueued and the time at which it executes?
>
> Thanks,
> Max
>
>

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



[appengine-java] Re: PdfBox text extraction & GAE

2010-05-06 Thread Fabrizio
Ken,

I do not retrived the pdf using PdfBox but using an explicit http
connection.
Then I get the content and pass it to PdfBox.

Code:

URL urlObj = new URL(pdfUrl);
HttpURLConnection connection = (HttpURLConnection)
urlObj.openConnection();
int httpRespCode = connection.getResponseCode();

if (httpRespCode == 200) {
RandomAccessBuffer tempMemBuffer = new RandomAccessBuffer();
PDDocument doc = PDDocument.load(connection.getInputStream(),
tempMemBuffer);
...


   fabrizio


On May 4, 11:17 pm, kldaniels  wrote:
> This is interesting that you got this to work.
>
> I have been trying to work with PDFBox with GAE as well, and have not
> been able to get very far.  I am attempting to open a pdf document as
> follows but only get a IOException:
>
>      URL url = new URL("http://www.pbs.org/newshour/extra/teachers/
> lessonplans/media/clock_gettysburg_9-3.pdf");
>      PDDocument doc = PDDocument.load(url);
>      PDDocumentInformation info = doc.getDocumentInformation();
>
> I am not sure what I am doing wrong.
>
> Ken

-- 
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: Disable URLFetchService cache

2010-06-10 Thread Fabrizio
I had the same problem. I solved with:

...
URL urlObj = new URL(url);
HttpURLConnection connection = (HttpURLConnection)
urlObj.openConnection();
connection.addRequestProperty("Cache-Control", "no-cache,max-age=0");
connection.addRequestProperty("Pragma", "no-cache");
...


fabrizio


On Jun 9, 2:29 pm, mar_novice  wrote:
> Is there a way to disable urlfetchService cache? When I made a
> urlfetch, sometimes, what I get is the cached result.

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



[appengine-java] Re: Limiting the number of requests per IP each minute

2010-07-03 Thread Fabrizio
Hello,

I also used memcache to limit the max number of requests/minute. It
works very well.

Key: ipaddress
Value: counter (int)

I put the items in memcache with an expiration of 60 seconds.

   Map props = new HashMap();
   props.put(GCacheFactory.EXPIRATION_DELTA, 60);
   CacheFactory cacheFactory =
CacheManager.getInstance().getCacheFactory();
   Cache cache = cacheFactory.createCache(props);
   cache.put(key, value);


fabrizio

-- 
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] OpenID & Development server

2010-10-07 Thread Fabrizio
Hello, I'm testing OpenID (SDK 1.3.7). My env is: Eclipse + GAE Plugin.
Question: is OpenID supported by local development server?


I have a protected area. I force users to login with:


/protected/*


*





When I try to access the protected area from production I get correctly
redirect to:
http://MYAPP.appspot.com/_ah/login_required?continue=http://MYAPP.appspot.com/protected/



But on local development server I
get:http://localhost:/_ah/login?continue=http://localhost:/protected/




Why?


fabrizio

-- 
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: OpenID & Development server

2010-10-09 Thread Fabrizio
Any idea?



On Oct 7, 10:46 am, Fabrizio  wrote:
> Hello, I'm testing OpenID (SDK 1.3.7). My env is: Eclipse + GAE Plugin.
> Question: is OpenID supported by local development server?
>
> I have a protected area. I force users to login with:
> 
> 
> /protected/*
> 
> 
> *
> 
>
> 
>
> When I try to access the protected area from production I get correctly
> redirect 
> to:http://MYAPP.appspot.com/_ah/login_required?continue=http://MYAPP.app...
>
> But on local development server I
> get:http://localhost:/_ah/login?continue=http://localhost:/protec...
>
> Why?
>
> fabrizio

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



[appengine-java] Local datastore empty after updating to SDK 1.4.0

2010-12-04 Thread Fabrizio
I have a project with a local datastore. There was many entities in
it.

I have update the sdk from 1.3.7 to 1.4.0. Now the local datastore is
empty. My app does not show data and local management tell datastore
is empty (http://localhost:/_ah/admin/datastore).

I've also tried to "revert" the local_db.bin file to my previous
version from my local subversion. But it does not work.   :(

Any idea?

Fabrizio


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



Re: [appengine-java] migrating to 1.4 task queues

2010-12-27 Thread Fabrizio
@Ikai, 
about url --> withUrl please update documentation/examples at 
http://code.google.com/appengine/docs/java/taskqueue/overview.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.



Re: [appengine-java] GAE Authentication Broken

2011-04-24 Thread Fabrizio Accatino
Not sure... but since you are connecting through https,  try to get the
SACSID cookie instead of the ACSID.

   fabrizio


On Sun, Apr 24, 2011 at 11:04 PM, Konstantin Weitz <
konstantin.we...@googlemail.com> wrote:

> Hi guys,
>
> I'm trying to authenticate at a web service, running on gae, with android
> as described here
>
> http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app
>
> For that reason I first get the token from the phone with the following
> code
>
> accountManager.getAuthToken(account, "ah", false, new
> GetAuthTokenCallback(), null);
> // ...
> String auth_token = bundle.getString(AccountManager.KEY_AUTHTOKEN);
>
> and i then request the following url in order to get the real
> authentication token
>
> "https://"+DOMAIN+"/_ah/login?continue=http://localhost/&auth="; +
> auth_token
>
> and i get the following error message (the code used to work just recently)
>
> The server encountered an error and could not complete your request.
> If the problem persists, please http://code.google.com/appengine/community.html";>report
> your problem and mention this error message and the query that caused
> it.
>
> What is the problem? Did the api change?
>
> --
> 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.



Re: [appengine-java] GAE Authentication Broken

2011-04-25 Thread Fabrizio Accatino
In your first piece of code you used https.  So you need to get the "secure"
auth cookie from app engine (SACSID).  IMHO

My codes. It manages both cookies.
http://fhtino.blogspot.com/2011/02/connet-android-app-to-google-app-engine.html


   fabrizio



On Mon, Apr 25, 2011 at 12:22 PM, Konstantin Weitz <
konstantin.we...@googlemail.com> wrote:

> I think my authentication token may just have expired.
>
> http://stackoverflow.com/questions/1996686/authtoken-from-accountmanager-in-android-client-no-longer-working
>
> I didn't check yet but the symptoms seem to match.
> It sure would be nice if the error message I get from the server would be
> more helpful.
>
>
>

-- 
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] task queues and retries

2010-07-19 Thread Fabrizio Accatino
AFAIK if you don't catch exceptions, you'll get HTTP 500 error.
Can you post your code?
Are you sure that you do not try/catch the exception?

fabrizio


On Mon, Jul 19, 2010 at 12:38 AM, Philip Tucker  wrote:

> One of my tasks encountered a failure and wasn't retried. I think it's
> because the servlet returned a 200 response, but I don't know why it
> did since the exception bubbled all the way up to the base servlet. Do
> we need to explicitly return a 5xx error code in exception cases for
> retries to work?
>
> 07-18 02:46PM 06.907 /cleanerq 200 29515ms 9156cpu_ms 5404api_cpu_ms
> 0kb AppEngine-Google; (+http://code.google.com/appengine)
> 0.1.0.2 - - [18/Jul/2010:14:46:36 -0700] "POST /cleanerq HTTP/1.1" 200
> 0 "http://11.latest.wordwisegame.appspot.com/starttasks"; "AppEngine-
> Google; (+http://code.google.com/appengine)"
> "11.latest.wordwisegame.appspot.com" ms=29516 cpu_ms=9157
> api_cpu_ms=5404 cpm_usd=0.254392 queue_name=cleaner-queue
> task_name=5681724147391472665 exit_code=104
>
> ...

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



Re: [appengine-java] parameter values in taskqueue that contain '&' gets cut

2010-09-19 Thread Fabrizio Accatino
 - how have you url-encoded the parameters?  Can you share the code?
 - have you tried Method.POST instead of GET?

fabrizio


On Mon, Sep 20, 2010 at 7:45 AM, mar_novice  wrote:

> When using task queue and the parameters contain an ampersand, it gets
> cut off when you try to its value.
>
> example:
>
> Queue queue = QueueFactory.getDefaultQueue();
> queue.add(
>url("/mailer")
>.param("msg","you & me")
>.method(Method.GET)
>  );
>
> and in mailer servlet, when you try to get the value of msg
> ...
> msg = request.getParameter("msg");
> ...
>
> what i get is "you" only. The characters starting from the & to the
> end gets cut off. I even tried to url encode first the message.. but
> still it gets cut off.. Is this a bug?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: OpenID & Development server

2010-10-10 Thread Fabrizio Accatino
I have no problem opening an issue. But actually I don't understand if I
have a problem/wrong_configuration or App Engine has a bug.
I'm waiting for a reply from Google guys...  :)

fabrizio

2010/10/9 ArtemGr 

> OpenID support is still experimental, there are several open issues
> concerning it. If you feel you encountered a new problem, maybe you
> should file an 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.



Re: [appengine-java] OpenID & Development server

2010-10-16 Thread Fabrizio Accatino
I also noticed different urls generated by  userService.createLoginURL
String loginUrl = userService.createLoginURL(continueURL, null, providerUrl,
attributes);

On GAE I get URLs like this one:
http://myapp.appspot.com/_ah/login_redir?claimid=myopenid.com&continue=http://myapp.appspot.com/myurl
It works fine. I can login with openID.

On local development server I get:
http://localhost:/_ah/login?continue=myurl
And this does not work. :(

The question remains the same: is OpenID supported by local Development
server?
Google guys, please, give me an hint...


  fabrizio



On Thu, Oct 7, 2010 at 10:46 AM, Fabrizio  wrote:

> Hello, I'm testing OpenID (SDK 1.3.7).  My env is: Eclipse + GAE Plugin.
> Question: is OpenID supported by local development server?
>
> I have a protected area. I force users to login with:
>
>
> 
>
> 
>
> /protected/*
>
> 
>
> 
>
> *
>
> 
>
> 
>
> When I try to access the protected area from production I get correctly
> redirect to:
>
> http://MYAPP.appspot.com/_ah/login_required?continue=http://MYAPP.appspot.com/protected/
>
> But on local development server I get:
> http://localhost:/_ah/login?continue=http://localhost:/protected/
>
>
> Why?
>
>  fabrizio
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] OpenID & Development server

2010-10-20 Thread Fabrizio Accatino
Issue opened
http://code.google.com/p/googleappengine/issues/detail?id=3922


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



Re: [appengine-java] Tasks & SSL

2010-11-09 Thread Fabrizio Accatino
 - what error do you receive?  copy and paste log
 - try to remove ssl. The connection is "internal". (AFAIK)

fabrizio


On Tue, Nov 9, 2010 at 3:37 AM, Dom Derrien wrote:

> Context:
> - Tasks as defined in
> http://code.google.com/appengine/docs/java/taskqueue/overview.html
> - Secured URLs as described in
> http://code.google.com/appengine/docs/java/config/webxml.html
>
> In the following excerpts, you can see I want to be sure that only
> administrators can access over SSL resources  in the /_admin folder.
> This works fine when I access JSP page or call a servlet. However, the
> automatic task execution fails continuously on production, which
> generates a never ending task rescheduling...
>
> - Sample task scheduling:
>QueueFactory.getDefaultQueue().add(url("/
> _admin/...").method(Method.GET));
> - web.xml part:
>
>
>/_admin/*
>
>
>admin
>
>
>CONFIDENTIAL
>
>
>
> As tasks are issued server-side and consumed there without having
> transited on the public Internet (I hope so), I don't think there's a
> risk of having non encrypted task calls.
>
> I've just created another path for my tasks entry points (/_tasks) and
> the path is not covered by the SSL restriction. Is it the right way?
> Or did I hit a defect?
>
> Thanks,
> A+, Dom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: Local datastore empty after updating to SDK 1.4.0

2010-12-05 Thread Fabrizio Accatino
Ian,

I had read your previous post (2010-04-15). As you wrote, I'd also like to
find a more "authoritatively" response. But  I haven't found it. :(

  fabrizio

On Sun, Dec 5, 2010 at 11:47 AM, Ian Marshall wrote:

> Does this post help?
>
>
> http://www.google.com/url?url=http://groups.google.com/g/f907f736/t/27097b9831aff32a/d/c16b898dcaad10ef%3Fq%3D%23c16b898dcaad10ef&ei=aG37TNXvFoHA_Abn1qTaAg&sa=t&ct=res&cd=10&source=groups&usg=AFQjCNGa_5Wk3KqMn7czeKwR0zocC07gOw
>
> On Dec 4, 2:40 pm, Fabrizio  wrote:
> > I have a project with a local datastore. There was many entities in
> > it.
> >
> > I have update the sdk from 1.3.7 to 1.4.0. Now the local datastore is
> > empty. My app does not show data and local management tell datastore
> > is empty (http://localhost:/_ah/admin/datastore).
> >
> > I've also tried to "revert" the local_db.bin file to my previous
> > version from my local subversion. But it does not work.   :(
> >
> > Any idea?
> >
> > Fabrizio
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: Local datastore empty after updating to SDK 1.4.0

2010-12-05 Thread Fabrizio Accatino
Sorry Ian,

I don't understand.  Do you delete the local datastore and create it again?
If yes, how?

Fabrizio


On Sun, Dec 5, 2010 at 5:16 PM, Ian Marshall wrote:

> I have a test local datastore. I also have a procedure now to delete
> this whenever I install a new GAE/J SDK. This solved my problem of
> disappearing test data.
>
>

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



Re: [appengine-java] Re: The API call mail.Send() required more quota than is available.

2010-12-17 Thread Fabrizio Accatino
... or "enqueue" your outgoing message on a task queue with a slow run
frequency (let's say 5/minutes).
I do that and I'm very happy.  :)

Fabrizio


On Sat, Dec 18, 2010 at 1:15 AM, Ikai Lan (Google)

> wrote:

> 8 is fairly arbitrary, but there's always going to be a number that bothers
> people, be it 10, 20 or 50.
>
> You should enable billing. We only charge if you go above the daily free
> quota, and it raises the rate limit. That means that if you send 10 emails
> per minute and only do this once a month, you'll never hit this quota limit,
> and we'll likely not bill you since you'll still be well within our free
> quota.
>
>

-- 
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] "SQL injection" on App Engine ?

2010-12-26 Thread Fabrizio Accatino
In a previous post John pointed out that App Engine is subject to attacks
like "SQL injection". He recommended to use parametrized query instead of
concatenating strings to build the query. I think he is right.
Perhaps I missed some points but the docuementation does not point it out.
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html
A suggestion to Google guys: add a clear warning on documentation about
using "concatenated" queries and remove "concatenated" examples (or make it
clear to not use them on real apps).

IMHO  :)


Fabrizio


On Sat, Dec 25, 2010 at 6:42 PM, John  wrote:

> Really, it's important to use parameterized queries. Looking at this style
> of code causes me to assume the app will be subject to attack in the
> 'SQL'-injection style. (Acknowledging that what would be injected would have
> to be something other than SQL.)

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



Re: [appengine-java] Re: "SQL injection" on App Engine ?

2010-12-28 Thread Fabrizio Accatino
Datanucleus,

perhaps my post was too impetuous. Sorry.
Actually "sql injection" (not real SQL) is a small issue on GAE. You are
right. GAE does not use SQL but you can "inject" piece of query into.

A very simple example:
String name = request.getParameter("name");
String q = "select from Employee where lastName == '" + name + "'";
Query query = pm.newQuery(Employee.class, q);

Case1 (good): send name = smith
Case2 (not good): send name = smith' || lastName == 'foo

OK. It's not so dangerous. Infact you cannot send strong injections like
"smith' || '1'=='1" because the engine (actually) refuse it.

So, you are right. No big problem.


   Fabrizio


On Mon, Dec 27, 2010 at 10:29 AM, datanucleus wrote:

> SQL injection ? into a database that doesn't support SQL? Please
> present a clear example of how such a thing can happen and what effect
> it can have. The application designer is the person who allows such a
> thing, not the underlying API
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Restlet, GAE, Android and Google Account authentication (oauth)

2011-01-10 Thread Fabrizio Accatino
I'm not sure if I have undestood your question.
I have done "Android-->GAE" connection using the AccountManager class:


First: get an authentication token using AccountManager ("ah" is App
Engine):
...
AccountManager mgr = AccountManager.get(context);
...
AccountManagerFuture accountManagerFuture =
mgr.getAuthToken(account, "ah", null, (Activity) context, null, null);
Bundle authTokenBundle = accountManagerFuture.getResult();
authToken = authTokenBundle.get(AccountManager.KEY_AUTHTOKEN).toString();
...


Then retrive authentication cookie using DefaultHttpClient passing the
authToken. The url is:
String url = "http://myapp.appspot.com/_ah/login"; + "?continue=" +
URLEncoder.encode(_gaeAppBaseUrl, "UTF-8") + "&auth=" +
URLEncoder.encode(authToken, "UTF-8");

The auth cookie is "ACSID"



   Fabrizio


On Mon, Jan 10, 2011 at 10:04 AM, Sky wrote:

> Hello,
> does anyone know how to use Restlet in combination with OAUTH on GAE
> and Android? I
> searched the web and did not found any useful documentations or
> tutorial. Seems like this is not supported anymore?
>
> What I want to do is connecting Android to Google App engine. On App
> engine I want to use the Google user service
> (userServiceManager.isUserLoggedIn()), to authenticate the user with
> his Google Account.
>
> Here is my Restlet Server Code, which works well:
> public class UploadServerApplication extends Application {
>  @Override
>  public Restlet createInboundRoot() {
>  Router router = new Router(getContext());
>
> getConnectorService().getClientProtocols().add(Protocol.FILE);
> router.attachDefault(UploadServerResource.class);
>return router;
>  }
> }
> Resource:
> UploadServerResource extends ServerResource implements UploadResource
> {
> public UploadResult upload(UploadData uploadData) {
>  UserService userServiceManager =
> UserServiceFactory.getUserService();
>  boolean authenticated = userServiceManager.isUserLoggedIn();<---
> always false in my tests!
>  if (authenticated) { ...  result.setSuccess(true); }
>  else { ...result.setSuccess(false);   }
>  return result;
> }
> -
> Android client code (where is the place to set Google OAuth Cookie??):
> ClientResource cr = new ClientResource("http://192.168.1.4:/
> upload");
> UploadResource resource = cr.wrap(UploadResource.class);
> UploadData uploadData = new UploadData();
> ...
> UploadResult result = resource.uploadTrack(uploadData);
> ...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: Restlet, GAE, Android and Google Account authentication (oauth)

2011-01-11 Thread Fabrizio Accatino
Is this the ClientResource class you use?
http://www.restlet.org/documentation/2.0/jse/api/org/restlet/resource/ClientResource.html

If yes,  ClientResource class has a setCookies method.
Get the auth cookie from GAE and then set it.


Also Request has setCookie
http://www.restlet.org/documentation/2.1/gwt/api/org/restlet/client/Request.html


Let me know if it works.


<http://www.restlet.org/documentation/2.1/gwt/api/org/restlet/client/Request.html>
Fabrizio



On Tue, Jan 11, 2011 at 12:55 PM, Sky wrote:

> yes, that would be the way with simple httpClient. Maybe there is a
> way to couple the HttpClient with Restlet? It seems not to be
> documented...
>
> Maybe there is a way to use Restlet API or another Rest client library
> to do that above?
>
> Thanks!
>
>

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



[appengine-java] Task queue + datastore transaction + jdo: is it possible?

2011-01-11 Thread Fabrizio Accatino
Hello,

documentation tells I can insert a task in queue during a datastore
transaction.
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Tasks_Within_Transactions

The example uses datastore low level api. Is there a way to do the same with
JDO?

Thank you

   Fabrizio

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



Re: [appengine-java] Re: "SQL injection" on App Engine ?

2011-01-11 Thread Fabrizio Accatino
I don't want to start a flame. I'd like to understand a bit more datastore
and jdo and how to use them better.  :)

So, the problem exists. Can you confirm?
I agree with you: it's a developer problem and not a jdo or datastore
problem. But it's the same as the classic sql injection attack: it's always
caused by developer error.

Last: on GAE the problem is very less important and mitigated than classic
sql. Infact in GAE you cannot inject the classic sql injection sequence like
" dummy' or '1'='1 ". But this is due to the fact that datastore is not able
to manage 1==1. So, as you wrote, it's important to use parameters and not
concatenated strings. Exactly the same as classic sql.   :)

Have I correctly understood?


   Fabrizio


On Sun, Jan 9, 2011 at 9:29 AM, datanucleus wrote:

> And that is the developer who has left it open to that. Any sane
> developer would have put "parameters" in the query
>
> > String q = "select from Employee where managerID == :user && lastName
> == :name";
>
> and there any vulnerability disappears. :-P
> Besides which the query written like that would also optimise far
> better
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: Task queue + datastore transaction + jdo: is it possible?

2011-01-12 Thread Fabrizio Accatino
Thank you very much. It works fine.  :)

Only a note. In my tests I didn't pass the transaction when I call the
queue.add. It seems that queue.add "feels" the current transaction (see the
example at
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Tasks_Within_Transactions
)

My code:

PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.currentTransaction().begin();

// JDO
Query jdoquery = pm.newQuery(Friend.class);
 get object x
x.setLastUpdate(new Date());
pm.makePersistent(x);

// Queue
Queue queue = QueueFactory.getQueue("myqueue");

queue.add(taskOpts);

pm.currentTransaction().commit();
} finally {
if (pm.currentTransaction().isActive())
pm.currentTransaction().rollback();
pm.close();
}



   Fabrizio



On Tue, Jan 11, 2011 at 9:29 PM, Ed Murphy  wrote:

> Yes, I do this with JDO.  Just add to you queue within the current
> transaction, for instance;
>
> PersistenceManager pm = PMF.get().getPersistenceManager();
> try
> {
>//
>// start transaction so we can atomically check the secondary key
>//
>pm.currentTransaction().begin();
>
>//
>// enqueue a task to process this ImportTask
>//
>//
>String theUrl = "/tasks"; // whatever your url will be - this is is
> your state;
>Queue queue = QueueFactory.getDefaultQueue();
>queue.add(
>
> DatastoreServiceFactory.getDatastoreService().getCurrentTransaction(),
>TaskOptions.Builder.url(theUrl));
>
>//
>// commit the transaction.
>//
>pm.currentTransaction().commit();   // we finished, so commit
> the
> transaction.
> }
> catch(DataAccessException dae)
> {
>throw dae;  // let prior DataAccessException leave.
> }
> catch(Exception e)
> {
>throw new DataAccessException(e);   // wrap the exception in our
> runtime exception.
> }
> finally
> {
>//
>// if the transactions is still active, then there
>// was an exception thrown.  So we rollback the transaction.
>//
>if(pm.currentTransaction().isActive())
>{
>pm.currentTransaction().rollback();
>}
>
>//
>    // we always close the PersistenceManager when done.
>//
>if(!pm.isClosed())
>{
>pm.close();
> }
> }
>
>
> On Jan 11, 10:45 am, Fabrizio Accatino  wrote:
> > Hello,
> >
> > documentation tells I can insert a task in queue during a datastore
> > transaction.
> http://code.google.com/appengine/docs/java/taskqueue/overview.html#Ta...
> >
> > The example uses datastore low level api. Is there a way to do the same
> with
> > JDO?
> >
> > Thank you
> >
> >Fabrizio
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] I need to do a cron without 30 sec limit

2011-01-22 Thread Fabrizio Accatino
IMHO the right way depends on the number of items you have to process.  :)

If the number is not very big, a simple solution is to create 2 servlet (or
one with a parameter).
 S1 - enqueue all the emails. Iterates through your entities and enqueue one
task per each email (N email --> N task). Important: enque tasks using the
"bulk" enqueue (max 100 task / call).
 S2 - send the email

S1 is called by your CRON
S2 is called by Task Queue

Important: set the queue rate accordingly to your quota limit. If you have
not billing enabled, set 5/m and 1.
So you will not exceed the quota limit (8 recipients/minute).


Fabrizio


On Fri, Jan 21, 2011 at 6:59 PM, Mayumi Liyanage <
mayumi.liyan...@coldwin.com> wrote:

> Hi, I need to iterate over all the entities in the Datastore and send
> out emails once a day asynchronously to the actual app.
> Usual way to do this would be to invoke a Servlet using cron which
> would iterate over all the entities to send emails out. However, our
> data is growing at the rapid rate and sooner or later we will have a
> issue with 30 sec limit problem.
> What would be the best way to do this operation using app engine
> without worrying about 30 sec limit?
>
> Can we do above using the Mapper API? If so how can we invoke a mapper
> from the servlet?
>
> 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-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.



Re: [appengine-java] Task Queue API Update

2011-01-23 Thread Fabrizio Accatino
Method names changed  :)

.url(...) --> withUrl(...)
.method(...) --> withMethod(...)


http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.Builder.html


Fabrizio

<http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.Builder.html>

On Sun, Jan 23, 2011 at 7:14 PM, Doug  wrote:

> Good Afternoon All,
>
>  I am working to convert from the Task Queue Labs API to the non-labs API
> version.  I am finding it slightly more difficult than I initially
> anticipated.  It appears that how I was adding tasks to the queue is not
> compatible with the non-labs API.  If I just update the imports to bring
> in the new API I get the error “The method url(String) is undefined for the
> type TaskOptions.Builder”.  I  have provide some example of my code below,
> if anyone else has converted can you give me some guidance on what I am
> doing wrong?
>
>
>
> Current code, using the Labs API:
> *import* *com.google.appengine.api.labs.taskqueue.Queue*;
> *import* *com.google.appengine.api.labs.taskqueue.QueueFactory*;
> *import* *com.google.appengine.api.labs.taskqueue.TaskOptions*;
> *import* *com.google.appengine.api.labs.taskqueue.TaskOptions.Method*;
> *import* *com.google.appengine.api.labs.taskqueue.TaskOptions.Builder*.*;
>
> …
>
> Queue add_queue = QueueFactory.getQueue("add");
> …
>
> for (int i = 1; i < Item_counter; i++) {
>
>
> add_queue.add(TaskOptions.Builder.url("/add?item="+ItemURL[i]).method(Method.GET));
> }
>
>
>
> Code using the non-Labs API
>
> import com.google.appengine.api.taskqueue.Queue;
> import com.google.appengine.api.taskqueue.QueueFactory;
> import com.google.appengine.api.taskqueue.TaskOptions;
> import com.google.appengine.api.taskqueue.TaskOptions.Method;
> import static com.google.appengine.api.taskqueue.TaskOptions.Builder.*;
>
>
>
> TaskOptions TOdefault =
> com.google.appengine.api.taskqueue.TaskOptions.Builder.withDefaults();
>
> …
>
> for (int i = 1; i < Item_counter; i++) {
>
> TaskOptions TO = new TaskOptions(TOdefault);
> TO.url("/add");
> TO.param("item", itemURL[i]);
> TO.method(Method.GET);
> add_queue.add(TO);
> }
>
>
> The new code compiles and will “run”, but I get all kinds of null pointer
> exceptions from the tasks when they try to run.  If I switch back to the
> labs API it works perfectly.  Can anyone help me understand what I need to
> do to either get my original code to work with the new API and/or what I did
> incorrectly with the updated code?
>
>
> Thanks,
> Doug
>
>  --
> 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] Unindexed properties with JDO ?

2011-01-27 Thread Fabrizio Accatino
Using the datastore low-level API I can set a property to "no indexed".
 Entity.setUnindexedProperty();
http://code.google.com/appengine/docs/java/datastore/queries.html

Is there a way to get the same behaviour using JDO?
I'd like to reduce the space used by indexes automatically created on the
properties.

Fabrizio

-- 
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] Get execution duration of an asynchronous urlfetch

2011-01-29 Thread Fabrizio Accatino
Hello,

I'm playing with async urlfetch. My ispiration was Ikai at
http://ikaisays.com/2010/06/29/using-asynchronous-urlfetch-on-java-app-engine/

I run some request in parallel. All works fine. But now I'd like to get info
about execution time of each request. The target URLs I call are different
so the response time are very different.
I read the documentation but HTTPResponse does not expose a "execution
duration" or similar value.

Any idea?


Fabrizio

-- 
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: Get execution duration of an asynchronous urlfetch

2011-01-30 Thread Fabrizio Accatino
Didier,

your idea is good but can/want execute activity on a task. I need simple
approach: run X async urlfetch, wait for end of execution and store
execution time of each fetch.

I've opened a feature request on the issue tracker:
http://code.google.com/p/googleappengine/issues/detail?id=4476


   Fabrizio


On Sun, Jan 30, 2011 at 8:28 AM, Didier Durand wrote:

> Hi,
>
> You're right: async url fetch doesn't seem to provide any way to
> measure fetch time.
>
> Then, I have a proposal: why don't you schedule a task per fetch, this
> task will then do a regular synchronous url fetch for which measuring
> will be easy.
>
> So, your original servlet / task will schedule as many tasks as you
> have fetches and wait via a loop of Thread.sleep() until all fetches
> are done and their results (incl fetch time) written somewhere
> (datastore / memcache) that the original servlet / task can access to
> complete the work.
>
> The only question though: can the application afford to launch those
> tasks as they will incurr some overhead : some tenths of milliseconds
> of cpu to schedule a task and run it + cpu time to write result to
> cacche or ds in order to be shareable with originator.
>
> If not acceptable, I hope it will at least give you some other ideas
> to follow
>
> regards
>
> didier
>
> On Jan 29, 9:50 am, Fabrizio Accatino  wrote:
> > Hello,
> >
> > I'm playing with async urlfetch. My ispiration was Ikai athttp://
> ikaisays.com/2010/06/29/using-asynchronous-urlfetch-on-java-ap...
> >
> > I run some request in parallel. All works fine. But now I'd like to get
> info
> > about execution time of each request. The target URLs I call are
> different
> > so the response time are very different.
> > I read the documentation but HTTPResponse does not expose a "execution
> > duration" or similar value.
> >
> > Any idea?
> >
> > Fabrizio
>
> --
> 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.



Re: [appengine-java] How to prevent google bot

2011-02-01 Thread Fabrizio Accatino
robot.txt ?


On Tue, Feb 1, 2011 at 2:16 PM, midi  wrote:

> How can I prevent google bot from accessing a java based appspot
> app ?.
>

-- 
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] Google Voice + App Engine (Java)

2011-02-02 Thread Fabrizio Accatino
I think your lib uses not whitelisted java API or blocked java API
   java.security.AccessControlException: access denied
(java.lang.RuntimePermission
setFactory)


Following your stacktrace the problem comes from
java.net.HttpURLConnection.setFollowRedirect
The method is called by
com.techventus.server.voice.Voice.get(Voice.java:1144)
I searched using Google... is this your lib?
http://code.google.com/p/google-voice-java  ?

If yes, download the latest source code and compile it. The latest version
of Voice.java does not contain the call to
java.net.HttpURLConnection.setFollowRedirect.
It was replaced some revisions ago.
http://code.google.com/p/google-voice-java/source/diff?spec=svn137&old=115&r=135&format=side&path=/trunk/src/com/techventus/server/voice/Voice.java
http://code.google.com/p/google-voice-java/source/browse/trunk/src/com/techventus/server/voice/Voice.java

The jar in the download area was not updated. So you need to download the
source code and compile it by yourself.


   Fabrizio




On Wed, Feb 2, 2011 at 5:34 PM, lovegoogle  wrote:

> Hello All,
>
> I tried using google voice within App Engine and it fails to execute
> because of the custom Security Manager that App Engine uses.
> From the stack trace, it looks like it is failing during the Http
> Connection it needs to make to send SMS.
> My goal is to use SMS feature within my application.
>
> I tried running the same code outside of App Engine runtime, using
> just my JDK as a console app and it works fine.
> The restriction is imposed by App Engine.
>
> Is there any way to get around it or Google Voice is a no no within
> App Engine.
> I would assume that Google Voice is a trusted code since its part of
> google APIs.
>
> Any pointers will really help me...Thanks.
>
> Sinu
>
> Here is the code
> -
>try
>{
>log.info("going to log in");
>Voice voice = new Voice(email, password);
>log.info("logged in");
>voice.sendSMS(phonenum, message);
>log.info("sms sent");
>return true;
>}
>catch(Exception e)
>{
>e.printStackTrace();
>return false;
>}
> -
>
>
> Here is the stack trace..
>
> -
> going to log in
> https://www.google.com/accounts/ClientLogin - OK
> Logged in to Google - Auth token received
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission setFactory)
>at
>
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:
> 323)
>at
> java.security.AccessController.checkPermission(AccessController.java:
> 546)
>at java.lang.SecurityManager.checkPermission(SecurityManager.java:
> 532)
>at com.google.appengine.tools.development.DevAppServerFactory
> $CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
>at java.lang.SecurityManager.checkSetFactory(SecurityManager.java:
> 1612)
>at
> java.net.HttpURLConnection.setFollowRedirects(HttpURLConnection.java:
> 249)
>at com.techventus.server.voice.Voice.get(Voice.java:1144)
>at com.techventus.server.voice.Voice.getGeneral(Voice.java:361)
>at com.techventus.server.voice.Voice.init(Voice.java:262)
>at com.techventus.server.voice.Voice.(Voice.java:211)
>at
> com.sinusekhar.cloudapps.zumba.dao.MobileDAO.sendSMS(MobileDAO.java:
> 15)
>at org.apache.jsp.zumba.jsp.play_jsp._jspService(play_jsp.java:64)
>at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
> 377)
>at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
> 313)
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>at
> com.google.appengine.tools.development.PrivilegedJspServlet.access
> $101(PrivilegedJspServlet.java:23)
>at com.google.appengine.tools.development.PrivilegedJspServlet
> $2.run(PrivilegedJspServlet.java:59)
>at java.security.AccessController.doPrivileged(Native Method)
>at
>
> com.google.appengine.tools.development.PrivilegedJspServl

[appengine-java] UrlFecth: random java.io.IOException: Could not fetch URL: http://...myurl...

2011-02-02 Thread Fabrizio Accatino
I have a recurring task that get content from various urls on different
hosts.
On some urls I get random IOException:
  java.io.IOException: Could not fetch URL: http://...myurl...

On one url the failure rate is about 1 / 10.  But it's not regular.
On another url the rate is lower:  1/100.
Other urls work without errors.


The errors are not timeout-related. When UrlFetch encounters a timeout it
throws an exception with a different message:
  java.io.IOException: Timeout while fetching: http://...myurl...


Suggestions?


Fabrizio

-- 
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: UrlFecth: random java.io.IOException: Could not fetch URL: http://...myurl...

2011-02-03 Thread Fabrizio Accatino
Didier,

thank you for your feedback but I think the error is not related with
maximum size. Infact the content is not big and I don't get a
ResponseTooLargeExpetion.
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/urlfetch/ResponseTooLargeException.html

   Fabrizio


On Thu, Feb 3, 2011 at 8:31 AM, Didier Durand wrote:

> Hi,
>
> 1 possibility that I see: you fetch a page with a variable length (i.e
> dynamically generated over time: RSS stream, twitter feed, etc...) and
> sometimes the length is over the URL fetch service limit -> exception
>
> See text at end of
> http://code.google.com/appengine/docs/java/urlfetch/overview.html#Responses
>
> regards
>
> didier
>
> On Feb 3, 8:23 am, Fabrizio Accatino  wrote:
> > I have a recurring task that get content from various urls on different
> > hosts.
> > On some urls I get random IOException:
> >   java.io.IOException: Could not fetch URL:http://...myurl...
> >
> > On one url the failure rate is about 1 / 10.  But it's not regular.
> > On another url the rate is lower:  1/100.
> > Other urls work without errors.
> >
> > The errors are not timeout-related. When UrlFetch encounters a timeout it
> > throws an exception with a different message:
> >   java.io.IOException: Timeout while fetching:http://...myurl...
> >
> > Suggestions?
> >
> > Fabrizio
>
> --
> 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] Feature request: UrlFetch java : differenciate IOException causes

2011-02-03 Thread Fabrizio Accatino
http://code.google.com/p/googleappengine/issues/detail?id=4502

-- 
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] Problem Authenticating against App Engine

2011-02-05 Thread Fabrizio Accatino
Perhaps your authentication token was expired.

In the android app, call .invalidateAuthToken(account.type, authToken)
on AccountManager class.
This releases the current authentication token. Then call again getAuthToken
to obtain a new and fresh authentication token.

A note: AFAIK Android uses ClientLogin and not OAuth.
http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html


   Fabrizio


On Fri, Feb 4, 2011 at 11:57 PM, Sky wrote:

> Hi all,
>
> I am using the oauth authentication process to authenticate Android to
> App Engine described in Nick's blog:
>
> http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app
>
> This worked fine until today. Today the authentication on app engine
> fails -> boolean authenticated = userServiceManager.isUserLoggedIn();
> returns always false.
>
> Is anyone out there using the same authentication process and has the
> same problem?
> Are there any changes concerning the URL the cookie is fetched?
> HttpGet http_get = new HttpGet("https://yourapp.appspot.com/_ah/login?
> continue=http://localhost/&auth=<https://yourapp.appspot.com/_ah/login?continue=http://localhost/&auth=>"
> + tokens[0]);
>
>
> 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-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.



Re: [appengine-java] Re: Problem Authenticating against App Engine

2011-02-06 Thread Fabrizio Accatino
The Nick's way is the good way.

My note was about "OAuth". Afaik Android AccountManager class uses
ClientLogin for authentication on App Engine.

Fabrizio


On Sun, Feb 6, 2011 at 5:03 PM, Sky wrote:

> thanks for the answer. I will try it, as soon as my new mobile sim
> card has been activated ;). In the 2.3 emulator it worked with another
> account...
>
> ClientLogin: I did not find any sample code. The best documented way I
> found was Nick's blog. Maybe Google should provide some Tutorials/libs
> with sample code, that demonstrates the "perfect way" to authenticate
> an Android app with app engine using Google accounts...
>
>

-- 
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: Problem Authenticating against App Engine

2011-02-06 Thread Fabrizio Accatino
I follow another way:
 1 - get auth token from AccountManager
 2 - try to get the auth Cookie from AppEngine
 3 - if step 2 fails, I invalidate the Auth token and restart from step 1.

My very alpha code is here:
http://fhtino.blogspot.com/2011/02/connet-android-app-to-google-app-engine.html


   Fabrizio


On Sun, Feb 6, 2011 at 8:12 PM, Sky wrote:

> One more question concerning the invalidation of the AuthToken. I read
> that it invalidates after 24h. What is when the Activity, holding the
> AuthToken (in NicksBlog the AppInfo class), ends (with finish() and
> onDestroy) and started again? In my opinion a new valid AuthToken is
> fetched every time the Appinfo class gets started.
> In this case, why do I have to invalidate the old AuthToken?
>
>
>
> On 6 Feb., 19:46, Sky  wrote:
> > thanks for the clarification!
> >
> > On 6 Feb., 17:16, Fabrizio Accatino  wrote:
> >
> > > The Nick's way is the good way.
> >
> > > My note was about "OAuth". Afaik Android AccountManager class uses
> > > ClientLogin for authentication on App Engine.
> >
> > > Fabrizio
> >
> > > On Sun, Feb 6, 2011 at 5:03 PM, Sky  >wrote:
> >
> > > > thanks for the answer. I will try it, as soon as my new mobile sim
> > > > card has been activated ;). In the 2.3 emulator it worked with
> another
> > > > account...
> >
> > > > ClientLogin: I did not find any sample code. The best documented way
> I
> > > > found was Nick's blog. Maybe Google should provide some
> Tutorials/libs
> > > > with sample code, that demonstrates the "perfect way" to authenticate
> > > > an Android app with app engine using Google accounts...
> >
> >
>
> --
> 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.



Re: [appengine-java] urlfetcher bug, weird content retrieved.

2011-02-12 Thread Fabrizio Accatino
Afaik UrlFetch uses an internal cache.

Note the two different heders in you logs:
  x-google-cache-control=[remote-cache-hit]
  x-google-cache-control=[remote-fetch]

To force a fresh urlfetch everytime, add these headers in you request.

connection.addRequestProperty("Cache-Control", "no-cache,max-age=0");
connection.addRequestProperty("Pragma", "no-cache");


   Fabrizio


On Sat, Feb 12, 2011 at 12:08 PM, aka1g  wrote:

> Hi!
> I'm fetching webpages and parse them. I have a weird behavior that
> looks like GAE bug.
> One of the pages retrieved has a totally different content.
> I'm getting
> http://www.gamer-district.com/modules/mod_realmcore/mod_realmcore.php
> page, and most of the time it is retrieved incorrectly.
> It can be that some stale/cathed version is returned.
> I am logging http headers and page content.This only happens for this
> particular url.
>

-- 
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] only allowing local connections to dev server?

2011-04-10 Thread Fabrizio Accatino
I use rinetd. It's a port forwarder.
http://www.boutell.com/rinetd/

fabrizio (from android)
Il giorno 10/apr/2011 19.57, "Luis Montes"  ha scritto:
> When running a java webapp in eclipse it seems that I can only connect to
> the dev jetty instance from the localhost. Is jetty fired up only bound to
> 127.0.0.1?
>
> I have some mobile wifi devices (android, ipad, etc.) that I'd like to
test
> with on the LAN but it seems that I'm going to have do some tunneling or
> proxying to get things to work.
>
> I can't find a way to configure networking in the sdk. Is
> 127.0.0.1:hardcoded somewhere?
>
>
> Luis
>
> --
> 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.



Re: [appengine-java] only allowing local connections to dev server?

2011-04-11 Thread Fabrizio Accatino
Perhaps a better solution:
use the --address paramater
http://code.google.com/appengine/docs/java/tools/devserver.html#Command_Line_Arguments
<http://code.google.com/appengine/docs/java/tools/devserver.html#Command_Line_Arguments>
  fabrizio

On Mon, Apr 11, 2011 at 7:56 AM, Fabrizio Accatino  wrote:

> I use rinetd. It's a port forwarder.
> http://www.boutell.com/rinetd/
>
> fabrizio (from android)
> Il giorno 10/apr/2011 19.57, "Luis Montes"  ha
> scritto:
>
> > When running a java webapp in eclipse it seems that I can only connect to
> > the dev jetty instance from the localhost. Is jetty fired up only bound
> to
> > 127.0.0.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-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] User service - getCurrentUser always returns null

2011-04-12 Thread Fabrizio Accatino
Have you activated Security & Authentication in the web.xml?

http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication


<http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication>
  fabrizio

On Wed, Apr 13, 2011 at 7:44 AM, Peter  wrote:

> Folks,
>
> I am a bit confused on how to use user services correctly.
>
> Here is the relevant code snippet:
>
> public class GreetingServiceImple extends RemoteServiceServlet implements
> GreetingService {
>
>public string greetServer() {
> UserService us = UserServiceFactory.getUserService();
> User user = us.getCurrentUser();
> ...
>}
> }
>
> The problem is, the value returned by getCurrentUser is always null,
> irrespective of whether I deploy locally or at appspot.
>
> I am using Firefox as the client. I have two tabs open. On one tab, I am
> signed into Google mail using my gmail account. On the other tab, I am
> trying to run the app that I am working on.
>
> What is it that I am missing?
>
> Thank you in advance for your help.
>
> Regards,
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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.



Re: [appengine-java] Federated ID versus User ID

2011-04-12 Thread Fabrizio Accatino
getUserID


I see that User class has two methods to obtain id information,
> getFederatedIdentity() and getUserId(). Which of these two can be used as
> the primary key for storing per-user information.
>

-- 
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] Federated ID versus User ID

2011-04-14 Thread Fabrizio Accatino
Peter,

I use it as the primary key of my entity. No problem.

   fabrizio

PS: please, do not double post on the mailing list.


On Thu, Apr 14, 2011 at 2:09 AM, Peter  wrote:

> Fabrizio,
>
> Thank you for your help.
>
> Once I get the user id, do I still need to run it through createKey or can
> I directly use the ID as the primary key?
>
> User user = userservice.getCurrentUser();
> String id = user.getUserId();
> Key userIdKey = KeyFactory.createKey("Users", id);
> Entity eUser = new Entity("Users", userIdKey);
>
> Appreciate your help.
>
> Regards,
> Peter
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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.



Re: [appengine-java] Re: Failing tasks getting duplicated

2011-04-17 Thread Fabrizio Accatino
"*If a task fails to execute* (by returning any HTTP status code outside of
the range *200-299*), App Engine retries *until it succeeds*."
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Task_Execution

So, if you need to run you tasks once, ensure you will return always http
200. The simpler way: put a try-catch in your servlet entry point and catch
all exceptions. A quite brutal but it works.

   fabrizio


On Sun, Apr 17, 2011 at 8:34 AM, nischalshetty wrote:

> Pretty weird. Let's hope someone from the GAE team peeps into this thread.
> I have thousands of tasks being generated every minute and there are errors
> when they are executed. I'm hoping they don't get "duplicated". There's no
> way for me to know so if what you say is true then it's trouble for a lot of
> us.

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