[appengine-java] Re: URL Fetch problems

2011-03-07 Thread Kim Kha Nguyen


I found the solution:

Use low-level API (help here: 
http://ikaisays.com/2010/06/29/using-asynchronous-urlfetch-on-java-app-engine/ 
- thank Ikai Lan so much). And you must use 
FetchOptions.Builder.doNotValidateCertificate() to turn of Validate certificate 
process...

  

-- 
You received this message 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] Creating/Compiling new Java class at run time

2011-03-07 Thread Rick Smith
Hi all

Can I create and compile a java class at run time on goolge
appengine.
Use case: I have given a UI to my application user that they can
define their own business logic.Now what is going to be main challenge
is that I need to make new deployment each time when some one need to
modify its business logic. As an alternate I want to store source code
in data base and compile it when required.

Regards

Rick

-- 
You received this message 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: uploading 100k lines into the datastore is enough to max out the CPU time?

2011-03-07 Thread Cláudio Coelho
Hi
I'm quite new at GAE, so I'm probably saying something silly, but for what I
read on GAE Java and GWT Application Development, I was under the impression
that GAE would generate indexes automatically except for some variable types
(blobs, text, etc) and for when we explicitly asked it not to.
However, when I look at the datastore-indexes-auto.xml file, it is indeed
empty. Through debugging I have been able to isolate that it's the
bottleneck is pm.makeConsistent of each entity to insert. Wouldn't having
indexes make the inserting even slower (since these indexes have to be
updated/rebuilt)?

thanks

C.

On Mon, Mar 7, 2011 at 5:44 AM, Didier Durand wrote:

