[appengine-java] gclid requests
Hello, I am getting too many gclid requests in my application. What can be done to turn off these requests. Is these requests good or bad. What is the purpose of these requests in my appengine application. Regards -aswath 1. 11-08 02:39AM 07.207 /?gclid=CIqzlt6DkaUCFUV76wodemQlMg 200 3544ms 2450cpu_ms 2kb Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.6),gzip(gfe) See detailshttps://appengine.google.com/logs/log_detail?app_id=vs-accountingversion_id=4.345935050928733072request_id=000494883C0C6966.973BF2A6layout=plain 59.184.147.20 - - [08/Nov/2010:02:39:10 -0800] GET /?gclid=CIqzlt6DkaUCFUV76wodemQlMg HTTP/1.1 200 2147 http://www.softonoc.com/?epl=TCmB14Mz7zrGt9tpFheLJECOza4IJBROkdzF3-j91bzAKCCZ6puL7CZqwWKiDCEYhLocpCHAO8juxjLDtQeZV7NKsfIx5CoHrzUS-xKlGSE8CQKZOgqLhJAYfLnRzfqAPbpZVIjaNsGNgdEsh1CDakMgkc8isY58wKVIv0GEZsEtSfVA_BFeXTWo4PApsCnduKTvwcuAHjvWSwLSADRwIyN7VY4J5PrQQiaykuG8Sc1FaSQyx14L7bgvYL2HIYGurNLVH3r6iaWVtwzHcPIERs8xbYmhidE0IpOmEdNTDQBoAGhqmtpoU6EhzSiPJkTzJDIxEWnrADCg3v-_AADgfwEAAECA2xcAADk2uyJZUyZZQTE2aFpCRgEAAPAquery=accounting%20software; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.6),gzip(gfe) vs-accounting.appspot.com ms=3545 cpu_ms=2450 api_cpu_ms=0 cpm_usd=0.068359 loading_request=1 -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Two apps hitting the same datastore
Hi Eyal, deploying a gui-less is the same thing as deploying any other gaej appl (gwt, etc.) Then, you can schedule regular jobs via cron: see http://code.google.com/appengine/docs/java/config/cron.html regards didier On Nov 8, 9:16 am, Eyal twoworldsf...@gmail.com wrote: Thank you Robert, and Starman. The thing is, the application that does the daily updates can't be a web application, at least not through GWT, because it needs to get a feed from Analytics, and it takes too long so that GWT throws a timeout exception. Is there a way to deploy a simple, GUI-less Java application, using App Engine's JDO to hit a datastore? And then set up a cron job, or anything like it? Thanks, Eyal On Nov 8, 1:18 am, Starman r...@arrova.ca wrote: As you know, you can deploy many versions of an app for the same app id. There is nothing that says it has to be the same app. Just deploy another app that does your weekly updates using another version string. Each version, even though it may not be the default one, gets its own url. You just need to trigger it one a week thereafter. On Nov 7, 5:23 pm, Eyal twoworldsf...@gmail.com wrote: Hi all, I need to have two separate applications hitting the same datastore. One updates it daily, and the other (app engine and GWT) reading from it on a regular basis. How is this done? Is there a way in the API to specify a specific datastore? Thanks, Eyal -- You received this message 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: No API environment is registered for this thread
Hi Eyal, Where do you run your application when getting this exception: on your dev env or on the google infrastructure ? regards didier On Nov 8, 8:44 am, Eyal twoworldsf...@gmail.com wrote: Thank you lp, and Didier. Actually this application will need to run in production, and not only in testing. I need to be able to update the application's datastore with a feed from Analytics. When I create a very simple GUI for it using GWT (basically just a submit button,) I get a timeout exception because the Analytics server takes too long to respond (it seems to be unsolvable at this point.) So I thought I'll just run it as a simple Java application -- and than I don't have the timeout problem and the Analytics feed works beautifully. But then -- this problem. When I create objects from the Analytics feed, and try to insert them into the datastore, I get the exception above. What am I missing? You help is greatly appreciated! Eyal On Nov 8, 6:21 am, Didier Durand durand.did...@gmail.com wrote: Hi, This comes when you are trying to run code within Eclipse without having starting properly the local runtime of App Engine: seehttp://code.google.com/appengine/docs/java/tools/localunittesting.html (parag Datastore tests) I can also supply my Junit init code when needed regards didier On Nov 7, 5:45 pm, Eyal twoworldsf...@gmail.com wrote: Hi all, I'm trying to use JDO in an app engine application on Eclipse. When I use a web interface I'm able to make it work just fine. But I need to be able to run it as a java application and when I try I get the following exception: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(Datas toreApiHelper.java: 108) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamesp ace(DatastoreApiHelper.java: 118) at com.google.appengine.api.datastore.Query.init(Query.java:87) at org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuer y.java: 649) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(Datasto reQuery.java: 215) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery. java: 89) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) at com.eyes.manager.UpdateManager.main(UpdateManager.java:39) This is my jdeoconfig.xml, which is generated by the Eclipse plugin: ?xml version=1.0 encoding=utf-8? jdoconfig xmlns=http://java.sun.com/xml/ns/jdo/jdoconfig; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=http://java.sun.com/xml/ns/jdo/ jdoconfig persistence-manager-factory name=transactions-optional property name=javax.jdo.PersistenceManagerFactoryClass value=org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFa ctory/ property name=javax.jdo.option.ConnectionURL value=appengine/ property name=javax.jdo.option.NontransactionalRead value=true/ property name=javax.jdo.option.NontransactionalWrite value=true/ property name=javax.jdo.option.RetainValues value=true/ property name=datanucleus.appengine.autoCreateDatastoreTxns value=true/ /persistence-manager-factory /jdoconfig Any idea how can I solve this? How do I register the API Environment? Thanks! Eyal -- You received this message 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: No API environment is registered for this thread
On my dev, when running As A Java Application. If I try to run it as a Web Application I get a Timeout exception, because the Analytics feed takes too long to respond... Thanks for looking into this, Didier! Eyal On Nov 8, 1:55 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Where do you run your application when getting this exception: on your dev env or on the google infrastructure ? regards didier On Nov 8, 8:44 am, Eyal twoworldsf...@gmail.com wrote: Thank you lp, and Didier. Actually this application will need to run in production, and not only in testing. I need to be able to update the application's datastore with a feed from Analytics. When I create a very simple GUI for it using GWT (basically just a submit button,) I get a timeout exception because the Analytics server takes too long to respond (it seems to be unsolvable at this point.) So I thought I'll just run it as a simple Java application -- and than I don't have the timeout problem and the Analytics feed works beautifully. But then -- this problem. When I create objects from the Analytics feed, and try to insert them into the datastore, I get the exception above. What am I missing? You help is greatly appreciated! Eyal On Nov 8, 6:21 am, Didier Durand durand.did...@gmail.com wrote: Hi, This comes when you are trying to run code within Eclipse without having starting properly the local runtime of App Engine: seehttp://code.google.com/appengine/docs/java/tools/localunittesting.html (parag Datastore tests) I can also supply my Junit init code when needed regards didier On Nov 7, 5:45 pm, Eyal twoworldsf...@gmail.com wrote: Hi all, I'm trying to use JDO in an app engine application on Eclipse. When I use a web interface I'm able to make it work just fine. But I need to be able to run it as a java application and when I try I get the following exception: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(Datas toreApiHelper.java: 108) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamesp ace(DatastoreApiHelper.java: 118) at com.google.appengine.api.datastore.Query.init(Query.java:87) at org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuer y.java: 649) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(Datasto reQuery.java: 215) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery. java: 89) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) at com.eyes.manager.UpdateManager.main(UpdateManager.java:39) This is my jdeoconfig.xml, which is generated by the Eclipse plugin: ?xml version=1.0 encoding=utf-8? jdoconfig xmlns=http://java.sun.com/xml/ns/jdo/jdoconfig; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=http://java.sun.com/xml/ns/jdo/ jdoconfig persistence-manager-factory name=transactions-optional property name=javax.jdo.PersistenceManagerFactoryClass value=org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFa ctory/ property name=javax.jdo.option.ConnectionURL value=appengine/ property name=javax.jdo.option.NontransactionalRead value=true/ property name=javax.jdo.option.NontransactionalWrite value=true/ property name=javax.jdo.option.RetainValues value=true/ property name=datanucleus.appengine.autoCreateDatastoreTxns value=true/ /persistence-manager-factory /jdoconfig Any idea how can I solve this? How do I register the API Environment? Thanks! Eyal -- You received this message 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] Timeout while fetching URLFetch
I'm using the XMLReader to read a feed like below. URLConnection urlConnection = url.openConnection(); XmlReader reader = new XmlReader(urlConnection); When this is called I receive within 5 seconds an IOException Timeout while fetching I also tried to set the timeouts but still no luck. urlConnection.setReadTimeout(1); urlConnection.setConnectTimeout(1); Seems to be the size of the feed to read. When I call a smaller feed it works properly. Is there any workaround or solution? -- You received this message 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: Timeout while fetching URLFetch
Also see my similar question from a few days ago: http://goo.gl/d3T2d On Nov 8, 4:41 am, bengroot87 b...@dutchtape.com wrote: I'm using the XMLReader to read a feed like below. URLConnection urlConnection = url.openConnection(); XmlReader reader = new XmlReader(urlConnection); When this is called I receive within 5 seconds an IOException Timeout while fetching I also tried to set the timeouts but still no luck. urlConnection.setReadTimeout(1); urlConnection.setConnectTimeout(1); Seems to be the size of the feed to read. When I call a smaller feed it works properly. Is there any workaround or solution? -- You received this message 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: No API environment is registered for this thread
Eyal, Now it's clear = you MUST run the application as a Web Application to be able to activate the App Engine environment with the Datastore that you need for JDO. Then you MUST activate the local dev env for App Engine on your machine : see my previous answer with the link. If you don't do both actions above, it can not work as you wish. regards didier On Nov 8, 1:39 pm, Eyal twoworldsf...@gmail.com wrote: On my dev, when running As A Java Application. If I try to run it as a Web Application I get a Timeout exception, because the Analytics feed takes too long to respond... Thanks for looking into this, Didier! Eyal On Nov 8, 1:55 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Where do you run your application when getting this exception: on your dev env or on the google infrastructure ? regards didier On Nov 8, 8:44 am, Eyal twoworldsf...@gmail.com wrote: Thank you lp, and Didier. Actually this application will need to run in production, and not only in testing. I need to be able to update the application's datastore with a feed from Analytics. When I create a very simple GUI for it using GWT (basically just a submit button,) I get a timeout exception because the Analytics server takes too long to respond (it seems to be unsolvable at this point.) So I thought I'll just run it as a simple Java application -- and than I don't have the timeout problem and the Analytics feed works beautifully. But then -- this problem. When I create objects from the Analytics feed, and try to insert them into the datastore, I get the exception above. What am I missing? You help is greatly appreciated! Eyal On Nov 8, 6:21 am, Didier Durand durand.did...@gmail.com wrote: Hi, This comes when you are trying to run code within Eclipse without having starting properly the local runtime of App Engine: seehttp://code.google.com/appengine/docs/java/tools/localunittesting.html (parag Datastore tests) I can also supply my Junit init code when needed regards didier On Nov 7, 5:45 pm, Eyal twoworldsf...@gmail.com wrote: Hi all, I'm trying to use JDO in an app engine application on Eclipse. When I use a web interface I'm able to make it work just fine. But I need to be able to run it as a java application and when I try I get the following exception: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(Datas toreApiHelper.java: 108) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamesp ace(DatastoreApiHelper.java: 118) at com.google.appengine.api.datastore.Query.init(Query.java:87) at org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuer y.java: 649) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(Datasto reQuery.java: 215) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery. java: 89) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) at com.eyes.manager.UpdateManager.main(UpdateManager.java:39) This is my jdeoconfig.xml, which is generated by the Eclipse plugin: ?xml version=1.0 encoding=utf-8? jdoconfig xmlns=http://java.sun.com/xml/ns/jdo/jdoconfig; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=http://java.sun.com/xml/ns/jdo/ jdoconfig persistence-manager-factory name=transactions-optional property name=javax.jdo.PersistenceManagerFactoryClass value=org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFa ctory/ property name=javax.jdo.option.ConnectionURL value=appengine/ property name=javax.jdo.option.NontransactionalRead value=true/ property name=javax.jdo.option.NontransactionalWrite value=true/ property name=javax.jdo.option.RetainValues value=true/ property name=datanucleus.appengine.autoCreateDatastoreTxns value=true/ /persistence-manager-factory /jdoconfig Any idea how can I solve this? How do I register the API Environment? Thanks! Eyal -- You received this message 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
[appengine-java] Re: No API environment is registered for this thread
Hi Didier, Thanks for your reply. Here's the problem, though: when I run it as a web application I'm getting a timeout error. I've already posted this issue on the Analytics dev group at (http://groups.google.com/group/ google-analytics-data-export-api/browse_thread/thread/ 3f9956a25d718b59) but so far no one responded. Do you have experience integrating analytics into app engine? I'm sure it can be done but I've been trying to get it to work for 2 days now with absolutely no progress. If you, or anyone can help me out I'm sure my company will be willing to pay for this service. Thanks, Eyal On Nov 8, 5:17 pm, Didier Durand durand.did...@gmail.com wrote: Eyal, Now it's clear = you MUST run the application as a Web Application to be able to activate the App Engine environment with the Datastore that you need for JDO. Then you MUST activate the local dev env for App Engine on your machine : see my previous answer with the link. If you don't do both actions above, it can not work as you wish. regards didier On Nov 8, 1:39 pm, Eyal twoworldsf...@gmail.com wrote: On my dev, when running As A Java Application. If I try to run it as a Web Application I get a Timeout exception, because the Analytics feed takes too long to respond... Thanks for looking into this, Didier! Eyal On Nov 8, 1:55 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Where do you run your application when getting this exception: on your dev env or on the google infrastructure ? regards didier On Nov 8, 8:44 am, Eyal twoworldsf...@gmail.com wrote: Thank you lp, and Didier. Actually this application will need to run in production, and not only in testing. I need to be able to update the application's datastore with a feed from Analytics. When I create a very simple GUI for it using GWT (basically just a submit button,) I get a timeout exception because the Analytics server takes too long to respond (it seems to be unsolvable at this point.) So I thought I'll just run it as a simple Java application -- and than I don't have the timeout problem and the Analytics feed works beautifully. But then -- this problem. When I create objects from the Analytics feed, and try to insert them into the datastore, I get the exception above. What am I missing? You help is greatly appreciated! Eyal On Nov 8, 6:21 am, Didier Durand durand.did...@gmail.com wrote: Hi, This comes when you are trying to run code within Eclipse without having starting properly the local runtime of App Engine: seehttp://code.google.com/appengine/docs/java/tools/localunittesting.html (parag Datastore tests) I can also supply my Junit init code when needed regards didier On Nov 7, 5:45 pm, Eyal twoworldsf...@gmail.com wrote: Hi all, I'm trying to use JDO in an app engine application on Eclipse. When I use a web interface I'm able to make it work just fine. But I need to be able to run it as a java application and when I try I get the following exception: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(Datas toreApiHelper.java: 108) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamesp ace(DatastoreApiHelper.java: 118) at com.google.appengine.api.datastore.Query.init(Query.java:87) at org.datanucleus.store.appengine.query.DatastoreQuery.validate(DatastoreQuer y.java: 649) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(Datasto reQuery.java: 215) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery. java: 89) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) at com.eyes.manager.UpdateManager.main(UpdateManager.java:39) This is my jdeoconfig.xml, which is generated by the Eclipse plugin: ?xml version=1.0 encoding=utf-8? jdoconfig xmlns=http://java.sun.com/xml/ns/jdo/jdoconfig; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=http://java.sun.com/xml/ns/jdo/ jdoconfig persistence-manager-factory name=transactions-optional property name=javax.jdo.PersistenceManagerFactoryClass value=org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFa ctory/
[appengine-java] Re: No API environment is registered for this thread
Hi Didier, Sure, here is an example method: public SiteBasicData getSiteBasicData(AnalyticsService as, Site site, DateTime date) { SiteBasicData sd = new SiteBasicData(); as.setConnectTimeout(1); as.setReadTimeout(1); DataFeed dataFeed = null; try { DataQuery query = new DataQuery(new URL(https://www.google.com/ analytics/feeds/data)); DateTimeFormatter fmt = DateTimeFormat.forPattern(-MM- dd); query.setStartDate(date.toString(fmt)); query.setEndDate(date.toString(fmt)); query.setMetrics(ga:visitors,ga:visits,ga:pageviews,ga:newVisits,ga:bounces,ga:timeOnSite); query.setMaxResults(50); query.setIds(site.getTableID()); dataFeed = as.getFeed(query.getUrl(), DataFeed.class); DataEntry entry = dataFeed.getEntries().get(0); DecimalFormat dfDouble = new DecimalFormat(.##); DecimalFormat dfZero = new DecimalFormat(#); int visits = Integer.parseInt(entry.stringValueOf(ga:visits)); int uniques = Integer.parseInt(entry.stringValueOf(ga:visitors)); int newVisits = Integer.parseInt(entry.stringValueOf(ga:newVisits)); int pageViews = Integer.parseInt(entry.stringValueOf(ga:pageviews)); int bounces = Integer.parseInt(entry.stringValueOf(ga:bounces)); int timeOnSite = Integer.parseInt(entry.stringValueOf(ga:timeOnSite)); sd.setSite(site); sd.setDate(date); sd.setVisitors(visits); sd.setUniqueVisitors(uniques); sd.setNewVisits(newVisits); sd.setReturningVisits(visits-newVisits); sd.setPageViews(pageViews); sd.setUniquePageViews(getUniquePageViews(as, site, date)); sd.setBounces(bounces); sd.setTimeOnSite(timeOnSite); } catch(Exception e) { e.printStackTrace(); } return sd; } Then I do the simple JDO to persist the sd object. But it doesn't even get there because I get the Timeout while fetching exception. Thanks! Eyal On Nov 8, 6:33 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Can you detail (i.e post code samples) on what you do with Analytics (I need to be able to update the application's datastore with a feed from Analytics.) and how you want to do it. It's too vague as of now. regards didier On Nov 8, 4:41 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Thanks for your reply. Here's the problem, though: when I run it as a web application I'm getting a timeout error. I've already posted this issue on the Analytics dev group at (http://groups.google.com/group/ google-analytics-data-export-api/browse_thread/thread/ 3f9956a25d718b59) but so far no one responded. Do you have experience integrating analytics into app engine? I'm sure it can be done but I've been trying to get it to work for 2 days now with absolutely no progress. If you, or anyone can help me out I'm sure my company will be willing to pay for this service. Thanks, Eyal On Nov 8, 5:17 pm, Didier Durand durand.did...@gmail.com wrote: Eyal, Now it's clear = you MUST run the application as a Web Application to be able to activate the App Engine environment with the Datastore that you need for JDO. Then you MUST activate the local dev env for App Engine on your machine : see my previous answer with the link. If you don't do both actions above, it can not work as you wish. regards didier On Nov 8, 1:39 pm, Eyal twoworldsf...@gmail.com wrote: On my dev, when running As A Java Application. If I try to run it as a Web Application I get a Timeout exception, because the Analytics feed takes too long to respond... Thanks for looking into this, Didier! Eyal On Nov 8, 1:55 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Where do you run your application when getting this exception: on your dev env or on the google infrastructure ? regards didier On Nov 8, 8:44 am, Eyal twoworldsf...@gmail.com wrote: Thank you lp, and Didier. Actually this application will need to run in production, and not only in testing. I need to be able to update the application's datastore with a feed from Analytics. When I create a very simple GUI for it using GWT (basically just a submit button,) I get a timeout exception because the Analytics server takes too long to respond (it seems to be unsolvable at this point.) So I thought I'll just run it as a simple Java application -- and than I don't have the timeout problem and the Analytics feed works beautifully.
[appengine-java] Re: No API environment is registered for this thread
Just to complete the picture here's the initialization of the AnalyticsService: AnalyticsService as = new AnalyticsService(gaExportAPI_acctSample_v1.0); as.setUserCredentials(CLIENT_USERNAME, CLIENT_PASS); Thanks again, Eyal On Nov 8, 7:27 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Sure, here is an example method: public SiteBasicData getSiteBasicData(AnalyticsService as, Site site, DateTime date) { SiteBasicData sd = new SiteBasicData(); as.setConnectTimeout(1); as.setReadTimeout(1); DataFeed dataFeed = null; try { DataQuery query = new DataQuery(new URL(https://www.google.com/ analytics/feeds/data)); DateTimeFormatter fmt = DateTimeFormat.forPattern(-MM- dd); query.setStartDate(date.toString(fmt)); query.setEndDate(date.toString(fmt)); query.setMetrics(ga:visitors,ga:visits,ga:pageviews,ga:newVisits,ga:bounce s,ga:timeOnSite); query.setMaxResults(50); query.setIds(site.getTableID()); dataFeed = as.getFeed(query.getUrl(), DataFeed.class); DataEntry entry = dataFeed.getEntries().get(0); DecimalFormat dfDouble = new DecimalFormat(.##); DecimalFormat dfZero = new DecimalFormat(#); int visits = Integer.parseInt(entry.stringValueOf(ga:visits)); int uniques = Integer.parseInt(entry.stringValueOf(ga:visitors)); int newVisits = Integer.parseInt(entry.stringValueOf(ga:newVisits)); int pageViews = Integer.parseInt(entry.stringValueOf(ga:pageviews)); int bounces = Integer.parseInt(entry.stringValueOf(ga:bounces)); int timeOnSite = Integer.parseInt(entry.stringValueOf(ga:timeOnSite)); sd.setSite(site); sd.setDate(date); sd.setVisitors(visits); sd.setUniqueVisitors(uniques); sd.setNewVisits(newVisits); sd.setReturningVisits(visits-newVisits); sd.setPageViews(pageViews); sd.setUniquePageViews(getUniquePageViews(as, site, date)); sd.setBounces(bounces); sd.setTimeOnSite(timeOnSite); } catch(Exception e) { e.printStackTrace(); } return sd; } Then I do the simple JDO to persist the sd object. But it doesn't even get there because I get the Timeout while fetching exception. Thanks! Eyal On Nov 8, 6:33 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Can you detail (i.e post code samples) on what you do with Analytics (I need to be able to update the application's datastore with a feed from Analytics.) and how you want to do it. It's too vague as of now. regards didier On Nov 8, 4:41 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Thanks for your reply. Here's the problem, though: when I run it as a web application I'm getting a timeout error. I've already posted this issue on the Analytics dev group at (http://groups.google.com/group/ google-analytics-data-export-api/browse_thread/thread/ 3f9956a25d718b59) but so far no one responded. Do you have experience integrating analytics into app engine? I'm sure it can be done but I've been trying to get it to work for 2 days now with absolutely no progress. If you, or anyone can help me out I'm sure my company will be willing to pay for this service. Thanks, Eyal On Nov 8, 5:17 pm, Didier Durand durand.did...@gmail.com wrote: Eyal, Now it's clear = you MUST run the application as a Web Application to be able to activate the App Engine environment with the Datastore that you need for JDO. Then you MUST activate the local dev env for App Engine on your machine : see my previous answer with the link. If you don't do both actions above, it can not work as you wish. regards didier On Nov 8, 1:39 pm, Eyal twoworldsf...@gmail.com wrote: On my dev, when running As A Java Application. If I try to run it as a Web Application I get a Timeout exception, because the Analytics feed takes too long to respond... Thanks for looking into this, Didier! Eyal On Nov 8, 1:55 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Where do you run your application when getting this exception: on your dev env or on the google infrastructure ? regards didier On Nov 8, 8:44 am, Eyal twoworldsf...@gmail.com wrote: Thank you lp, and Didier. Actually this application will need to run in production, and not only in testing. I need to be able to update the application's datastore with a
[appengine-java] The class idv.petrie.prtm.model.Tweet is not persistable.
Sorry. I am just facing this defeat. I just followed the instructions startup page and modified it. I try to google this but cannot find the answer. Any one can help me? pre package idv.petrie.prtm.model; import java.util.Date; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.Inheritance; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.InheritanceStrategy; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key; @PersistenceCapable @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public class GeneticMessage implements Message { @PersistenceCapable public enum Status { NEW, PREPROCESSED } @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private Date modifiedAt; @Persistent private String content; @Persistent(serialized = true) private Status status; public GeneticMessage() { setModifiedAt(); setStatus(Status.NEW); } public Key getKey() { return key; } public void setKey(Key key) { this.key = key; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public void setModifiedAt() { this.modifiedAt = new Date(); } public Date getModifiedAt() { return modifiedAt; } public void setStatus(Status status) { this.status = status; } public Status getStatus() { return status; } } /pre pre package idv.petrie.prtm.model; import java.util.Date; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.Unique; @PersistenceCapable public class Tweet extends GeneticMessage implements Message { @Persistent @Unique private long id; @Persistent private Date createdAt; @Persistent private int fromUserId; public Tweet() { super(); } public Tweet(String content) { this(); setContent(content); } public Date getCreatedAt() { return createdAt; } public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; } public int getFromUserId() { return fromUserId; } public void setFromUserId(int fromUserId) { this.fromUserId = fromUserId; } public void setId(long l) { this.id = l; } public long getId() { return id; } } /pre -- You received this message 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] DTO object
Hi, I am using GAE/JAVA/GWT 2.1 and storage JDO/Datastore GWT 2.1 and the RequestFactory are in use to send DTO objects between client and server. Now, I have a Entity with a property of type com.google.appengine.api.datastore.Email. But I cannot directly use this type on the proxy DTO object, this class is not known on the client. First solution is to pass write wrappers getEmailAsString()/ setEmailAsString() on the Entity and use these properties on the proxy DTO object. But that is not good, i will loose change detection for instance. Obviously, my question is how to pass the complex com.google.appengine.api.datastore.* types on DTO objects ?? Koen -- You received this message 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] about【PreparedQuery.countEntities ()】 problem, how can I get the total count of a specific Q uery?
case 【PreparedQuery.countEntities()】 is Deprecated。 but how can I get the Total Count of a specific Query? the 【PreparedQuery.countEntities(FetchOptions fetchOptions) 】only return the count specificed by fetchOptions! ex. Query query = new Query(Book.getKind()); // there are 3 entities with Book kind in datastore zone PreparedQuery pq = ds.prepare(query); FetchOptions option = FetchOptions.Builder.withLimit(2); out.println(pq.countEntities()); // the count I really want, but the method is Deprecated currently; out.println(pq.countEntities(option));// the count only return 2, but it should return 3 entity in this query; 3ks! -- You received this message 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] Blank Page on Server
Hi, I am using Java SDK for Google App Engine. Using eclipse google plugin for application development. My application works fine in my local machine in eclipse but getting blank page on application server. But I used python for bulkloader. I stuck here badly and not able to proceed. I am not sure how to fix this. Can any one help me in this. Application Engine SDK version 1.3.5. GWT SDK 2.0.4 Thanks regards, Pawan Modi -- You received this message 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] Determine Tenancy Quota
Hi I am writing an application that will allow an undetermined number of clients on the application. Every client's data will be stored using the NameSpace mechanism. There will be a huge difference on the quota usage per client. (A client will be a company and the company will add users to it's profile. The users will log on and send data to the application. Reports can also be requested.) I don't want to ask clients using little quota to subside clients using lots of quota. I want to ask each one what he uses. Is there a way to determine quota usage per NameSpace or would it be better (or allowed) to host a completely seperate application per 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-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] Sync datastore between server and local
You can, but one will need to expose an API to the other applications. Different application IDs cannot access the same datastore. Different deployed versions of the same application can. As far as syncing goes, there's the bulk upload/download tool: http://code.google.com/appengine/docs/python/tools/uploadingdata.html -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Thu, Nov 4, 2010 at 9:15 PM, Thomas Wiradikusuma wiradikus...@gmail.comwrote: Hi, Is there any way to sync data in datastore between server (live) and local (localhost)? I have some test data that I want to make available to both environments. Another question: I'm splitting the web to front-facing webapp and admin panel webapp: web.latest.myapp.appspot.com and admin.latest.myapp.appsot.com. I'm aware that both share the same datastore in the server (live). Can I do that (share same datastore) in local (localhost)? I.e. Can I make two (or more) Java webapps to access the same datastore file? (this is a repost from google app engine group) -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] mapreduce - passing filters
No, the mapper will go over everything. If the number of entities is small, you are better off placing an indexed property on ONLY these fields, then just iterating over them with a cursor and either a local client making multiple HTTP calls to your App Engine app or chained task queues. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Sun, Nov 7, 2010 at 5:58 AM, aswath satrasala aswath.satras...@gmail.com wrote: Hello, I want to perform few aggregations on entities of a kind that are filtered by the property. The entities I want to perform the aggregation is small compared to the complete entity set. Is there any way to pass the filters to the mapper, so that only those entities are retrieved and aggregation is performed *Regards -Aswath http://vs-accounting.appspot.com Accounting for Indian markets.* -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Determine Tenancy Quota
There's no way currently to determine quota usage per namespace. Our preference is that you use a single, multitenant namespaced application. Do you have severely assymetric clients app usage? I'm curious to see if the current pricing structure of $0.12 gigabyte/$0.15 gigabyte stored is actually a restrictive factor. I would think the cost of your application/consulting would far exceed any hosting costs. Maybe there's a compromise here - for most low traffic applications, place them into a single app, but for higher spend clients, create new application IDs for them. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Mon, Nov 8, 2010 at 10:07 AM, Johan Pretorius johanpretorius2...@gmail.com wrote: Hi I am writing an application that will allow an undetermined number of clients on the application. Every client's data will be stored using the *NameSpace* mechanism. There will be a huge difference on the quota usage per client. (A client will be a company and the company will add users to it's profile. The users will log on and send data to the application. Reports can also be requested.) I don't want to ask clients using little quota to subside clients using lots of quota. I want to ask each one what he uses. Is there a way to determine quota usage per *NameSpace* or would it be better (or allowed) to host a completely seperate application per 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: DTO object
Remap these complex types onto native Java types while copying your entities onto your dtos... or are you sending your entities to the client directly? Usually, you will not want to send the entities to the client as it exposes your data model directly. You should create your service layer so as to be friendly to other clients besides your own. Create a remoting API that is a bit more abstract than your entities so as to be easily exposed through a REST API for instance. When I copy my entities onto my dtos, some entity fields don't even make it into the dto. Others only have getters in the dto because they are read-only to the client. Those that do get into the dto get converted to native Java types. For instance, Text gets converted to String. Key gets encoded to a url friendly string. If I have Set fields on the entities to manager my relations (property lists), I remap those to ArrayList... First, don't serialize interfaces to GWT client, you'll get Javascript bloat. Then, Hashmap is costly to serialize because String.hashCode() is not the same on in Java and in Javascript. Hence, all the items need to be re-inserted into a client side map. Of course, in Web mode, performance is good enough... but in development mode, your data transfers will become really slow for somewhat big transfers. -- You received this message 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: Determine Tenancy Quota
Is this recommendation just for quota distribution (so that the big ones do not eat up the quota of the smaller ones) or is this a recommendation for better scalability and performance? I always had the impression that the GAE infrastructure would be able to handle such access patterns and give good throughput and response time even for unbalanced loads from different clients. In fact this would be one of the main benefits of cloud that I just have to manage one app instance and do not have to care about load and its distribution. It would be good to know if there are limitations. -- You received this message 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: mapreduce - passing filters
Ikai, Are there any plans to support filter functionality in the future? I have a similar situation where I want to iterate over a collection that is big enough to be used by the mapper framework, but much smaller than the actual collection size of all entities of that kind. Brad On Nov 8, 11:56 am, Ikai Lan (Google) ikai.l+gro...@google.com wrote: No, the mapper will go over everything. If the number of entities is small, you are better off placing an indexed property on ONLY these fields, then just iterating over them with a cursor and either a local client making multiple HTTP calls to your App Engine app or chained task queues. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger:http://googleappengine.blogspot.com Reddit:http://www.reddit.com/r/appengine Twitter:http://twitter.com/app_engine On Sun, Nov 7, 2010 at 5:58 AM, aswath satrasala aswath.satras...@gmail.com wrote: Hello, I want to perform few aggregations on entities of a kind that are filtered by the property. The entities I want to perform the aggregation is small compared to the complete entity set. Is there any way to pass the filters to the mapper, so that only those entities are retrieved and aggregation is performed *Regards -Aswath http://vs-accounting.appspot.com Accounting for Indian markets.* -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: mapreduce - passing filters
There was talk about supporting it, but the priority is getting out the shuffle/reduce steps first. appengine-mapreduce is an open source project. You can probably just edit/subclass DatastoreInputFormat.java and add the filter functionality: http://www.google.com/codesearch/p?hl=en#XwsseYUY0Ps/trunk/java/src/com/google/appengine/tools/mapreduce/DatastoreInputFormat.javaq=Query%20package:http://appengine-mapreduce%5C.googlecode%5C.comsa=Ncd=10ct=rc -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Mon, Nov 8, 2010 at 12:28 PM, Brad bseef...@finallythebasics.com wrote: Ikai, Are there any plans to support filter functionality in the future? I have a similar situation where I want to iterate over a collection that is big enough to be used by the mapper framework, but much smaller than the actual collection size of all entities of that kind. Brad On Nov 8, 11:56 am, Ikai Lan (Google) ikai.l+gro...@google.comikai.l%2bgro...@google.com wrote: No, the mapper will go over everything. If the number of entities is small, you are better off placing an indexed property on ONLY these fields, then just iterating over them with a cursor and either a local client making multiple HTTP calls to your App Engine app or chained task queues. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger:http://googleappengine.blogspot.com Reddit:http://www.reddit.com/r/appengine Twitter:http://twitter.com/app_engine On Sun, Nov 7, 2010 at 5:58 AM, aswath satrasala aswath.satras...@gmail.com wrote: Hello, I want to perform few aggregations on entities of a kind that are filtered by the property. The entities I want to perform the aggregation is small compared to the complete entity set. Is there any way to pass the filters to the mapper, so that only those entities are retrieved and aggregation is performed *Regards -Aswath http://vs-accounting.appspot.com Accounting for Indian markets.* -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: DTO object
Hi Starman, Thx for your reply. From what I understand, you are manually copying the properties from the Entity to the DTO. But this process is automated in GWT 2.1 So, I am not sending my entities directly, but the proxies as per the documentation : http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html An entity proxy is a client-side representation of an entity, otherwise known as a DTO (Data Transfer Object). With RequestFactory, entity proxies are interfaces that extend the EntityProxy interface, which is the hook used to indicate that an object can be managed by RequestFactory. RequestFactory automatically populates bean-style properties between entities on the server and the corresponding EntityProxy on the client, which simplifies using the DTO pattern. Furthermore, the EntityProxy interface enables RequestFactory to compute and send only changes (deltas) to the server. Entity proxies simply extend the EntityProxy interface and use the @ProxyFor annotation to reference the server-side entity being represented. It is not necessary to represent every property and method from the server-side entity in the EntityProxy, only getters and setters for properties that should be exposed to the client. The entity proxies are merely interfaces that are being populated by the new GWT 2.1 RequestFactory framework. I have no control over this copying process. Per definition, getters/setters of the real entity are injected into the EntityProxy whenever they are present; So my problem still stands : what about complex values like com.google.appengine.api.datastore.Email that are not known by the client side code ? How to transfer these complex values to the client. Any insight very welcome ! Koen -- You received this message 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: Trouble unit testing JPA data access objects.
hi didier i would like to see your unit test config and your spring config. can u post pls. thanks -lp On Fri, Nov 5, 2010 at 12:12 PM, Lucio Piccoli lucio.picc...@gmail.comwrote: hi didier, i did follow the google unit test doc. But my issue is using the spring tx with JPA in unit test. ii cant seem to get my entity manager bound to a tx. if u have any ideas or spring config it would be most appreciated. thanks -lp On Thu, Nov 4, 2010 at 11:17 PM, Didier Durand durand.did...@gmail.comwrote: Hi Ip, do you correctly initiate your local env for the datastore: see http://code.google.com/appengine/docs/java/tools/localunittesting.html#Writing_Datastore_Tests You should then get an active transaction when needed. Let me know if needed: can provide you with my own code when needed regards didier On Nov 4, 12:10 pm, lp lucio.picc...@gmail.com wrote: how did u get your unit tests to run in tx? i cant seem to get an active transaction. i followed all the links in this thread and more. any help appreciated -lp -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] about【PreparedQuery.countEnti ties()】 problem, how can I get the total count of a specif ic Query?
Hi liqwei, You can get the total count of a specific query as follows: Query query = new Query(Book.getKind()); PreparedQuery pq = ds.prepare(query); FetchOptions option = FetchOptions.Builder.withLimit(Integer.MAX_VALUE); out.println(pq.countEntities(option)); Hope this helps, Yasuo Higa On Sun, Nov 7, 2010 at 11:02 AM, liqwei liq...@gmail.com wrote: case 【PreparedQuery.countEntities()】 is Deprecated。 but how can I get the Total Count of a specific Query? the 【PreparedQuery.countEntities(FetchOptions fetchOptions) 】only return the count specificed by fetchOptions! ex. Query query = new Query(Book.getKind()); // there are 3 entities with Book kind in datastore zone PreparedQuery pq = ds.prepare(query); FetchOptions option = FetchOptions.Builder.withLimit(2); out.println(pq.countEntities()); // the count I really want, but the method is Deprecated currently; out.println(pq.countEntities(option)); // the count only return 2, but it should return 3 entity in this query; 3ks! -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Tasks SSL
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: security-constraint web-resource-collection url-pattern/_admin/*/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint 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.
Re: [appengine-java] GAE or EC2
I'm biased, naturally, but here's my piece: They're both great, young platforms, and successful businesses have been built on both Google App Engine as well as Amazon EC2. Amazon's lower level access appeals to some, whereas Google App Engine's abstractions appeal to the folks in this group. Have you actually used EC2 before? If not, new accounts can sign up for a free micro instance. You'll want to check this out before you make any decisions. Since you're already looking at EC2, why not look at VPS solutions? I personally prefer a provider such as Slicehost or Linode to EC2 for anything I can't currently do on Google App Engine. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Mon, Nov 8, 2010 at 5:59 PM, JY jy2...@gmail.com wrote: I want to ask fellow GAE users whether you think GAE is good choice to build real business on? I have used GAE for some personal projects, and right now help a friend on a tiny start up (but with big dream). The project is related to social network - I am thinking of two options: 1, GAE The benefits are obvious. However, it is also locking you inyou don't have much control over it. If you are unhappy later, you will have to redo the persistence layer and migrate data etc. 2, EC2 You have much more control, and if the start-up gets funding, it is easy to migrate to dedicated hosting or even its own data center. The down side is developer (me, and only me) will have to spend quite some time to take care of the infrastructure (although I like this kind of work...) I think my biggest concern of GAE is over the quality of service, and the data-store - if I go EC2, I probably will use a NoSQL solution like MogoDb, or Cassandra. The development efforts might be similar - all products are sort of young, hot, and limited. Thanks. JY -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: GAE or EC2
Having worked for a SaaS company with 500K users and +500M items in its database, the cost of just managing your infrastructure are enormous. Recently, I have been working on two unrelated projects, but both of pretty similar sizes. One on AWS, the other on GAE. AWS is rented virtualized servers with good SaaS support (elastic load balancing, etc). But nothing, I mean nothing beats a good PaaS offer like GAE if: 1) you can fit your business domain into a schemaless, (almost) join- less, really really hard to use with transactions datastore like Big Table and 2) can deal with the current cold startups (if using Java) and the 30 seconds thread limit (but the Task Queue API pretty much solves that). More so if you're a startup where money is tight. If you can just work on features, press a button, refresh you browser and there it is, for millions to use with automatic, unlimited scaling... that's priceless. But beware, all is not easy on GAE and many pitfalls await. You need to know what you are doing and be carefull. Good luck with the startup! -- You received this message 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: GAE or EC2
Hi JY, I have used both: for a small company aiming at big applications, I would definitely go GAE because it's PaaS: you don't have to deal with the infrastructure which can become quite time consuming when your application gets big if on EC2 (you have to update/patch your images, take care of your scaling, etc.). It's probably not what you want to spend time on at start with limited resource. On the other side, GAE has of course limitations / restrictions: Java- only, datastore specific architecture, etc. To reassure you, (a) the code of GAE is open source (did not check if 100%) and (b) some people are trying to replicate the system in an independent fashion to provide alternatives: check out the AppScale project at http://googleappengine.blogspot.com/2010/10/research-project-appscale-at-university.html regards didier On Nov 9, 2:59 am, JY jy2...@gmail.com wrote: I want to ask fellow GAE users whether you think GAE is good choice to build real business on? I have used GAE for some personal projects, and right now help a friend on a tiny start up (but with big dream). The project is related to social network - I am thinking of two options: 1, GAE The benefits are obvious. However, it is also locking you inyou don't have much control over it. If you are unhappy later, you will have to redo the persistence layer and migrate data etc. 2, EC2 You have much more control, and if the start-up gets funding, it is easy to migrate to dedicated hosting or even its own data center. The down side is developer (me, and only me) will have to spend quite some time to take care of the infrastructure (although I like this kind of work...) I think my biggest concern of GAE is over the quality of service, and the data-store - if I go EC2, I probably will use a NoSQL solution like MogoDb, or Cassandra. The development efforts might be similar - all products are sort of young, hot, and limited. Thanks. JY -- You received this message 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: GAE or EC2
Thanks IKai and Starman, very good advice. I don't have problem with big table or even limit of the data store since my project relies on social graph so I will very likely take the de-normalized approach, the other NoSQL solutions all have restrictions. I guess I am mostly concerned about the stability, availability and predictability. It is very disturbing when you show an empty screen (my client side is iPhone) to your partner and then try to explain that it failed because there has been no traffic to the project thus GAE deallocated the server and everything will be fine once we have users JY On Nov 8, 9:18 pm, Starman r...@arrova.ca wrote: Having worked for a SaaS company with 500K users and +500M items in its database, the cost of just managing your infrastructure are enormous. Recently, I have been working on two unrelated projects, but both of pretty similar sizes. One on AWS, the other on GAE. AWS is rented virtualized servers with good SaaS support (elastic load balancing, etc). But nothing, I mean nothing beats a good PaaS offer like GAE if: 1) you can fit your business domain into a schemaless, (almost) join- less, really really hard to use with transactions datastore like Big Table and 2) can deal with the current cold startups (if using Java) and the 30 seconds thread limit (but the Task Queue API pretty much solves that). More so if you're a startup where money is tight. If you can just work on features, press a button, refresh you browser and there it is, for millions to use with automatic, unlimited scaling... that's priceless. But beware, all is not easy on GAE and many pitfalls await. You need to know what you are doing and be carefull. Good luck with the startup! -- You received this message 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: GAE or EC2
Thanks Didier, will check out AppScale. On Nov 8, 10:32 pm, Didier Durand durand.did...@gmail.com wrote: Hi JY, I have used both: for a small company aiming at big applications, I would definitely go GAE because it's PaaS: you don't have to deal with the infrastructure which can become quite time consuming when your application gets big if on EC2 (you have to update/patch your images, take care of your scaling, etc.). It's probably not what you want to spend time on at start with limited resource. On the other side, GAE has of course limitations / restrictions: Java- only, datastore specific architecture, etc. To reassure you, (a) the code of GAE is open source (did not check if 100%) and (b) some people are trying to replicate the system in an independent fashion to provide alternatives: check out the AppScale project athttp://googleappengine.blogspot.com/2010/10/research-project-appscale... regards didier On Nov 9, 2:59 am, JY jy2...@gmail.com wrote: I want to ask fellow GAE users whether you think GAE is good choice to build real business on? I have used GAE for some personal projects, and right now help a friend on a tiny start up (but with big dream). The project is related to social network - I am thinking of two options: 1, GAE The benefits are obvious. However, it is also locking you inyou don't have much control over it. If you are unhappy later, you will have to redo the persistence layer and migrate data etc. 2, EC2 You have much more control, and if the start-up gets funding, it is easy to migrate to dedicated hosting or even its own data center. The down side is developer (me, and only me) will have to spend quite some time to take care of the infrastructure (although I like this kind of work...) I think my biggest concern of GAE is over the quality of service, and the data-store - if I go EC2, I probably will use a NoSQL solution like MogoDb, or Cassandra. The development efforts might be similar - all products are sort of young, hot, and limited. Thanks. JY -- You received this message 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: GAE or EC2
You might also want to check out a detailed comparison on technical aspects here http://thoughts.inphina.com/2010/11/01/comparing-google-app-engine-and-amazon-ec2-on-technology/ Regards | Vikas On Nov 9, 9:32 am, Didier Durand durand.did...@gmail.com wrote: Hi JY, I have used both: for a small company aiming at big applications, I would definitely go GAE because it's PaaS: you don't have to deal with the infrastructure which can become quite time consuming when your application gets big if on EC2 (you have to update/patch your images, take care of your scaling, etc.). It's probably not what you want to spend time on at start with limited resource. On the other side, GAE has of course limitations / restrictions: Java- only, datastore specific architecture, etc. To reassure you, (a) the code of GAE is open source (did not check if 100%) and (b) some people are trying to replicate the system in an independent fashion to provide alternatives: check out the AppScale project athttp://googleappengine.blogspot.com/2010/10/research-project-appscale... regards didier On Nov 9, 2:59 am, JY jy2...@gmail.com wrote: I want to ask fellow GAE users whether you think GAE is good choice to build real business on? I have used GAE for some personal projects, and right now help a friend on a tiny start up (but with big dream). The project is related to social network - I am thinking of two options: 1, GAE The benefits are obvious. However, it is also locking you inyou don't have much control over it. If you are unhappy later, you will have to redo the persistence layer and migrate data etc. 2, EC2 You have much more control, and if the start-up gets funding, it is easy to migrate to dedicated hosting or even its own data center. The down side is developer (me, and only me) will have to spend quite some time to take care of the infrastructure (although I like this kind of work...) I think my biggest concern of GAE is over the quality of service, and the data-store - if I go EC2, I probably will use a NoSQL solution like MogoDb, or Cassandra. The development efforts might be similar - all products are sort of young, hot, and limited. Thanks. JY -- You received this message 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: No API environment is registered for this thread
Hi Eyal, Independently of App Engine, how many seconds does it take to get an answer to your request to Google Analytics (as given above) when you run is as a Java application ? A servlet cannot last more than 30s in App Engine, so knwoing your timing is important. But, from my experience, you should get the answer in a matter of a few seconds at most. Let us know didier On Nov 8, 6:32 pm, Eyal twoworldsf...@gmail.com wrote: Just to complete the picture here's the initialization of the AnalyticsService: AnalyticsService as = new AnalyticsService(gaExportAPI_acctSample_v1.0); as.setUserCredentials(CLIENT_USERNAME, CLIENT_PASS); Thanks again, Eyal On Nov 8, 7:27 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Sure, here is an example method: public SiteBasicData getSiteBasicData(AnalyticsService as, Site site, DateTime date) { SiteBasicData sd = new SiteBasicData(); as.setConnectTimeout(1); as.setReadTimeout(1); DataFeed dataFeed = null; try { DataQuery query = new DataQuery(new URL(https://www.google.com/ analytics/feeds/data)); DateTimeFormatter fmt = DateTimeFormat.forPattern(-MM- dd); query.setStartDate(date.toString(fmt)); query.setEndDate(date.toString(fmt)); query.setMetrics(ga:visitors,ga:visits,ga:pageviews,ga:newVisits,ga:bounce s,ga:timeOnSite); query.setMaxResults(50); query.setIds(site.getTableID()); dataFeed = as.getFeed(query.getUrl(), DataFeed.class); DataEntry entry = dataFeed.getEntries().get(0); DecimalFormat dfDouble = new DecimalFormat(.##); DecimalFormat dfZero = new DecimalFormat(#); int visits = Integer.parseInt(entry.stringValueOf(ga:visits)); int uniques = Integer.parseInt(entry.stringValueOf(ga:visitors)); int newVisits = Integer.parseInt(entry.stringValueOf(ga:newVisits)); int pageViews = Integer.parseInt(entry.stringValueOf(ga:pageviews)); int bounces = Integer.parseInt(entry.stringValueOf(ga:bounces)); int timeOnSite = Integer.parseInt(entry.stringValueOf(ga:timeOnSite)); sd.setSite(site); sd.setDate(date); sd.setVisitors(visits); sd.setUniqueVisitors(uniques); sd.setNewVisits(newVisits); sd.setReturningVisits(visits-newVisits); sd.setPageViews(pageViews); sd.setUniquePageViews(getUniquePageViews(as, site, date)); sd.setBounces(bounces); sd.setTimeOnSite(timeOnSite); } catch(Exception e) { e.printStackTrace(); } return sd; } Then I do the simple JDO to persist the sd object. But it doesn't even get there because I get the Timeout while fetching exception. Thanks! Eyal On Nov 8, 6:33 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Can you detail (i.e post code samples) on what you do with Analytics (I need to be able to update the application's datastore with a feed from Analytics.) and how you want to do it. It's too vague as of now. regards didier On Nov 8, 4:41 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Thanks for your reply. Here's the problem, though: when I run it as a web application I'm getting a timeout error. I've already posted this issue on the Analytics dev group at (http://groups.google.com/group/ google-analytics-data-export-api/browse_thread/thread/ 3f9956a25d718b59) but so far no one responded. Do you have experience integrating analytics into app engine? I'm sure it can be done but I've been trying to get it to work for 2 days now with absolutely no progress. If you, or anyone can help me out I'm sure my company will be willing to pay for this service. Thanks, Eyal On Nov 8, 5:17 pm, Didier Durand durand.did...@gmail.com wrote: Eyal, Now it's clear = you MUST run the application as a Web Application to be able to activate the App Engine environment with the Datastore that you need for JDO. Then you MUST activate the local dev env for App Engine on your machine : see my previous answer with the link. If you don't do both actions above, it can not work as you wish. regards didier On Nov 8, 1:39 pm, Eyal twoworldsf...@gmail.com wrote: On my dev, when running As A Java Application. If I try to run it as a Web Application I get a Timeout exception, because the Analytics feed takes too long to respond... Thanks for looking into this, Didier!
[appengine-java] Re: No API environment is registered for this thread
Hi Didier, It takes about 8-9 seconds to return with a reply as a java application for one query. I'm going to need a lot more than one query, though, so some of my fetch requests will take much longer. But in any case the timeout exception hits even before the 8-9 seconds, and even when I increase the connect and read timeouts to 10 secs as above. Thanks, Eyal On Nov 9, 7:38 am, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Independently of App Engine, how many seconds does it take to get an answer to your request to Google Analytics (as given above) when you run is as a Java application ? A servlet cannot last more than 30s in App Engine, so knwoing your timing is important. But, from my experience, you should get the answer in a matter of a few seconds at most. Let us know didier On Nov 8, 6:32 pm, Eyal twoworldsf...@gmail.com wrote: Just to complete the picture here's the initialization of the AnalyticsService: AnalyticsService as = new AnalyticsService(gaExportAPI_acctSample_v1.0); as.setUserCredentials(CLIENT_USERNAME, CLIENT_PASS); Thanks again, Eyal On Nov 8, 7:27 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Sure, here is an example method: public SiteBasicData getSiteBasicData(AnalyticsService as, Site site, DateTime date) { SiteBasicData sd = new SiteBasicData(); as.setConnectTimeout(1); as.setReadTimeout(1); DataFeed dataFeed = null; try { DataQuery query = new DataQuery(new URL(https://www.google.com/ analytics/feeds/data)); DateTimeFormatter fmt = DateTimeFormat.forPattern(-MM- dd); query.setStartDate(date.toString(fmt)); query.setEndDate(date.toString(fmt)); query.setMetrics(ga:visitors,ga:visits,ga:pageviews,ga:newVisits,ga:bounce s,ga:timeOnSite); query.setMaxResults(50); query.setIds(site.getTableID()); dataFeed = as.getFeed(query.getUrl(), DataFeed.class); DataEntry entry = dataFeed.getEntries().get(0); DecimalFormat dfDouble = new DecimalFormat(.##); DecimalFormat dfZero = new DecimalFormat(#); int visits = Integer.parseInt(entry.stringValueOf(ga:visits)); int uniques = Integer.parseInt(entry.stringValueOf(ga:visitors)); int newVisits = Integer.parseInt(entry.stringValueOf(ga:newVisits)); int pageViews = Integer.parseInt(entry.stringValueOf(ga:pageviews)); int bounces = Integer.parseInt(entry.stringValueOf(ga:bounces)); int timeOnSite = Integer.parseInt(entry.stringValueOf(ga:timeOnSite)); sd.setSite(site); sd.setDate(date); sd.setVisitors(visits); sd.setUniqueVisitors(uniques); sd.setNewVisits(newVisits); sd.setReturningVisits(visits-newVisits); sd.setPageViews(pageViews); sd.setUniquePageViews(getUniquePageViews(as, site, date)); sd.setBounces(bounces); sd.setTimeOnSite(timeOnSite); } catch(Exception e) { e.printStackTrace(); } return sd; } Then I do the simple JDO to persist the sd object. But it doesn't even get there because I get the Timeout while fetching exception. Thanks! Eyal On Nov 8, 6:33 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Can you detail (i.e post code samples) on what you do with Analytics (I need to be able to update the application's datastore with a feed from Analytics.) and how you want to do it. It's too vague as of now. regards didier On Nov 8, 4:41 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Thanks for your reply. Here's the problem, though: when I run it as a web application I'm getting a timeout error. I've already posted this issue on the Analytics dev group at (http://groups.google.com/group/ google-analytics-data-export-api/browse_thread/thread/ 3f9956a25d718b59) but so far no one responded. Do you have experience integrating analytics into app engine? I'm sure it can be done but I've been trying to get it to work for 2 days now with absolutely no progress. If you, or anyone can help me out I'm sure my company will be willing to pay for this service. Thanks, Eyal On Nov 8, 5:17 pm, Didier Durand durand.did...@gmail.com wrote: Eyal, Now it's clear = you MUST run the application as a Web Application to be able to activate the App Engine environment with the Datastore
[appengine-java] Re: No API environment is registered for this thread
Just to be clear, the timeout exception hits on App Engine. All is well as a java app. On Nov 9, 8:06 am, Eyal twoworldsf...@gmail.com wrote: Hi Didier, It takes about 8-9 seconds to return with a reply as a java application for one query. I'm going to need a lot more than one query, though, so some of my fetch requests will take much longer. But in any case the timeout exception hits even before the 8-9 seconds, and even when I increase the connect and read timeouts to 10 secs as above. Thanks, Eyal On Nov 9, 7:38 am, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Independently of App Engine, how many seconds does it take to get an answer to your request to Google Analytics (as given above) when you run is as a Java application ? A servlet cannot last more than 30s in App Engine, so knwoing your timing is important. But, from my experience, you should get the answer in a matter of a few seconds at most. Let us know didier On Nov 8, 6:32 pm, Eyal twoworldsf...@gmail.com wrote: Just to complete the picture here's the initialization of the AnalyticsService: AnalyticsService as = new AnalyticsService(gaExportAPI_acctSample_v1.0); as.setUserCredentials(CLIENT_USERNAME, CLIENT_PASS); Thanks again, Eyal On Nov 8, 7:27 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Sure, here is an example method: public SiteBasicData getSiteBasicData(AnalyticsService as, Site site, DateTime date) { SiteBasicData sd = new SiteBasicData(); as.setConnectTimeout(1); as.setReadTimeout(1); DataFeed dataFeed = null; try { DataQuery query = new DataQuery(new URL(https://www.google.com/ analytics/feeds/data)); DateTimeFormatter fmt = DateTimeFormat.forPattern(-MM- dd); query.setStartDate(date.toString(fmt)); query.setEndDate(date.toString(fmt)); query.setMetrics(ga:visitors,ga:visits,ga:pageviews,ga:newVisits,ga:bounce s,ga:timeOnSite); query.setMaxResults(50); query.setIds(site.getTableID()); dataFeed = as.getFeed(query.getUrl(), DataFeed.class); DataEntry entry = dataFeed.getEntries().get(0); DecimalFormat dfDouble = new DecimalFormat(.##); DecimalFormat dfZero = new DecimalFormat(#); int visits = Integer.parseInt(entry.stringValueOf(ga:visits)); int uniques = Integer.parseInt(entry.stringValueOf(ga:visitors)); int newVisits = Integer.parseInt(entry.stringValueOf(ga:newVisits)); int pageViews = Integer.parseInt(entry.stringValueOf(ga:pageviews)); int bounces = Integer.parseInt(entry.stringValueOf(ga:bounces)); int timeOnSite = Integer.parseInt(entry.stringValueOf(ga:timeOnSite)); sd.setSite(site); sd.setDate(date); sd.setVisitors(visits); sd.setUniqueVisitors(uniques); sd.setNewVisits(newVisits); sd.setReturningVisits(visits-newVisits); sd.setPageViews(pageViews); sd.setUniquePageViews(getUniquePageViews(as, site, date)); sd.setBounces(bounces); sd.setTimeOnSite(timeOnSite); } catch(Exception e) { e.printStackTrace(); } return sd; } Then I do the simple JDO to persist the sd object. But it doesn't even get there because I get the Timeout while fetching exception. Thanks! Eyal On Nov 8, 6:33 pm, Didier Durand durand.did...@gmail.com wrote: Hi Eyal, Can you detail (i.e post code samples) on what you do with Analytics (I need to be able to update the application's datastore with a feed from Analytics.) and how you want to do it. It's too vague as of now. regards didier On Nov 8, 4:41 pm, Eyal twoworldsf...@gmail.com wrote: Hi Didier, Thanks for your reply. Here's the problem, though: when I run it as a web application I'm getting a timeout error. I've already posted this issue on the Analytics dev group at (http://groups.google.com/group/ google-analytics-data-export-api/browse_thread/thread/ 3f9956a25d718b59) but so far no one responded. Do you have experience integrating analytics into app engine? I'm sure it can be done but I've been trying to get it to work for 2 days now with absolutely no progress. If you, or anyone can help me out I'm sure my company will be willing to pay for