> Hi,
>
> The first issue that comes to mind in missing indexes: so huge scans
> of all existing data when you upload an additional line.
>
> What are your indexes ?
>
> regards
>
> didier
>
> On Mar 6, 12:43 pm, Cláudio Coelho  wrote:
> > Hi,
> > My application needs a db of the world cities. I have a file that has
> about
> > 100k lines  and I want to use it to populate the datastore.
> > My first attempt failed because I didn't use tasks, so I was only able to
> > upload a limited set of cities. It spent 2% of CPU total time on the app
> > engine.
> > I then changed the approach to use tasks.
> > I basically read the file once to determine how many lines does it have
> and
> > then invoke tasks to read batches of 15k lines (supplying a start and end
> > indexes).
> > These invoked tasks (createCities(int start, int end)) read the file
> again,
> > get a list of 15k lines and then process it.
> > The whole process takes about 15 seconds on my machine, however, when I
> do
> > this in the app engine, it takes 15 minutes (or more) and maxes out the
> 6.5
> > hours of CPU time! I know there are plenty of optimizations I should do
> to
> > this process, but that doesn't seem to justify the 6.5 hours, so I must
> be
> > doing something seriously wrong.
> >
> > Does anybody have any clue of what I'm doing wrong? (Code attached)
> >
> > Thanks!
> >
> > private void createCities() {
> > try
> > {
> > int count = countCitiesToLoad();
> > final int batchSize = 15000;
> > for(int start=0;start > {
> > int end=start+batchSize;
> > Queue queue = QueueFactory.getQueue("dbQueue");
> > TaskOptions topt = TaskOptions.Builder.withUrl("/dbservlet");
> > topt.param("command", "createCities");
> > topt.param("start", ""+start);
> > topt.param("end", ""+end);
> > queue.add(topt);
> > logInfo("Dispatched order to create cities "+start+" to "+end);
> > Thread.sleep(500);}
> > }catch(Exception e)
> >
> > {
> > e.printStackTrace();
> > logError(e.getLocalizedMessage());
> >
> > }
> > }
> >
> > private void createCities(int start, int end)
> > {
> > try
> > {
> >  logInfo("Reading cities "+start+" to "+end);
> > BufferedReader br= new BufferedReader(new FileReader("data/cities.csv"));
> > String line=br.readLine();
> > int counter=0;
> > PersistenceManager pm = PMF.get().getPersistenceManager();
> > ArrayList lines = new ArrayList();
> > while(line!=null || counter > {
> > if(counter>=start && counter  > lines.add(line);
> > counter++;
> > line=br.readLine();}
> >
> > br.close();
> > logInfo("Adding cities "+start+" to "+end);
> > createCities(lines);
> > logInfo("Done cities "+start+" to "+end);}
> >
> > catch(Exception e)
> > {
> > e.printStackTrace();
> > logError(e.getLocalizedMessage());
> >
> > }
> > }
> >
> > private void createCities(ArrayList lines)
> > {
> > if(lines==null)
> > return;
> > PersistenceManager pm = PMF.get().getPersistenceManager();
> > HashMap countryMap = loadCountryMap();
> > try{
> > for(String line : lines)
> > if(line!=null)
> > {
> > String fields[]=line.split(",");
> > if(fields.length<7)
> > logError("length error in line:"+line);
> > else
> > {
> > Location loc = new Location();
> > loc.setName(fields[2]);
> > loc.setLatitude(Double.parseDouble(fields[3]));
> > loc.setLongitude(Double.parseDouble(fields[4]));
> > loc.setPopulation(Integer.parseInt(fields[6]));
> > {
> > Country c = countryMap.get(fields[5]);
> > if(c==null)
> > logError("Failed to get country for:"+line);
> > else
> > {
> > loc.setCountryId(c.getCountryId());
> > loc.setCountry(c.getName());
> > pm.makePersistent(loc);}
> > }
> > }
> > }
> > } catch (Exception e) {
> >
> > e.printStackTrace();
> >
> > } finally {
> > pm.close();
> > }
> > }
> >
> >
>
> --
> You received this message 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.
>
>


-- 
Cláudio Coelho

"Great spirits have often encountered violent opposition from weak minds."
A. Einstein

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

[appengine-java] Re: Logging message info-level

2011-03-07 Thread Jonas Gehring
thanks, now it works.

On 1 Mrz., 21:13, "Ikai Lan (Google)" 
wrote:
> Can you post your logging.properties?
>
> You'll want this setting:
>
> .level=INFO
>
> Once you have that working, it'll be easier to fine tune for more granular
> control over levels.
>
> --
> 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 Tue, Mar 1, 2011 at 5:49 AM, Jonas Gehring  wrote:
> > Hello.
>
> > I try to log something, so that I can see it on the admin console as
> > [info].
>
> > I tried System.out and java.util.Logger#info but there comes nothing
> > into the logs.
> > I followed the documentation:
> >http://code.google.com/intl/de-DE/appengine/docs/java/runtime.html#Lo...
>
> > System.err and java.util.Logger#warning work well.
>
> > 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.



[appengine-java] Re: uploading 100k lines into the datastore is enough to max out the CPU time?

2011-03-07 Thread Didier Durand
Hi,

Could you please disclose the source code of your objects stored in
the ds ?

You maybe right or wrong depending on how they were defined.

regards

didier

On Mar 7, 9:41 am, Cláudio Coelho  wrote:
> Hi
> I'm quite new at GAE, so I'm probably saying something silly, but for what I
> read on GAE Java and GWT Application Development, I was under the impression
> that GAE would generate indexes automatically except for some variable types
> (blobs, text, etc) and for when we explicitly asked it not to.
> However, when I look at the datastore-indexes-auto.xml file, it is indeed
> empty. Through debugging I have been able to isolate that it's the
> bottleneck is pm.makeConsistent of each entity to insert. Wouldn't having
> indexes make the inserting even slower (since these indexes have to be
> updated/rebuilt)?
>
> thanks
>
> C.
>
> On Mon, Mar 7, 2011 at 5:44 AM, Didier Durand wrote:
>
>
>
> > Hi,
>
> > The first issue that comes to mind in missing indexes: so huge scans
> > of all existing data when you upload an additional line.
>
> > What are your indexes ?
>
> > regards
>
> > didier
>
> > On Mar 6, 12:43 pm, Cláudio Coelho  wrote:
> > > Hi,
> > > My application needs a db of the world cities. I have a file that has
> > about
> > > 100k lines  and I want to use it to populate the datastore.
> > > My first attempt failed because I didn't use tasks, so I was only able to
> > > upload a limited set of cities. It spent 2% of CPU total time on the app
> > > engine.
> > > I then changed the approach to use tasks.
> > > I basically read the file once to determine how many lines does it have
> > and
> > > then invoke tasks to read batches of 15k lines (supplying a start and end
> > > indexes).
> > > These invoked tasks (createCities(int start, int end)) read the file
> > again,
> > > get a list of 15k lines and then process it.
> > > The whole process takes about 15 seconds on my machine, however, when I
> > do
> > > this in the app engine, it takes 15 minutes (or more) and maxes out the
> > 6.5
> > > hours of CPU time! I know there are plenty of optimizations I should do
> > to
> > > this process, but that doesn't seem to justify the 6.5 hours, so I must
> > be
> > > doing something seriously wrong.
>
> > > Does anybody have any clue of what I'm doing wrong? (Code attached)
>
> > > Thanks!
>
> > > private void createCities() {
> > > try
> > > {
> > > int count = countCitiesToLoad();
> > > final int batchSize = 15000;
> > > for(int start=0;start > > {
> > > int end=start+batchSize;
> > > Queue queue = QueueFactory.getQueue("dbQueue");
> > > TaskOptions topt = TaskOptions.Builder.withUrl("/dbservlet");
> > > topt.param("command", "createCities");
> > > topt.param("start", ""+start);
> > > topt.param("end", ""+end);
> > > queue.add(topt);
> > > logInfo("Dispatched order to create cities "+start+" to "+end);
> > > Thread.sleep(500);}
> > > }catch(Exception e)
>
> > > {
> > > e.printStackTrace();
> > > logError(e.getLocalizedMessage());
>
> > > }
> > > }
>
> > > private void createCities(int start, int end)
> > > {
> > > try
> > > {
> > >  logInfo("Reading cities "+start+" to "+end);
> > > BufferedReader br= new BufferedReader(new FileReader("data/cities.csv"));
> > > String line=br.readLine();
> > > int counter=0;
> > > PersistenceManager pm = PMF.get().getPersistenceManager();
> > > ArrayList lines = new ArrayList();
> > > while(line!=null || counter > > {
> > > if(counter>=start && counter  > > lines.add(line);
> > > counter++;
> > > line=br.readLine();}
>
> > > br.close();
> > > logInfo("Adding cities "+start+" to "+end);
> > > createCities(lines);
> > > logInfo("Done cities "+start+" to "+end);}
>
> > > catch(Exception e)
> > > {
> > > e.printStackTrace();
> > > logError(e.getLocalizedMessage());
>
> > > }
> > > }
>
> > > private void createCities(ArrayList lines)
> > > {
> > > if(lines==null)
> > > return;
> > > PersistenceManager pm = PMF.get().getPersistenceManager();
> > > HashMap countryMap = loadCountryMap();
> > > try{
> > > for(String line : lines)
> > > if(line!=null)
> > > {
> > > String fields[]=line.split(",");
> > > if(fields.length<7)
> > > logError("length error in line:"+line);
> > > else
> > > {
> > > Location loc = new Location();
> > > loc.setName(fields[2]);
> > > loc.setLatitude(Double.parseDouble(fields[3]));
> > > loc.setLongitude(Double.parseDouble(fields[4]));
> > > loc.setPopulation(Integer.parseInt(fields[6]));
> > > {
> > > Country c = countryMap.get(fields[5]);
> > > if(c==null)
> > > logError("Failed to get country for:"+line);
> > > else
> > > {
> > > loc.setCountryId(c.getCountryId());
> > > loc.setCountry(c.getName());
> > > pm.makePersistent(loc);}
> > > }
> > > }
> > > }
> > > } catch (Exception e) {
>
> > > e.printStackTrace();
>
> > > } finally {
> > > pm.close();
> > > }
> > > }
>
> > --
> > You received this message 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@

[appengine-java] Re: uploading 100k lines into the datastore is enough to max out the CPU time?

2011-03-07 Thread Cláudio Coelho
Since the bottleneck occurs when making objects of Location
persistent, I assume that is the only relevant class. If anything else
is relevant, tell me and I'll disclose.

@PersistenceCapable(identityType =
IdentityType.APPLICATION,detachable="true")
public class Location{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Long locationId;
@Persistent
long countryId;
@Persistent
String name;
@Persistent
String country=null;
@Persistent
double latitude,longitude;
@Persistent
int population;
@Persistent
long geoBoxL1,geoBoxL2,geoBoxL3,geoBoxL4,geoBoxL5;
public Location()
{

}
public Location(String name, long countryId,String country, double
latitude, double longitude)
{
this.name=name;
this.countryId=countryId;
this.latitude=latitude;
this.longitude=longitude;
this.country=country;
}
public Location(LocationDTO dto) {
this();
updateFromDTO(dto);
}

public void updateFromDTO(LocationDTO dto) {
setLocationId(dto.getLocationId());
setCountryId(dto.getCountryId());
setCountry(dto.getCountry());
setName(dto.getName());
setPopulation(dto.getPopulation());
setLatitude(dto.getLatitude());
setLongitude(dto.getLongitude());
setGeoBoxL1(dto.getGeoBoxL1());
setGeoBoxL2(dto.getGeoBoxL2());
setGeoBoxL3(dto.getGeoBoxL3());
setGeoBoxL4(dto.getGeoBoxL4());
setGeoBoxL5(dto.getGeoBoxL5());


}
public LocationDTO getDTO()
{
LocationDTO dto = new LocationDTO();
dto.setLocationId(getLocationId());
dto.setCountryId(getCountryId());
dto.setCountry(getCountry());
dto.setName(getName());
dto.setPopulation(getPopulation());
dto.setLatitude(getLatitude());
dto.setLongitude(getLongitude());
dto.setGeoBoxL1(getGeoBoxL1());
dto.setGeoBoxL2(getGeoBoxL2());
dto.setGeoBoxL3(getGeoBoxL3());
dto.setGeoBoxL4(getGeoBoxL4());
dto.setGeoBoxL5(getGeoBoxL5());

return dto;
}

public long getLocationId() {
return locationId;
}
public void setLocationId(long locationId) {
this.locationId = locationId;
}
public String getCountry() {
return country;
}

public int getPopulation() {
return population;
}
public void setPopulation(int population) {
this.population = population;
}
public void setCountry(String country) {
this.country = country;
}

public long getCountryId() {
return countryId;
}
public void setCountryId(long countryId) {
this.countryId = countryId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}

public long getGeoBoxL1() {
return geoBoxL1;
}
public void setGeoBoxL1(long geoBoxL1) {
this.geoBoxL1 = geoBoxL1;
}
public long getGeoBoxL2() {
return geoBoxL2;
}
public void setGeoBoxL2(long geoBoxL2) {
this.geoBoxL2 = geoBoxL2;
}
public long getGeoBoxL3() {
return geoBoxL3;
}
public void setGeoBoxL3(long geoBoxL3) {
this.geoBoxL3 = geoBoxL3;
}
public long getGeoBoxL4() {
return geoBoxL4;
}
public void setGeoBoxL4(long geoBoxL4) {
this.geoBoxL4 = geoBoxL4;
}
public long getGeoBoxL5() {
return geoBoxL5;
}
public void setGeoBoxL5(long geoBoxL5) {
this.geoBoxL5 = geoBoxL5;
}
}

On Mar 7, 10:23 am, Didier Durand  wrote:
> Hi,
>
> Could you please disclose the source code of your objects stored in
> the ds ?
>
> You maybe right or wrong depending on how they were defined.
>
> regards
>
> didier
>
> On Mar 7, 9:41 am, Cláudio Coelho  wrote:
>
>
>
>
>
>
>

[appengine-java] UserService error

2011-03-07 Thread Aswath Satrasala
Hello,
I had a situation, where I encountered an UserService returning a null User.

I can see in my logs, that the end user is logged in and performing some
operations.  He waits for 10-20 seconds and performs another operation.
>From the logs, I can trace that UserService returned a null User.
Any reason or ideas?

*Regards
-Aswath
www.AccountingGuru.in*

-- 
You received this message 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] Import test data to local datastore

2011-03-07 Thread Aswath Satrasala
I have tried this and works fine for me.  Few steps..
- You should have app.yaml in the root folder
- Give the complete path of your application folder as the last argument.
- give random userid and password when prompted.

-Aswath


On Thu, Feb 24, 2011 at 10:25 PM, Kat Bradley wrote:

> I'm aware that this issue has been brought up before, but I've not been
> able to get any resolution on it.  Wondering if anyone has any advice that
> my google-foo is not finding.
>
> I would like to import some test data to the local datastore of my Java
> application.  This would allow me to test bug fixes locally before deploying
> them, and speed up my development process significantly.  I was able to
> download some data into a .csv file from my app using the python-based bulk
> loader (instructions here:
> http://ikaisays.com/2010/06/10/using-the-bulkloader-with-java-app-engine/).
> Now I am trying to push the data to my local app, and not having any
> success.  The command I'm running is as follows:
>
> python2.5 appcfg.py upload_data --application= --kind= type> --filename=data.csv --config_file=config.yaml --url=
> http://localhost:/remote_api/
>
> This prompts me for a username and password.  Various sites have said that
> I should be able to enter any random username, and a blank password.
> However, after I do that, I get the following stack trace:
>
>   File "/usr/lib/python2.5/urllib2.py", line 387, in open
> response = meth(req, response)
>   File "/usr/lib/python2.5/urllib2.py", line 498, in http_response
> 'http', request, response, code, msg, hdrs)
>   File "/usr/lib/python2.5/urllib2.py", line 425, in error
> return self._call_chain(*args)
>   File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
> result = func(*args)
>   File "/usr/lib/python2.5/urllib2.py", line 506, in http_error_default
> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
> HTTPError: HTTP Error 404: Not Found
> [INFO] Authentication Failed
>
> At the console, it prints [WARN] No file found for: /remote_api/  But I
> have the remote api servlet enabled at that url in web.xml, and have been
> able to use it in my production app.
>
> Is bulk uploading like this to a local datastore even possible?  The
> documentation on the bulkloader says that it's impossible to download data
> from a local app, but is silent about uploading.  Is there another way of
> doing this besides the bulk loader?
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



[appengine-java] Re: What is maximum number of entities I can update within the 30 sec time limit of App engine ?

2011-03-07 Thread Didier Durand
Hi,

I have a personal rule of thumb of 10 udpated entities / second [Ds is
made for heavy read throughput but is not so fast on writes]

The new High Replication datastore seems (not tried it personally...)
slower: 1 update per second is what is the max recommended. See
http://code.google.com/appengine/docs/python/datastore/hr/overview.html

N.B: my personal 10 updates/s works only if entities do not belong to
same entity group else throughput gets much lower.

So, for a big update, you have to use queued tasks:
- you should get 10 mins instead of 30s for interactive requests
- you can chain tasks when you reach the 10 min limit: the one
reaching 10 mins limit schedules another one just before the time
limit. Even better, you can go with several tasks in parallel and get
extremely fast (provided that the tasks don't conflict with other on
updates: your data architecture has to allow for it)

regards

didier

On Mar 7, 6:40 am, suersh babu  wrote:
> Hi,
>
> I like to known what is the maximum number of entities I can update within
> the 30 sec
> time limit of App engine.
>
> Let say If I have a kind called "Employee" which  has 2000 entities and each
> of this entity have
> 10 Properties,  so if I need to update all of this 2000 entities of
> Employee,  what is the maximum
> entities that I can update  within 30 sec time limit.
>
> Any suggestion much appreciated.
>
> *Regards**
>
> Suresh Babu G*
>
> http://www.AccountingGuru.in

-- 
You received this message 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] compute intensive application

2011-03-07 Thread broiyan
I want to set-up a compute intensive application on GAE and I would like to 
know if the Task Queue is going to pose serious obstacles to reducing the 
elapsed time.

I am presently running a test application (not using task queues) that takes 
about 1 second (a 650 million iteration no-op loop).  Unfortunately, I see 
that the reality is that there is a lot of variability in how long it takes 
GAE to complete what typically takes 1 second.  It can range from 0.9 
seconds to more than 2 seconds (measured inside the servlet so as not to be 
affected by internet delays).  Given this variability it seems impossible to 
consistently stay under the 1000ms that Google recommends.  My test run has 
a desktop program invoking the application 3000 times (from 100 threads).  
One problem is the 5xx HTTP errors (perhaps more than 100 errors in 3000 
invocations).  Another problem is that the 3000 invocations take about 500 
seconds which is only an approximate 6-fold improvement in the elapsed time 
compared to single threading.  This is despite having 100 threads.  Also 
troubling are the one or more periods when when no responses are received 
despite there being 100 threads trying to get responses.  These pauses can 
last a few seconds or even more than 30 seconds.

It appears I will have to move away from the current approach.  I would like 
to know if GAE Task Queues will pose similar problems or if GAE Task Queues 
are not the right approach to getting a lot of computing done.  Reducing the 
elapsed time is the objective.

-- 
You received this message 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: What is maximum number of entities I can update within the 30 sec time limit of App engine ?

2011-03-07 Thread suersh babu
Thanks Didier,

That is really helpful, but I have another question,

 We have a web application, and we use GWT for this web application,
 so If I need to update the entities by task queue and show it as a report
to the user.

 What is the assurance that our task job get started as soon as we put it in
task
 queue so that user get the report as soon as possible.





On Mon, Mar 7, 2011 at 5:37 PM, Didier Durand wrote:

> Hi,
>
> I have a personal rule of thumb of 10 udpated entities / second [Ds is
> made for heavy read throughput but is not so fast on writes]
>
> The new High Replication datastore seems (not tried it personally...)
> slower: 1 update per second is what is the max recommended. See
> http://code.google.com/appengine/docs/python/datastore/hr/overview.html
>
> N.B: my personal 10 updates/s works only if entities do not belong to
> same entity group else throughput gets much lower.
>
> So, for a big update, you have to use queued tasks:
>- you should get 10 mins instead of 30s for interactive requests
>- you can chain tasks when you reach the 10 min limit: the one
> reaching 10 mins limit schedules another one just before the time
> limit. Even better, you can go with several tasks in parallel and get
> extremely fast (provided that the tasks don't conflict with other on
> updates: your data architecture has to allow for it)
>
> regards
>
> didier
>
> On Mar 7, 6:40 am, suersh babu  wrote:
> > Hi,
> >
> > I like to known what is the maximum number of entities I can update
> within
> > the 30 sec
> > time limit of App engine.
> >
> > Let say If I have a kind called "Employee" which  has 2000 entities and
> each
> > of this entity have
> > 10 Properties,  so if I need to update all of this 2000 entities of
> > Employee,  what is the maximum
> > entities that I can update  within 30 sec time limit.
> >
> > Any suggestion much appreciated.
> >
> > *Regards**
> >
> > Suresh Babu G*
> >
> > http://www.AccountingGuru.in
>
> --
> You received this message 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.
>
>


-- 
*Regards**

Suresh Babu G*

http://www.AccountingGuru.in 

-- 
You received this message 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: What is maximum number of entities I can update within the 30 sec time limit of App engine ?

2011-03-07 Thread Matija
If your user starts some action that updates a lot of entities and you need 
to show him soon after that action all or many of these entities then you 
should probably change your entities model or user interface.

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



[appengine-java] Re: compute intensive application

2011-03-07 Thread Simon Knott
A few thoughts:

   - Are you taking into consideration loading requests?  These will cause 
   pauses which can last a few seconds.
   - Have you enabled warm-up requests?
   - What do your logs say are causing the 5xx errors?
   - Have you looked at the logs for what may be causing the long pauses?  
   i.e. are they delays caused by communications between your test PC and the 
   app, or entirely within the GAE app?
   - It's very easy to set up task queues to give you the same stats and 
   give you a comparison - personally it sounds like task queues would be a 
   good fit for your requirements, based on the slightly vague 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.



[appengine-java] Re: compute intensive application

2011-03-07 Thread Didier Durand
My 2 cents:

- queues scale up very well: I tried them with no throttle (on bucket
size) and you easily get 12-15 jvm running your computations. To my
knowledge, queues are the best way to get parallelism on GAE.
but
- data access / contention may be the issue: don't you write anything
back ? That may become the issue after your big computations have run.
You may have write contentions then unless you use sharding.

We may provide more feedback but you have to disclose more on what you
want to achieve.

regards

didier

On Mar 7, 4:15 pm, Simon Knott  wrote:
> A few thoughts:
>
>    - Are you taking into consideration loading requests?  These will cause
>    pauses which can last a few seconds.
>    - Have you enabled warm-up requests?
>    - What do your logs say are causing the 5xx errors?
>    - Have you looked at the logs for what may be causing the long pauses?  
>    i.e. are they delays caused by communications between your test PC and the
>    app, or entirely within the GAE app?
>    - It's very easy to set up task queues to give you the same stats and
>    give you a comparison - personally it sounds like task queues would be a
>    good fit for your requirements, based on the slightly vague 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.



[appengine-java] Re: compute intensive application

2011-03-07 Thread broiyan
Simon: The long pauses (5 to 30 seconds or more) are definitely not inside 
the servlet since the servlet measures time spent within itself (0.9 seconds 
to 2 seconds for what should take 1 second).  

Didier: 12 to 15 JVMs sounds disappointing since I think I need about 1000 
to make it attractive for users.  I believe Task Queues do not use HTTP 
responses so your point about data store contention might be a problem but I 
have not implemented any test code for the data store.  

I will post more information as I analyze the problem and implement your 
suggestions.  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.



[appengine-java] Re: compute intensive application

2011-03-07 Thread Simon Knott
Your GAE logs should be able to give you more information as to whether the 
pauses are within GAE, or connectivity/routing issues.

What exactly are you trying to do?  1000 JVMs seems quite excessive

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



[appengine-java] Re: compute intensive application

2011-03-07 Thread Didier Durand
Hi,

I gave my number of 12-15 because that's all what I have used
personally until now but you surely can go much higher

regards

didier

On Mar 7, 6:02 pm, broiyan  wrote:
> Simon: The long pauses (5 to 30 seconds or more) are definitely not inside
> the servlet since the servlet measures time spent within itself (0.9 seconds
> to 2 seconds for what should take 1 second).  
>
> Didier: 12 to 15 JVMs sounds disappointing since I think I need about 1000
> to make it attractive for users.  I believe Task Queues do not use HTTP
> responses so your point about data store contention might be a problem but I
> have not implemented any test code for the data store.  
>
> I will post more information as I analyze the problem and implement your
> suggestions.  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.



[appengine-java] Re: running example app get error java.lang.IllegalArgumentException: appId not set

2011-03-07 Thread Liendro Jose
?

-- 
You received this message 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] java.lang.RuntimeException: FacesContext not found

2011-03-07 Thread sri
hi all,

I am getting java.lang.RuntimeException: FacesContext not found
when running my sample faces project in GAE. My web.xml looks like
this,


http://www.w3.org/2001/XMLSchema-instance";
xmlns="http://java.sun.com/xml/ns/javaee"; xmlns:web="http://
java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
version="2.5">



org.apache.myfaces.config.annotation.LifecycleProvider
org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider




org.apache.myfaces.SECRET
NzY1NDMyMTA=




javax.faces.DEFAULT_SUFFIX
.xhtml





Faces Servlet
javax.faces.webapp.FacesServlet



Faces Servlet
*.jsf




index.html


please help me to resolve this issue.

thank you
sri

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



[appengine-java] Re: Login redirect failing all of a sudden /_ah/conflogin

2011-03-07 Thread Ralph
Hi,

I'm also seeing this issue.

Is it related also to the fact that I have multiple login enabled?

If someone that has solved it, can post some example code, that would
be appreciated.

Thanks,
Ralph

On Mar 4, 2:59 pm, Jon McAlister  wrote:
> The workaround is to have the app perform the redirect. That is,
> createLoginUrl only works when the continue url is a url for the app.
> If you need the user to be sent to another app/host after login, then
> your app needs to do that redirect.
>
>
>
>
>
>
>
> On Fri, Mar 4, 2011 at 11:47 AM, Glenn  wrote:
> > What was the "good workaround"?  Our login is broken, too.
>
> > We have two App Engine apps: one is the front end and one the back
> > end,
> > with a REST API.  When the user accesses the front end a call to the
> > back end is made where
>
> > redirect = userService.createLoginURL();
>
> > is called.  In this case both apps have appspot.com urls and
> > it worked well.  We are dead in the water now.
>
> > Please help!
>
> > Thanks,
> > Glenn
>
> > On Mar 2, 12:31 pm, Jon McAlister  wrote:
> >> Looks like you pushed a good workaround already, but yes that was a
> >> result of a new login system yesterday, and looks like it is not
> >> handling this case like the prior system did.
>
> >> Specifically, calling createLoginUrl where the continue url is not the
> >> same as the url the app is hosted on. And, furthermore, the continue
> >> url is not an app engine url at all.
>
> >> For now, what you did was a good workaround. That is, use an app
> >> engine url as the continue url, and then have the app engine app
> >> redirect to the non-app-engine url.
>
> >> Need to think on this case some more.
>
> >> On Wed, Mar 2, 2011 at 7:53 AM, Joerg Weingarten  
> >> wrote:
> >> > Since this morning my call to "userservice.createLoginUrl" produces a
> >> > url that doesn't work anymore. When selecting my "Sign in" link, which
> >> > has a url like:
>
> >> >https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&;...
>
> >> > I get the error:
>
> >> > The requested URL /_ah/conflogin was not found on this server.
>
> >> > Somebody please help.
>
> >> > Thx
> >> > ---Joerg---
>
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "Google App Engine for Java" group.
> >> > To post to this group, send email to 
> >> > google-appengine-java@googlegroups.com.
> >> > To unsubscribe from this group, send email to 
> >> > google-appengine-java+unsubscr...@googlegroups.com.
> >> > For more options, visit this group 
> >> > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Need Help in Unit Testing (How to convert btw Entity and JDO class)

2011-03-07 Thread Erencie
I am quite confused when I read the instructions about unit testings
on the official site. It mentions that we need to have
LocalServiceTestHelper set up to do the unit testings. Currently, I
have a huge system which consists of 6 different JDO persistent data
classes; and in testings I would definitely need to create some of
these data objects and operate on them. But the DatastoreService thing
stated in the instruction page, can only put in Entity object.

sth like this:
DatastoreService ds =
DatastoreServiceFactory.getDatastoreService();
Entity coordinator = new Entity("Coordinator");
coordinator.setProperty("googleAccount", "lailailai");
coordinator.setProperty("name", "Ms Lai");
ds.put(coordinator);
coordinatorKey = coordinator.getKey();

However, what I really want to have is an object of the following data
class:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Coordinator {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private String googleAccount;

@Persistent
private String name;

@Persistent
private List courses;

public Coordinator(String googleAccount, String name) {
super();
this.googleAccount = googleAccount;
this.name = name;
this.courses = new ArrayList();
}

public void addCourse(Key c){
courses.add(c);
}

/*getters and setters */
}

I have been searching for a few hours, on the way how to convert
between the Entity thing and a normal JDO object. Because I really
don't think this Entity object, which I can only use the setProperty()
method to set its values, and have no ways to define its methods (you
can see that I not only have getters and setters, but also other
methods like addCourse), can let me do the unit testing in the way
that can really test my existing system.

I tried to use PersistenceManager as well, because I used it in my
normal codes. But it fails with an error called
"java.lang.NullPointerException: No API environment is registered for
this thread".

Please help me on this. Thanks very much!

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



[appengine-java] Re: running example app get error java.lang.IllegalArgumentException: appId not set

2011-03-07 Thread Liendro Jose
Hi, i have the same problem and lucky i resolved :p , first remove
from WEB-INF/lib all appengine and datanucleus jars that have old
version that App engine SDK library. For example in my App engine
eclipse library i had appengine-api-1.0-sdk-1.4.2.jar and in WEB-INF/
lib directory i had and old version like  appengine-api-1.0-
sdk-1.2.1.jar so delete those files.

So you will fix this message: java.lang.IllegalArgumentException:
appId not set

I  you continue with problems to see the example. Prube this.

comment from homepage.java add ListPersonalPanel and the wicket tag
from the homepage.html,
Then run the example an add at least one person, and then undo the
comments.

And thats all!
Enjoy !

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



[appengine-java] Re: Login redirect failing all of a sudden /_ah/conflogin

2011-03-07 Thread Lars Rönnbäck
Where and when was this change announced? It is causing a major
inconvenience right now before we are able to push a new release with
the suggested "workaround". I don't want to end up in this situation
ever again.

We have built a client-side web application using HTML5 that stores
information in the "cloud" using Google App Engine, and we need to
redirect back to the site hosting the client app after the login. The
funny thing is that after I see the error and go back to the site
hosting the client app I am still not logged in, so I suppose that
there is an extra step in the login procedure that does not got
executed right now?

Regards,
Lars


On Mar 4, 8:59 pm, Jon McAlister  wrote:
> The workaround is to have the app perform the redirect. That is,
> createLoginUrl only works when the continue url is a url for the app.
> If you need the user to be sent to another app/host after login, then
> your app needs to do that redirect.
>
>
>
>
>
>
>
> On Fri, Mar 4, 2011 at 11:47 AM, Glenn  wrote:
> > What was the "good workaround"?  Our login is broken, too.
>
> > We have two App Engine apps: one is the front end and one the back
> > end,
> > with a REST API.  When the user accesses the front end a call to the
> > back end is made where
>
> > redirect = userService.createLoginURL();
>
> > is called.  In this case both apps have appspot.com urls and
> > it worked well.  We are dead in the water now.
>
> > Please help!
>
> > Thanks,
> > Glenn
>
> > On Mar 2, 12:31 pm, Jon McAlister  wrote:
> >> Looks like you pushed a good workaround already, but yes that was a
> >> result of a new login system yesterday, and looks like it is not
> >> handling this case like the prior system did.
>
> >> Specifically, calling createLoginUrl where the continue url is not the
> >> same as the url the app is hosted on. And, furthermore, the continue
> >> url is not an app engine url at all.
>
> >> For now, what you did was a good workaround. That is, use an app
> >> engine url as the continue url, and then have the app engine app
> >> redirect to the non-app-engine url.
>
> >> Need to think on this case some more.
>
> >> On Wed, Mar 2, 2011 at 7:53 AM, Joerg Weingarten  
> >> wrote:
> >> > Since this morning my call to "userservice.createLoginUrl" produces a
> >> > url that doesn't work anymore. When selecting my "Sign in" link, which
> >> > has a url like:
>
> >> >https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&;...
>
> >> > I get the error:
>
> >> > The requested URL /_ah/conflogin was not found on this server.
>
> >> > Somebody please help.
>
> >> > Thx
> >> > ---Joerg---
>
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "Google App Engine for Java" group.
> >> > To post to this group, send email to 
> >> > google-appengine-java@googlegroups.com.
> >> > To unsubscribe from this group, send email to 
> >> > google-appengine-java+unsubscr...@googlegroups.com.
> >> > For more options, visit this group 
> >> > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Help me understand adding objects to existing entity groups

2011-03-07 Thread mscwd01
Pardon my ignorance, I have read the docs over and over and this still
alludes me.

I have two objects, lets call them "User" and "Skill". When a person
signs up to my site they are saved as a "User". A user may have
multiple skills, these are stored as a list within the User object,
e.g.

@Persistent @Element(dependent = "true")
private List skills;

Now what I need to determine is how to add a Skill object to the User
entity group when I create it, as I need to modify both objects within
a single transaction.

When I create Skill objects do I have to supply the User key to the
new Skill object somehow?

I'd appreciate any help I can get with this, 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.



Re: [appengine-java] how to keep fields unique

2011-03-07 Thread emurmur
It turns out the technique I described in my previous post has two issues.

1. Because only one transaction can be running at a time within a process, 
and the entity used as the mutex really cannot be in the same entity group 
as the primary entity, you can get into a situation where the mutex entity 
is orphaned if one transaction succeeds and the following transaction fails. 
 The orphaned mutex entity then prevents anyone for using it's version of 
the unique fields.

2. This solution, when used with JDO or JPA, is very verbose and obfuscates 
the primary intent of the code.  Also, you would never to do this with an 
SQL datastore, so it limits the portability of the code, which is why one 
would choose JDO/JPA in the first place.

Really, we want the uniqueness annotations to be implemented.

There is an issue in the bugbase for this, issue 178.  Folks have been 
talking about this for a long time.  Please star this issue if it is 
important to you.

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


-- 
You received this message 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] Query on a child or grand child object

2011-03-07 Thread oceandrive
I have two objects Employee, Address. Each employee has a list of addresses 
init and also has a String status of current/retired/left/fired.Now I want 
to get a list of all my current employees who are Houston based.

Class Employee {
@Persistent(mappedBy="employee")
List addresses;
String status;
}

Class Address {
@Persistent 
private Employee employee;
String address1;
String city;
String zip;
}

Query query = pm.newQuery(Employee.class, whereClause.toString());

List empList = (List) 
query.executeWithArray(paramValues.toArray());


When I set my status parameter to current, it will give me a list of current 
employees, how do i add the condition of "Houston" into my query so that I 
dont have to do the filter by myself.

I feel that I am missing something. Appreciate you 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-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 App Engine Java Cookbook Sceencast

2011-03-07 Thread Vinny
Awesome! I will be there as well. See you in Atlanta!
--
biz: http://www.linkedin.com/in/vincentstoessel/
personal: http://xaymaca.tumblr.com/



On Sat, Mar 5, 2011 at 11:45 PM, systemsplanet  wrote:
> I'm demoing Google App Engine at DevNexus 2011 on March 21st as part
> of David Chandler's (turbomanage.wordpress.com) GAE presentation.
> If you can't come see the demo, you can view the fast-paced screencast
> from this link:
> http://goo.gl/UT2W3
>
> It contains a cookbook for building a complete environment from
> scratch that contains the latest Java Developers Kit, Eclipse IDE,
> Google App Engine (GAE) plugin, GAE SDK, and a real working Java
> application (memwords) running locally and on a production Google App
> Engine server at appspot.com.
>
> If you don't like the presentation, I hope you'll appreciate the
> music.
> Ronald Jenkees (www.DisorganizedFun.com) was kind enough to give me
> permission.
>
> Your comments and feedback are appreciated.
>
> mike lawrence
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] Re: Need Help in Unit Testing (How to convert btw Entity and JDO class)

2011-03-07 Thread lp
i havent unit tested with JDO but with JPA.
But i expect it to work the same.

the example on the 
http://code.google.com/appengine/docs/java/tools/localunittesting.html
is using the datastoreService, since u are using JDO u will need a
persistence manager.

no need for 'Entity' just use JDO or JPA.

The magic is done by the LocalServiceTestHelper.setup

so your problem is the error  below

>java.lang.NullPointerException: No API environment is registered for
>this thread".

This means there is no datastore attached to your pm.

Post your code for test setup and pm initialisation.

-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-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] Undocumented limit on URL length?

2011-03-07 Thread Jeff Schnitzer
Is there an undocumented limit on the length of a URL that can be
fetched using the URLFetch service?  There is no mention of a limit in
this document, other than 1MB total for the request:

http://code.google.com/appengine/docs/java/urlfetch/overview.html#Quotas_and_Limits

I'm getting a MalformedURLException for a long URL in production, but
the same URL works in development mode.  It works fine in my web
browser.  Sure it's long, but it's considerably less than 1MB:

Caused by: java.net.MalformedURLException: Invalid URL:
https://graph.facebook.com/?ids=112715298743415%2C113141485366719%2C110648495631656%2C107874725900895%2C103789119660307%2C109789650521%2C8113612185%2C2629328%2C108338382531085%2C109592195726412%2C109556179067475%2C103780659661402%2C110540392307856%2C375498579919%2C107733585923064%2C102192013155767%2C112416715450556%2C369814299093%2C23857229312%2C360224153735%2C9588466619%2C9238887431%2C105962892767348%2C108336392524593%2C108551835835308%2C108132462548163%2C108061509226495%2C107596389263408%2C107891192578566%2C10730674914%2C329320336203%2C179904182470%2C183428723743%2C21120399783%2C238410809235%2C15526475270%2C27718836983%2C62584386098%2C109228465762435%2C11008265843%2C113401482006986%2C112523098766522%2C109397672419606%2C109245185760828%2C104082509629039%2C109504635734027%2C112386398773541%2C109917972366980%2C109607099058714%2C112176132131614%2C111961145486420%2C112146992135978%2C106066639425552%2C105552292810463%2C110882212267421%2C114849868527500%2C79275359665%2C109467452413237%2C108609262497058%2C108026662559095%2C110917952266916%2C107964079225923%2C107874252574398%2C103121346395064%2C107982762555794%2C109493695735233%2C22476490672%2C112666112079762%2C24129876949%2C109578075726490%2C110581235630092%2C115057208508639%2C102182676489755%2C115946728419025%2C106224942746592%2C108057322549332%2C107744555922007%2C114967135183020%2C36400348187%2C112409342103458%2C108203779203751%2C114546728587728%2C103100643063941%2C107953175893767%2C106448446058259%2C107812659248352%2C108357189196052%2C6132182491%2C17893008278%2C108213575873147%2C15650321041%2C103794206325342%2C111281302224085%2C106313766066544%2C181825735167620%2C112764105404927%2C114031331940797%2C109407349077296%2C103761906329426%2C106023152771806%2C109558222395150%2C103280426370878%2C105470232819915%2C114267748588304%2C109768032382897%2C102144649827989%2C5978057725%2C111049252246725%2C111938278824796%2C108157509212483%2C112726518739653%2C103775829661402%2C6815841748%2C112570395422274%2C109401065752952%2C116209025059537%2C103092196397515%2C97782555186%2C110833228941984%2C113051992042775%2C120694114630885%2C24718773587%2C112109125471810&format=json&access_token=REDACTED
at 
com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:106)
at 
com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:41)
at 
com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:418)
at 
com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:297)
at 
com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getResponseCode(URLFetchServiceStreamHandler.java:150)
at 
com.googlecode.batchfb.FacebookBatcher.fetchGraph(FacebookBatcher.java:840)
... 87 more

Thanks,
Jeff

-- 
You received this message 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] Sub domain for static content

2011-03-07 Thread Jeff Knox
I am sure this is a simple thing but my brain just doesn't want to make it 
so simple today.

Say I point two sub-domains to my application:

www.mydomain.com
app.mydomain.com

That is all well and good - both now serve up my application. What I would 
like is for the WWW sub-domain to serve up static HTML or JSP files while 
the "APP" sub-domain serves up my application. Is this something I can do in 
the web.xml mapping or do I need another servlet sitting on top to direct 
the requests to the correct place?

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.



Re: [appengine-java] Sub domain for static content

2011-03-07 Thread Nick Johnson (Google)
Hi Jeff,

There's no way to distinguish based on domain in app.yaml/web.xml. You'll
need to either have the same mappings in both (but only request static files
off one of the domains) or use a servlet and serve them dynamically.

-Nick Johnson

On Mon, Mar 7, 2011 at 5:56 PM, Jeff Knox  wrote:

> I am sure this is a simple thing but my brain just doesn't want to make it
> so simple today.
>
> Say I point two sub-domains to my application:
>
> www.mydomain.com
> app.mydomain.com
>
> That is all well and good - both now serve up my application. What I would
> like is for the WWW sub-domain to serve up static HTML or JSP files while
> the "APP" sub-domain serves up my application. Is this something I can do in
> the web.xml mapping or do I need another servlet sitting on top to direct
> the requests to the correct place?
>
> 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.
>



-- 
Nick Johnson, Developer Programs Engineer, App Engine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Sub domain for static content

2011-03-07 Thread Jeff Knox
Nick, thanks for the reply.

Can you elaborate on the first option? I'm not sure what you mean by the 
"same mappings in both." (Yes my brain is mush today.)

In my current configuration I have a single application (yet another photo 
gallery). I would like www.jeffknox.com to go to my "general" web pages 
while "photography.jeffknox.com" goes to the gallery. Right now they both 
point to the app as I've been in testing.

The way I'm reading your post is that you are suggesting that I have two 
applications - one for the static pages and mapped to "www" and one for the 
gallery mapped to "photography". Is that correct?

As far as the second option. I suppose it really wouldn't add that much 
overhead to setup a traffic director servlet. I would just need to figure 
out how to forward to the static pages.

I guess a third option would be to host the WWW pages on another server.

-- 
You received this message 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] Google apps account does not remove appengine service

2011-03-07 Thread Vik
Hie

i have a google apps account for domain sakshum.org. We added app engine
service signed with account v...@sakshum.org (which is the admin account)

Now even after repeated try to disable this service from dashboard it does
not go we waited also for a day etc just in case it takes time etc. but
no luck.
any advise please?


Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com

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



[appengine-java] Re: Creating/Compiling new Java class at run time

2011-03-07 Thread Rick Smith
Any update guys?

On Mar 7, 1:13 pm, Rick Smith  wrote:
> Hi all
>
> Can I create and compile a java class at run time on goolge
> appengine.
> Use case: I have given a UI to my application user that they can
> define their own business logic.Now what is going to be main challenge
> is that I need to make new deployment each time when some one need to
> modify its business logic. As an alternate I want to store source code
> in data base and compile it when required.
>
> Regards
>
> Rick

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



[appengine-java] Re: Undocumented limit on URL length?

2011-03-07 Thread Didier Durand
Hi Jeff,

According to this (http://groups.google.com/group/google-appengine-
java/browse_thread/thread/8d61f5f3557cf480/67714225354b72d1?
lnk=gst&q=max+url+size#67714225354b72d1) it's 2072.

regards

didier

On Mar 8, 1:26 am, Jeff Schnitzer  wrote:
> Is there an undocumented limit on the length of a URL that can be
> fetched using the URLFetch service?  There is no mention of a limit in
> this document, other than 1MB total for the request:
>
> http://code.google.com/appengine/docs/java/urlfetch/overview.html#Quo...
>
> I'm getting a MalformedURLException for a long URL in production, but
> the same URL works in development mode.  It works fine in my web
> browser.  Sure it's long, but it's considerably less than 1MB:
>
> Caused by: java.net.MalformedURLException: Invalid 
> URL:https://graph.facebook.com/?ids=112715298743415%2C113141485366719%2C1...
>         at 
> com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:106)
>         at 
> com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:41)
>         at 
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:418)
>         at 
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:297)
>         at 
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getResponseCode(URLFetchServiceStreamHandler.java:150)
>         at 
> com.googlecode.batchfb.FacebookBatcher.fetchGraph(FacebookBatcher.java:840)
>         ... 87 more
>
> Thanks,
> Jeff

-- 
You received this message 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] Request CPU variance with 'Always-on'

2011-03-07 Thread lp
hi all,

i have getting large variance in my request and api cpu.

I have read the countless articles on the topic and the quota doc.

what i am seeing is *not* do to process startup as i have 'Always on'
enabled since there is no more of the ' This request required a
process to startup.

Below are a sample of the logs for the same query within 15 minutes.

2011-03-07 22:07:56.183 /fbconnect/update 200 157ms 518cpu_ms
261api_cpu_ms
2011-03-07 22:06:18.738 /fbconnect/update 200 310ms 611cpu_ms
261api_cpu_ms
2011-03-07 21:56:23.973 /fbconnect/update 200 309ms 518cpu_ms
261api_cpu_ms
2011-03-07 21:51:55.193 /fbconnect/update 200 663ms 985cpu_ms
261api_cpu_ms
2011-03-07 21:50:30.879 /fbconnect/update 200 157ms 448cpu_ms
261api_cpu_ms

the same query is being executed each time but the results have an
enormous variance on the elapsed time and request cpu.

Q1.what is causing this variance... my code or appengine accounting?

On the positive the api cpu is constant at 261.

any help is most welcome.

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



[appengine-java] Re: uploading 100k lines into the datastore is enough to max out the CPU time?

2011-03-07 Thread captain

Hi Claudio

Try makePersistentAll()

It will certainly help

Cheers
CB


On Mar 7, 2:57 am, Cláudio Coelho  wrote:
> Since the bottleneck occurs when making objects of Location
> persistent, I assume that is the only relevant class. If anything else
> is relevant, tell me and I'll disclose.
>
> @PersistenceCapable(identityType =
> IdentityType.APPLICATION,detachable="true")
> public class Location{
>         @PrimaryKey
>         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         Long locationId;
>         @Persistent
>         long countryId;
>         @Persistent
>         String name;
>         @Persistent
>         String country=null;
>         @Persistent
>         double latitude,longitude;
>         @Persistent
>         int population;
>         @Persistent
>         long geoBoxL1,geoBoxL2,geoBoxL3,geoBoxL4,geoBoxL5;
>         public Location()
>         {
>
>         }
>         public Location(String name, long countryId,String country, double
> latitude, double longitude)
>         {
>                 this.name=name;
>                 this.countryId=countryId;
>                 this.latitude=latitude;
>                 this.longitude=longitude;
>                 this.country=country;
>         }
>         public Location(LocationDTO dto) {
>                 this();
>                 updateFromDTO(dto);
>         }
>
>         public void updateFromDTO(LocationDTO dto) {
>                 setLocationId(dto.getLocationId());
>                 setCountryId(dto.getCountryId());
>                 setCountry(dto.getCountry());
>                 setName(dto.getName());
>                 setPopulation(dto.getPopulation());
>                 setLatitude(dto.getLatitude());
>                 setLongitude(dto.getLongitude());
>                 setGeoBoxL1(dto.getGeoBoxL1());
>                 setGeoBoxL2(dto.getGeoBoxL2());
>                 setGeoBoxL3(dto.getGeoBoxL3());
>                 setGeoBoxL4(dto.getGeoBoxL4());
>                 setGeoBoxL5(dto.getGeoBoxL5());
>
>         }
>         public LocationDTO getDTO()
>         {
>                 LocationDTO dto = new LocationDTO();
>                 dto.setLocationId(getLocationId());
>                 dto.setCountryId(getCountryId());
>                 dto.setCountry(getCountry());
>                 dto.setName(getName());
>                 dto.setPopulation(getPopulation());
>                 dto.setLatitude(getLatitude());
>                 dto.setLongitude(getLongitude());
>                 dto.setGeoBoxL1(getGeoBoxL1());
>                 dto.setGeoBoxL2(getGeoBoxL2());
>                 dto.setGeoBoxL3(getGeoBoxL3());
>                 dto.setGeoBoxL4(getGeoBoxL4());
>                 dto.setGeoBoxL5(getGeoBoxL5());
>
>                 return dto;
>         }
>
>         public long getLocationId() {
>                 return locationId;
>         }
>         public void setLocationId(long locationId) {
>                 this.locationId = locationId;
>         }
>         public String getCountry() {
>                 return country;
>         }
>
>         public int getPopulation() {
>                 return population;
>         }
>         public void setPopulation(int population) {
>                 this.population = population;
>         }
>         public void setCountry(String country) {
>                 this.country = country;
>         }
>
>         public long getCountryId() {
>                 return countryId;
>         }
>         public void setCountryId(long countryId) {
>                 this.countryId = countryId;
>         }
>         public String getName() {
>                 return name;
>         }
>         public void setName(String name) {
>                 this.name = name;
>         }
>         public double getLatitude() {
>                 return latitude;
>         }
>         public void setLatitude(double latitude) {
>                 this.latitude = latitude;
>         }
>         public double getLongitude() {
>                 return longitude;
>         }
>         public void setLongitude(double longitude) {
>                 this.longitude = longitude;
>         }
>
>         public long getGeoBoxL1() {
>                 return geoBoxL1;
>         }
>         public void setGeoBoxL1(long geoBoxL1) {
>                 this.geoBoxL1 = geoBoxL1;
>         }
>         public long getGeoBoxL2() {
>                 return geoBoxL2;
>         }
>         public void setGeoBoxL2(long geoBoxL2) {
>                 this.geoBoxL2 = geoBoxL2;
>         }
>         public long getGeoBoxL3() {
>                 return geoBoxL3;
>         }
>         public void setGeoBoxL3(long geoBoxL3) {
>                 this.geoBoxL3 = geoBoxL3;
>         }
>         public long getGeoBoxL4() {
>                 return geoBoxL4;
>         }
>         public void setGeoBoxL4(long geoBoxL4) {
>                 this.geoBoxL4 = geoBoxL4;
>         }
>         public long getGeoBoxL5() {
>                 return geoBox

[appengine-java] Re: Request CPU variance with 'Always-on'

2011-03-07 Thread lp
looking thru logs and even worse variance

2011-03-07 23:06:10.153 /fbconnect/update?id=37002 200 326ms
1862cpu_ms 1652api_cpu_ms
2011-03-07 23:02:28.721 /fbconnect/update?id=37002 200 347ms
1842cpu_ms 1585api_cpu_ms
2011-03-07 23:02:28.675 /fbconnect/update?id=37002 200 217ms 506cpu_ms
156api_cpu_ms
2011-03-07 22:53:08.199 /fbconnect/update?id=37002 200 737ms
2135cpu_ms 1585api_cpu_ms 2kb Mingle/1.1.1.3 CFNetwork/485.12.7

what is going on is my app really written that dodgy?

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



[appengine-java] Re: Help me understand adding objects to existing entity groups

2011-03-07 Thread Ian Marshall
Have you looked at the Google App Engine for Java persistence blog at

  http://gae-java-persistence.blogspot.com

You should find some excellent JDO and JPA working examples here. I
have found these very beneficial for me.

There are other persistence interfaces available for GAE/J as well as
JDO and JPA: Twig, Objectify,  If you haven't yet chosen your
persistence interface, time spent choosing wisely will be an
investment which should pay off handsomely.


On Mar 7, 8:03 pm, mscwd01  wrote:
> Pardon my ignorance, I have read the docs over and over and this still
> alludes me.
>
> I have two objects, lets call them "User" and "Skill". When a person
> signs up to my site they are saved as a "User". A user may have
> multiple skills, these are stored as a list within the User object,
> e.g.
>
> @Persistent @Element(dependent = "true")
> private List skills;
>
> Now what I need to determine is how to add a Skill object to the User
> entity group when I create it, as I need to modify both objects within
> a single transaction.
>
> When I create Skill objects do I have to supply the User key to the
> new Skill object somehow?
>
> I'd appreciate any help I can get with this, 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.



[appengine-java] How to check App Engine's Mail Quota?

2011-03-07 Thread Chandana Napagoda
Hi,

Is there any way to check Google App Engine reaming Quota?I need to
check Quota using Java Api. How can I do it?

Thank You.

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