Re: [appengine-java] Re: Why should app startup times be a problem.

2010-04-01 Thread Yasuo Higa
Hi Jeff,

 In other words, Twig cannot perform the simple query:

 IterableObject foo = ofy.query().ancestor(yourobject);

 If you ever want to support something like this, you will need a
 registration process.

 If you ever want to support true polymorphic queries, you will need a
 registration process.

Slim3 supports kindless ancestor queries and true polymorphic queries,
and does not need a registration process.

http://sites.google.com/site/slim3appengine/slim3-datastore/queries-and-indexes/introducing-queries
http://sites.google.com/site/slim3appengine/slim3-datastore/polymorphic-model

Yasuo Higa

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



[appengine-java] Re: Discussion on will-it-play-in-app-engine

2010-04-01 Thread Trung
I tried myfaces 2.0.0 beta 3 successfully.

All you need is myfaces jars, EL implementation jars (I used EL jars
from Tomcat) and a context parameter
  context-param
param-
nameorg.apache.myfaces.config.annotation.LifecycleProvider/param-
name
param-
valueorg.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider/
param-value
  /context-param

I am not sure NoInjectionAnnotationLifecycleProvider is suitable for
you.

Hope this help.
http://www.gdevelop.com/w/blog/2010/04/01/myfaces-2-0-on-gae/


On Mar 31, 3:01 pm, Haroon Idrees haroo...@gmail.com wrote:
 Please Help
 I want to test JSF 2.0 over google Appengine ,I followed all
 instruction given 
 athttps://sites.google.com/a/wildstartech.com/adventures-in-java/Java-P...

 But still getting this error

 java.lang.NoClassDefFoundError: javax.naming.InitialContext is a
 restricted class. Please see the Google  App Engine developer's guide
 for

 This change is only using 1.3.2 latest  sdk on ubuntu

-- 
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: Why should app startup times be a problem.

2010-04-01 Thread John Patterson

On 1 Apr 2010, at 12:51, Jeff Schnitzer wrote:


In other words, Twig cannot perform the simple query:

IterableObject foo = ofy.query().ancestor(yourobject);


All queries that are possible with the low-level datastore are  
possible with Twig because there are low-level to type-safe bridge  
methods.  So you can simply do a typeless low-level ancestor query and  
then get Twig to convert the resulting Entities into typesafe instances.


Quite frankly there just hasn't yet been the need to build un-typed  
queries into the API.  But if a good common use case arises then it  
would fit in nicely to the FindCommand.



If you ever want to support something like this, you will need a
registration process.


That is a completely incorrect conclusion to jump to.  As I said,   
there actually was a very similar untyped query in the API that I  
removed because it didn't seem so useful.


I am curious about what limitations Objectify has that makes this a  
requirement.  This thread (or this forum) is probably not the best  
place to discuss the internal implementation details of future  
features for Twig or Objectify so it might be better to take this  
topic offline.



If you ever want to support true polymorphic queries, you will need a
registration process.


Just wrong.  What ever makes you claim that?


Don't claim this short-sightedness as a feature.



Think twice before posting replies at the end of a long day.

--
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] java.lang.ClassNotFoundException: com.google.appengine.tools.appstats.AppstatsFilter

2010-04-01 Thread Prashant Gupta
   1.  Hi,

   I am getting following error while trying to setup
Appstatshttp://code.google.com/appengine/docs/java/tools/appstats.htmlfor
my app. Please help me to find out where I am wrong. I am using SDK
   v1.3.2.


04-01 12:40AM 46.303


   EXCEPTION
   java.lang.ClassNotFoundException:
com.google.appengine.tools.appstats.AppstatsFilter
at 
com.google.appengine.runtime.Request.process-38b1e357c1771780(Request.java)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:81)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at 
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:243)
at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5485)
at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5483)
at 
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at 
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
at 
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:536)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:369)
at 
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:442)
at 
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
at 
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:474)
at 
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831)
at 
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103)
at 
com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
at 
com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:404)
at java.lang.Thread.run(Unknown Source)

   2.  W04-01 12:40AM 46.308


   Failed startup of context
com.google.apphosting.utils.jetty.runtimeappenginewebappcont...@35eed0{/,/base/data/home/apps/nextprashant/wittyapps-v0-61.340927900673672452}
   javax.servlet.UnavailableException:
com.google.appengine.tools.appstats.AppstatsFilter
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:81)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at 
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:243)
at 

Re: [appengine-java] Re: Why should app startup times be a problem.

2010-04-01 Thread Jeff Schnitzer
On Thu, Apr 1, 2010 at 12:45 AM, John Patterson jdpatter...@gmail.com wrote:

 All queries that are possible with the low-level datastore are possible with
 Twig because there are low-level to type-safe bridge methods.  So you can
 simply do a typeless low-level ancestor query and then get Twig to convert
 the resulting Entities into typesafe instances.

That's nonsense.  This could only work if you've either encoded the
full java package and classname into the Entity (a colossal mistake)
or you've somehow registered a mapping (typically from Kind, but it
could be any synthetic field) to the java class ahead of time.  This
means that

Your framework can't perform magic.  A truly polymorphic query (of
which ancestor queries are one flavor) doesn't know the concrete type
of the object until it's fetched from the datastore.  If you don't
understand this, you haven't thought about the problem enough.

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-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: Why should app startup times be a problem.

2010-04-01 Thread John Patterson


On 1 Apr 2010, at 15:04, Jeff Schnitzer wrote:


or you've somehow registered a mapping (typically from Kind, but it
could be any synthetic field) to the java class ahead of time.  This
means that


You are making a classic premature optimization mistake.

Twig is built on the principal that it should work out of the box with  
*zero* configuration and then allow optimizations to increase  
performance after the application is up and running.  According to  
this principal safe defaults are needed for many settings: all fields  
are indexed by default, all fields are stored by default and all  
references are stored as independent entities (c.f. embedded, parent  
or child entities).


The only String value that can uniquely identify a class with no  
registration is its fully qualified type name.  I see no problem  
using that kind name as a sensible default.  There is nothing special  
about it - its just a default that can be changed later.  In fact I  
recommend defining a shorter name as an optimisation to save datastore  
space.


If you rename your class and want to keep the same data you will need  
to explicitly define the kind name for the class.



Your framework can't perform magic.


Actually it does contain a small bit of magic but it's not well  
documented.



A truly polymorphic query (of
which ancestor queries are one flavor) doesn't know the concrete type
of the object until it's fetched from the datastore.  If you don't
understand this, you haven't thought about the problem enough.


Chill Jeff...  I've thought about the problem and so has Yasuo.  I  
imagine this sensible default will eventually make its way into  
Objectify once you think about it some more :)


Now lets keep this in perspective: on my mac mini I can run about 3  
million reflective calls to get a constructor in a second.  I do not  
claim that enforced registration is bad for startup times - it is  
almost insignificant.  Its just a pain in the ass when a default can  
handle it for you out-of-the-box.


John

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



Re: [appengine-java] Re: Why should app startup times be a problem.

2010-04-01 Thread John Patterson


On 1 Apr 2010, at 14:58, Jeff Schnitzer wrote:

If you go with #2, you've just created a framework that will break
your datastore when you rename your Java objects.  I'll assume nobody
thinks this is actually a good idea.


From a quick browse of the Objectify source code it looks to me like  
the default is to use Class.getSimpleName() for the kind name which  
will also break on renaming and doesn't even have the advantage of  
working out-of-the-box with no registration.


--
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: Why should app startup times be a problem.

2010-04-01 Thread Jeff Schnitzer
On Thu, Apr 1, 2010 at 1:57 AM, John Patterson jdpatter...@gmail.com wrote:

 You are making a classic premature optimization mistake.
 [...]
 The only String value that can uniquely identify a class with no
 registration is its fully qualified type name.  I see no problem using
 that kind name as a sensible default.  There is nothing special about it -
 its just a default that can be changed later.  In fact I recommend defining
 a shorter name as an optimisation to save datastore space.
 If you rename your class and want to keep the same data you will need to
 explicitly define the kind name for the class.

1) I vehemently disagree that fully-qualified java class names should
show up in the datastore.  It's one of those things that nobody
notices at the beginning and then becomes cruft that is difficult to
change sometime later.  Ask any DBA what they think of creating tables
named com.mycompany.project.component.entity.MyEntity - and it's
*way* easier to change table names on an RDBMS than it is in GAE.

2) As you note, long kind names will significantly increase your
storage requirements.  Full package paths in the kind name are just a
bad idea.

3) If you rename your class (or use a shorter name), you will need to
register your entities ahead of time.  That is, if you want
polymorphic queries to work.

So... you've avoided registration in the simple, un-shortened case
(which you don't recommend) by storing full java package paths in the
datastore.  You call registration premature optimization, I call it
planning ahead.

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-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: Why should app startup times be a problem.

2010-04-01 Thread Jeff Schnitzer
On Thu, Apr 1, 2010 at 2:19 AM, John Patterson jdpatter...@gmail.com wrote:

 From a quick browse of the Objectify source code it looks to me like the
 default is to use Class.getSimpleName() for the kind name which will also
 break on renaming and doesn't even have the advantage of working
 out-of-the-box with no registration.

This approach has quite a few advantages:

 * It tends to be short
 * You can repackage at will
 * Even changing the classname is merely a question of adding
@Entity(name=OldName)

If Objectify users always register their classes explicitly, their
code will always work.  Not most of the time or for most queries
but *all of the time*.  It would be trivial to autoregister classes on
first explicit use, but it wouldn't work *all of the time*.

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-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: Why should app startup times be a problem.

2010-04-01 Thread John Patterson


On 1 Apr 2010, at 16:20, Jeff Schnitzer wrote:


1) I vehemently disagree that fully-qualified java class names should
show up in the datastore.  It's one of those things that nobody
notices at the beginning and then becomes cruft that is difficult to
change sometime later.  Ask any DBA what they think of creating tables
named com.mycompany.project.component.entity.MyEntity - and it's
*way* easier to change table names on an RDBMS than it is in GAE.


One string is pretty much as good as another as long as it is unique  
for a class.  Whether you like that string is of secondary  
importance to supporting the goal of zero-configuration



2) As you note, long kind names will significantly increase your
storage requirements.  Full package paths in the kind name are just a
bad idea.


They are un-optimised.  Optimise them later when your app or prototype  
is running and its time to tune performance.  Personally, about half  
of my data models explicitly define their kind name.  The rest either  
are not present in such large numbers to impact storage or have not  
been renamed.



3) If you rename your class (or use a shorter name), you will need to
register your entities ahead of time.  That is, if you want
polymorphic queries to work.


Yes.  That is assuming you want to keep the data that was stored with  
the old kind name.  During development/prototyping  this is not always  
the case.



So... you've avoided registration in the simple, un-shortened case
(which you don't recommend)


Exactly.  The simple case is not optimised.


You call registration premature optimization, I call it
planning ahead.


Different goals.  Working out-of-the-box with no configuration is one  
of the basic features of the using the ObjectDatastore.





--
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: Why should app startup times be a problem.

2010-04-01 Thread John Patterson


On 1 Apr 2010, at 16:26, Jeff Schnitzer wrote:

On Thu, Apr 1, 2010 at 2:19 AM, John Patterson  
jdpatter...@gmail.com wrote:


From a quick browse of the Objectify source code it looks to me  
like the
default is to use Class.getSimpleName() for the kind name which  
will also

break on renaming and doesn't even have the advantage of working
out-of-the-box with no registration.


This approach has quite a few advantages:

* It tends to be short
* You can repackage at will
* Even changing the classname is merely a question of adding
@Entity(name=OldName)

If Objectify users always register their classes explicitly, their
code will always work.  Not most of the time or for most queries
but *all of the time*.  It would be trivial to autoregister classes on
first explicit use, but it wouldn't work *all of the time*.


These advantages are also present with Twig (and presumably Slims  
implementation?).  The difference is one of defaults - you do not  
*have* to register classes to get started with Twigs ObjectDatastore.   
The defaults will just work.


To be clear, Twig *never* registers kind names for Classes on first  
use.  What it does do is cache reflective meta-data on first use as an  
optimisation.  But admittedly, this is hardly even relevant in the  
context of an RPC call.



--
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] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Jeff Schnitzer
This is a genuine, heartfelt plea:  The Builder pattern
(DatastoreServiceConfig, FetchOptions) makes code extra annoying when
layering an API on top of the low-level API.

Let's say you are writing some code by hand that creates a
FetchOptions with a limit and an offset:

FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);

Pretty straightforward when typing it out by hand, but the lack of
orthogonality between withLimit() and limit() is a PITA when you're
trying to automate the creation of a builder.  The problem is, you
can't start with a blank FetchOptions.  The result is we end up
writing lots of code like this:

if (limit != null)
{
if (opts == null)
opts = FetchOptions.Builder.withLimit(limit);
else
opts = opts.limit(limit);
}

This wouldn't be necessary if FetchOptions.Builder had a create()
method that would produce a blank FetchOptions.  Or if FetchOptions
had a public constructor.  Or if FetchOptions was an interface or even
a nonfinal class.

I notice that DatastoreServiceConfig is following in the path of
FetchOptions.  My initial reaction was Noo!  :-)

Thanks for listening,
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-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] com.google.appengine.api.datastore.DatastoreServiceConfig; not resolved by Eclipse with GAE plugin v1.3.2

2010-04-01 Thread Didier Durand
Hello,

I need to use com.google.appengine.api.datastore.DatastoreConfig -
works fine under Eclipse

The Javadoc at 
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreConfig.html
recommends to switch to
com.google.appengine.api.datastore.DatastoreServiceConfig;

When I do this change under Eclipse: I get an import
com.google.appengine.api.datastore.DatastoreServiceConfig cannot be
resolved

a) Is there something missing in my plugin v1.3.2?

b) Can some of you do the same test and let me know if they get the
same error ?


regards
didier

-- 
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: Why should app startup times be a problem.

2010-04-01 Thread Duong BaTien
Hi:

On Wed, 2010-03-31 at 22:51 -0700, Jeff Schnitzer wrote:
 On Wed, Mar 31, 2010 at 6:41 PM, jd jdpatter...@gmail.com wrote:
 
  On Apr 1, 3:14 am, Jeff Schnitzer j...@infohazard.org wrote:
  What does Twig do when someone issues a type-less query?
 
  datastore.find().addFilter(color, EQUAL, green). returnResultsNow()
 
  The expression above is actually not possible to enter using the
  fluent commands.  You can only set a filter on the interface that is
  returned from calling FindCommand.type(Class?)
 
  It is also illegal according to the datastore docs for a Query with no
  kind:
 
  Currently the only operations supported on a kind-less query are
  filter by __key__, ancestor, and order by __key__ ascending
 
 In other words, Twig cannot perform the simple query:
 
 IterableObject foo = ofy.query().ancestor(yourobject);
 

This is the required pattern shown in Google IO scalable application for
GAE.

Duong BaTien
DBGROUPS and BudhNet

 If you ever want to support something like this, you will need a
 registration process.
 
 If you ever want to support true polymorphic queries, you will need a
 registration process.
 
 Don't claim this short-sightedness as a feature.
 
 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-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: Why should app startup times be a problem.

2010-04-01 Thread John Patterson


On 1 Apr 2010, at 19:02, Duong BaTien wrote:


Hi:


IterableObject foo = ofy.query().ancestor(yourobject);



This is the required pattern shown in Google IO scalable application  
for

GAE.



If you are talking about the million fan out problem in Bret  
Slatkins talk that was also a typed query.  So more like this:


IterableObject foo = ofy.query(MessageIndex.class).ancestor(message);

--
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: java.lang.ClassNotFoundException: com.google.appengine.tools.appstats.AppstatsFilter

2010-04-01 Thread Prashant Gupta
someone please help me out


following is the code I added to my web.xml file :

filter
   filter-nameappstats/filter-name
   filter-
classcom.google.appengine.tools.appstats.AppstatsFilter/filter-
class
   init-param
   param-namelogMessage/param-name
   param-valueAppstats available: /appstats/details?time={ID}
/param-value
/init-param
   /filter
   filter-mapping
   filter-nameappstats/filter-name
   url-pattern/*/url-pattern
   /filter-mapping

   servlet
   servlet-nameappstats/servlet-name
   servlet-
classcom.google.appengine.tools.appstats.AppstatsServlet/servlet-
class
   /servlet
   servlet-mapping
   servlet-nameappstats/servlet-name
   url-pattern/appstats/*/url-pattern
   /servlet-mapping

   security-constraint
   web-resource-collection
   url-pattern/appstats/*/url-pattern
   /web-resource-collection
   auth-constraint
   role-nameadmin/role-name
   /auth-constraint
   /security-constraint

-- 
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] Like query in google datastore

2010-04-01 Thread Manjoor
I have a simple java class with following attributes

Candidates.java
name
skills
education
currentEmployer


I need app-engine java equevalent code of the following SQL query

Select * from Candidates
  where (name like '%searchcontent%') OR
(skills like '%searchcontent%') OR
(education like '%searchcontent%') OR
(currentEmployer like '%searchcontent%')



-- 
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] Java Mail Service

2010-04-01 Thread moissinac
Hello

I have servlet with a code copied from the documentation for sending
an email with the mail service
Each time I call the service, I see the trace in the quota count like
this:
Mail
Mail API Calls  0%  0%  5 of 7000   Okay
Recipients Emailed  0%  0%  5 of 2000   Okay
Admins Emailed  0%  0%  0 of 5000   Okay
...
The count for Mail API Calls and Recipients Emailed is incremented
each time

My code send an email from the admin of my domain to the admin of my
admin, but the item Admins Emailed  is never incremented

The admin of my domain (me) never receive an email by that mean.
If I send an email with gmail to the same address, it receive the
email.

Advice? help?
Thank you inadvance

-- 
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] How to exclude requests to /stats when viewing appstats?

2010-04-01 Thread Ice13ill
I'm trying to use appstats to view the requests to my app. But i can't
exclude the requests to /stats/ as stated in the dev guide:

This installs the filter for all URLs, with the url-pattern of /*.
(This includes the Appstats web-based administration interface
discussed in the next section, which you may prefer to exclude from
recording.) You can specify a different pattern to limit Appstats to
URLs that match the pattern.

I tried creating a filter witch treats request to url-pattern /stats/*
and placing it before the AppstatsFilter mapping in the web.xml file,
but it just shows a blank page, not the appstats GUI.

Is there an exclusion tag or regex to use within the url-patter tag ?

-- 
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] Like query in google datastore

2010-04-01 Thread Gal Dolber
There is no easy way to do that.
Problems:

   1. Appengine do not support fulltext queries
   2. Appengine do not support OR

Solutions:

   1. Make your own fulltext search implementation
   2. Use IN operand


2010/4/1 Manjoor manjoora...@gmail.com

 I have a simple java class with following attributes

 Candidates.java
 name
 skills
 education
 currentEmployer


 I need app-engine java equevalent code of the following SQL query

 Select * from Candidates
  where (name like '%searchcontent%') OR
 (skills like '%searchcontent%') OR
 (education like '%searchcontent%') OR
 (currentEmployer like '%searchcontent%')



 --
 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] makePersistentAll and updates

2010-04-01 Thread gemma
Hello chaps,

I've been sifting through the JDO docs to try to understand what
behaviour I will see if I use makePersistentAll with a bunch of
PersistenceCapable objects when some may already exist in the
datastore (with the objects in the Collection for makePersistentAll
having the same Key as in the datastore).

I'm writing an App Engine app with a GWT front end and have created
cutdown IsSerialisable object versions of my PersistenceCapable
objects.  Because of the GWT interaction I need to retrieve the
PersistenceCapable object, transform it into an IsSerialisable object,
do some stuff in the front end, and then store changes in the service
servlet.

I'd like to avoid having to lookup the object using the Key and then
updating it, and was wondering if I could get away with using the
makePersistentAll method as a shortcut.  The docs seem to imply I
could do this if the object was detached, but not sure how it would
behave if it was a re-constructed representation of the
PersistenceCapable object as opposed to one retrieved directly from
the datastore.

Any guidance would be greatly appreciated!

Thanks
Gemma

-- 
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] Toronto Area Developers - Java User Group (JUG) meeting

2010-04-01 Thread Steve Pritchard
The Toronto Java User Group (JUG) will be holding a meeting this
coming Tuesday, April 6th at 7:00pm.  The topic will be the Google App
Engine and the Browser Based Builder.

Details of the JUG meeting are at http://www.torontojug.org/meetings/201004.html

The presentation will focus on my positive experience with GAE,
programming techniques I have found effective in speeding up the
development process and an overview of the Browser Based Builder (B3).

It will conclude  with a code walk-through of a non-trivial working
application (beta) built using the Browser Based Builder.  The
application records donations by donor ID, balances to a deposit
record and automatically creates a reconciled bank deposit document.
I will be set it up as a demonstration shortly once I mask the
personal identifiers of the donor datastore.

Steve Pritchard

-- 
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: makePersistentAll and updates

2010-04-01 Thread datanucleus
 I'd like to avoid having to lookup the object using the Key and then
 updating it, and was wondering if I could get away with using the
 makePersistentAll method as a shortcut.  The docs seem to imply I
 could do this if the object was detached, but not sure how it would
 behave if it was a re-constructed representation of the
 PersistenceCapable object as opposed to one retrieved directly from
 the datastore.

Passing in a transient (non-detached, and non-managed) object (to
any makePersistent method) will attempt to persist it ... with the
identity that the object has. If its PK fields are set by you and that
'id' corresponds to an object in the datastore then you will get a
JDOUserException since the object with that 'id' already exists.

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



[appengine-java] Re: makePersistentAll and updates

2010-04-01 Thread gemma
Thankyou very much, that's a much clearer explanation than in the JDO
API.

Much appreciated!

Thanks
Gemma

On Apr 1, 4:52 pm, datanucleus andy_jeffer...@yahoo.com wrote:
  I'd like to avoid having to lookup the object using the Key and then
  updating it, and was wondering if I could get away with using the
  makePersistentAll method as a shortcut.  The docs seem to imply I
  could do this if the object was detached, but not sure how it would
  behave if it was a re-constructed representation of the
  PersistenceCapable object as opposed to one retrieved directly from
  the datastore.

 Passing in a transient (non-detached, and non-managed) object (to
 any makePersistent method) will attempt to persist it ... with the
 identity that the object has. If its PK fields are set by you and that
 'id' corresponds to an object in the datastore then you will get a
 JDOUserException since the object with that 'id' already exists.

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



[appengine-java] Re: Fwd: JSF 2.0 Netbeans and Google Appengine given error

2010-04-01 Thread KarthikR
Hi

This issue is discussed at
http://javadocs.wordpress.com/2009/10/17/mojarra-jsf-2-0-rc2-and-google-app-engine-sdk-1-2-6/

Regards


On Mar 31, 2:14 am, Haroon Idrees haroo...@gmail.com wrote:
 I attached simple hello world app for appengine sdk 1.3.2 and I alread
 follow the instruction given at and add the define 
 jarshttps://sites.google.com/a/wildstartech.com/adventures-in-java/Java-P...

     [java] java.lang.NoClassDefFoundError: javax.naming.InitialContext is a
 restricted class. Please see the Google  App Engine developer's guide for
 more details.
      [java]         at
 com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime­.java:51)
      [java]         at
 com.sun.faces.config.WebConfiguration.processJndiEntries(WebConfiguration.j­ava:578)
      [java]         at
 com.sun.faces.config.WebConfiguration.init(WebConfiguration.java:114)
      [java]         at
 com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:174­)
      [java]         at
 com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener­.java:161)
      [java]         at
 org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:5­48)
      [java]         at
 org.mortbay.jetty.servlet.Context.startContext(Context.java:136)

 --
 Regards
 Haroon Idrees
 Software Team Lead
 IBL Group
 Voice:+923212066747
 Site:http://www.haroonidrees.com
 Profile:http://www.google.com/profiles/haroonob
 MSN:haroon.idr...@hotmail.com msn%3aharoon.idr...@hotmail.com
 Skype :haroonob
 LinkedIn:http://www.linkedin.com/in/haroonob
 Facebook:http://www.facebook.com/haroonidrees

 --
 Regards
 Haroon Idrees
 Software Team Lead
 IBL Group
 Voice:+923212066747
 Site:http://www.haroonidrees.com
 Profile:http://www.google.com/profiles/haroonob
 MSN:haroon.idr...@hotmail.com msn%3aharoon.idr...@hotmail.com
 Skype :haroonob
 LinkedIn:http://www.linkedin.com/in/haroonob
 Facebook:http://www.facebook.com/haroonidrees

  JSFAppOnGoogleAppEngine.zip
 25KViewDownload

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



[appengine-java] Re: How to register a custom ELResolver?

2010-04-01 Thread KarthikR
Hi

Can you take a look at 
http://stackoverflow.com/questions/2551517/gae-j-unable-to-register-a-custom-elresolver
and see if it helps?

regards.

On Mar 30, 10:05 am, Davide Angelocola davide.angeloc...@gmail.com
wrote:
 Hello,

 I've the following class:

   public class WebAiatListener implements ServletContextListener {

     private static final Logger logger = Logger.getAnonymousLogger();

     @Override
     public void contextInitialized(ServletContextEvent sce) {
         ServletContext context = sce.getServletContext();

         if (context == null) {
             throw new NullPointerException(servlet context);
         }

         if (JspFactory.getDefaultFactory() == null) {
             throw new NullPointerException(default factory);
         }

         if
 (JspFactory.getDefaultFactory().getJspApplicationContext(context) ==
 null) {
             throw new NullPointerException(jsp application context);
         }

         JspApplicationContext jspContext =
 JspFactory.getDefaultFactory().getJspApplicationContext(context);

         if (jspContext == null) {
             logger.info(cannot register 'EntityELResolver');
         } else {
             jspContext.addELResolver(new EntityELResolver());
             logger.info('EntityELResolver' registered);
         }
     }

 using the local dev environment it works but when I deploy it on GAE I
 obtain the following exception:

 Failed startup of context
 com.google.apphosting.utils.jetty.runtimeappenginewebappcont...@391da0{/,/
 base/data/home/apps/webaiat/3.340904528580025222}
 java.lang.NullPointerException: default factory

 since JspFactory.getDefaultFactory() returns null. How can I register
 a custom ELResolver?
 Thanks.

 PS
 Please note that I'm using servlet 2.5 version (so I'm using JSP 2.1):
 web-app xmlns:xsi=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/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
          version=2.5

-- 
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] Problem deploying the tutorial app

2010-04-01 Thread theBULLL
Hello,

I am getting the following error and I cannot seem to figure out what
is wrong.  I would appreciate any insight.  Here is what results in
the Eclipse console. I have replace my app id number with MY_APP_ID.

Compiling module com.mywebapp2.MyWebApp2
   Compiling 6 permutations
  Compiling permutation 0...
  Compiling permutation 1...
  Compiling permutation 2...
  Compiling permutation 3...
  Compiling permutation 4...
  Compiling permutation 5...
   Compile of permutations succeeded
Linking into C:\WORKSPACE\MyWebApp2\war\mywebapp2.
   Link succeeded
   Compilation succeeded -- 28.127s
Creating staging directory
Scanning for jsp files.
Scanning files on local disk.
Initiating update.
java.io.IOException: Error posting to URL:
https://appengine.google.com/api/appversion/create?app_id=MY_APP_IDversion=1;
404 Not Found
This application does not exist (app_id=u'MY_APP_ID').

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



[appengine-java] Re: How to register a custom ELResolver?

2010-04-01 Thread KarthikR
Hi

Can you check out 
http://stackoverflow.com/questions/2551517/gae-j-unable-to-register-a-custom-elresolver
?

  this is recognizeable as a bug in Tomcat 6.x. A workaround is to
force the loading of JspRuntimeContext yourself before getting the
factory:
 Class.forName(org.apache.jasper.compiler.JspRuntimeContext);
 See if this or similar hack helps.

Regards,


On Mar 30, 10:05 am, Davide Angelocola davide.angeloc...@gmail.com
wrote:
 Hello,

 I've the following class:

   public class WebAiatListener implements ServletContextListener {

     private static final Logger logger = Logger.getAnonymousLogger();

     @Override
     public void contextInitialized(ServletContextEvent sce) {
         ServletContext context = sce.getServletContext();

         if (context == null) {
             throw new NullPointerException(servlet context);
         }

         if (JspFactory.getDefaultFactory() == null) {
             throw new NullPointerException(default factory);
         }

         if
 (JspFactory.getDefaultFactory().getJspApplicationContext(context) ==
 null) {
             throw new NullPointerException(jsp application context);
         }

         JspApplicationContext jspContext =
 JspFactory.getDefaultFactory().getJspApplicationContext(context);

         if (jspContext == null) {
             logger.info(cannot register 'EntityELResolver');
         } else {
             jspContext.addELResolver(new EntityELResolver());
             logger.info('EntityELResolver' registered);
         }
     }

 using the local dev environment it works but when I deploy it on GAE I
 obtain the following exception:

 Failed startup of context
 com.google.apphosting.utils.jetty.runtimeappenginewebappcont...@391da0{/,/
 base/data/home/apps/webaiat/3.340904528580025222}
 java.lang.NullPointerException: default factory

 since JspFactory.getDefaultFactory() returns null. How can I register
 a custom ELResolver?
 Thanks.

 PS
 Please note that I'm using servlet 2.5 version (so I'm using JSP 2.1):
 web-app xmlns:xsi=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/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
          version=2.5

-- 
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] javax.net.ssl.HttpsURLConnection

2010-04-01 Thread jcjones1515
This doc: 
http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html#Using_HttpURLConnection
seems to indicate that using javax.net.ssl.HttpsURLConnection is
acceptable, however it is not included in the JRE white list.  When I
try to use it I get the following:

java.lang.NoClassDefFoundError: javax.net.ssl.HttpsURLConnection is a
restricted class. Please see the Google App Engine developer's guide
for more details.

I understand I could use the URLFetch API directly, but this would
preclude me from using HTTPClient.

Is this an oversight in the JRE white list?  Or should
http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html#Using_HttpURLConnection
be corrected?

-- 
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] javax.net.ssl.HttpsURLConnection

2010-04-01 Thread Don Schwarz
Yes, you're right.  HttpsURLConnection is not currently available and we
should remove the reference to it from the documentation.

Do you need to be able to provide client-side certificates, validate
server-side certificates or do custom hostname validation?  If so, please
star one of the following relevant issues:

http://code.google.com/p/googleappengine/issues/detail?id=46
http://code.google.com/p/googleappengine/issues/detail?id=1036
or file your own.

If you don't need these, you can use use URL.openConnection() with a
https:// URL and you will receive a HttpURLConnection that is capable of
retrieving HTTPS data.

However, if you are trying to use a library where that is not sufficient
(because it checks for an https:// URL itself and tries to cast the
connection class?) please open a new issue in an issue tracker and explain
what we can do to help.

Thanks,
Don

On Thu, Apr 1, 2010 at 10:21 AM, jcjones1515 jcjo...@gmail.com wrote:

 This doc:
 http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html#Using_HttpURLConnection
 seems to indicate that using javax.net.ssl.HttpsURLConnection is
 acceptable, however it is not included in the JRE white list.  When I
 try to use it I get the following:

 java.lang.NoClassDefFoundError: javax.net.ssl.HttpsURLConnection is a
 restricted class. Please see the Google App Engine developer's guide
 for more details.

 I understand I could use the URLFetch API directly, but this would
 preclude me from using HTTPClient.

 Is this an oversight in the JRE white list?  Or should

 http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html#Using_HttpURLConnection
 be corrected?

 --
 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] Problem deploying the tutorial app

2010-04-01 Thread Ikai L (Google)
What is your application ID?

On Wed, Mar 31, 2010 at 6:58 PM, theBULLL mjweb...@wisc.edu wrote:

 Hello,

 I am getting the following error and I cannot seem to figure out what
 is wrong.  I would appreciate any insight.  Here is what results in
 the Eclipse console. I have replace my app id number with MY_APP_ID.

 Compiling module com.mywebapp2.MyWebApp2
   Compiling 6 permutations
  Compiling permutation 0...
  Compiling permutation 1...
  Compiling permutation 2...
  Compiling permutation 3...
  Compiling permutation 4...
  Compiling permutation 5...
   Compile of permutations succeeded
 Linking into C:\WORKSPACE\MyWebApp2\war\mywebapp2.
   Link succeeded
   Compilation succeeded -- 28.127s
 Creating staging directory
 Scanning for jsp files.
 Scanning files on local disk.
 Initiating update.
 java.io.IOException: Error posting to URL:
 https://appengine.google.com/api/appversion/create?app_id=
 MY_APP_IDversion=1
 404 Not Found
 This application does not exist (app_id=u'MY_APP_ID').

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




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

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



Re: [appengine-java] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Max Ross (Google)
Hi Jeff,

Note that DatastoreServiceConfig exposes a withDefaults() method.
FetchOptions has one too but it's package protected.  We didn't expose it
because FetchOptions isn't required for many low level datastore calls and
we didn't see why users would want to create one if they didn't plan to
adjust the offset, the limit, the prefetch size, etc.  We didn't consider
your use case though, and it makes perfect sense.  Unless there's some other
aspect of the Builder pattern that is getting in your way that you have
explained, I think we could easily address your concern if we exposed
FetchOptions.withDefaults().  Is that right?

Thanks,
Max


On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer j...@infohazard.org wrote:

 This is a genuine, heartfelt plea:  The Builder pattern
 (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
 layering an API on top of the low-level API.

 Let's say you are writing some code by hand that creates a
 FetchOptions with a limit and an offset:

 FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);

 Pretty straightforward when typing it out by hand, but the lack of
 orthogonality between withLimit() and limit() is a PITA when you're
 trying to automate the creation of a builder.  The problem is, you
 can't start with a blank FetchOptions.  The result is we end up
 writing lots of code like this:

 if (limit != null)
 {
if (opts == null)
opts = FetchOptions.Builder.withLimit(limit);
else
opts = opts.limit(limit);
 }

 This wouldn't be necessary if FetchOptions.Builder had a create()
 method that would produce a blank FetchOptions.  Or if FetchOptions
 had a public constructor.  Or if FetchOptions was an interface or even
 a nonfinal class.

 I notice that DatastoreServiceConfig is following in the path of
 FetchOptions.  My initial reaction was Noo!  :-)

 Thanks for listening,
 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-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] com.google.appengine.api.datastore.DatastoreServiceConfig; not resolved by Eclipse with GAE plugin v1.3.2

2010-04-01 Thread Max Ross (Google)
Hi Didier,

I can't say what's going on with your plugin but this is almost certainly a
classpath issue.  DatastoreServiceConfig was introduced in 1.3.2 so make
sure you have the appengine-api.jar that shipped with SDK 1.3.2 in your
classpath.

Max

On Thu, Apr 1, 2010 at 4:01 AM, Didier Durand durand.did...@gmail.comwrote:

 Hello,

 I need to use com.google.appengine.api.datastore.DatastoreConfig -
 works fine under Eclipse

 The Javadoc at
 http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreConfig.html
 recommends to switch to
 com.google.appengine.api.datastore.DatastoreServiceConfig;

 When I do this change under Eclipse: I get an import
 com.google.appengine.api.datastore.DatastoreServiceConfig cannot be
 resolved

 a) Is there something missing in my plugin v1.3.2?

 b) Can some of you do the same test and let me know if they get the
 same error ?


 regards
 didier

 --
 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] Finally, I published my Android/GAE based MMO War Game

2010-04-01 Thread ZeroCool
Big thanks to GAE team and Objectify authors.
I couldn't have done it without the help of you guys.
If anyone is interested, search 'pocket empires' or 'pe' in Android
Market.
Now app engine is doing great serving about 3 requests/second with
about 700 active users.
Looking forward to feedbacks :)

-- 
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] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Jeff Schnitzer
Yes, that would solve the problem.  Although I have to wonder, how is
this any better than having a public constructor?

Jeff

On Thu, Apr 1, 2010 at 10:08 AM, Max Ross (Google)
maxr+appeng...@google.com wrote:
 Hi Jeff,

 Note that DatastoreServiceConfig exposes a withDefaults() method.
 FetchOptions has one too but it's package protected.  We didn't expose it
 because FetchOptions isn't required for many low level datastore calls and
 we didn't see why users would want to create one if they didn't plan to
 adjust the offset, the limit, the prefetch size, etc.  We didn't consider
 your use case though, and it makes perfect sense.  Unless there's some other
 aspect of the Builder pattern that is getting in your way that you have
 explained, I think we could easily address your concern if we exposed
 FetchOptions.withDefaults().  Is that right?

 Thanks,
 Max


 On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer j...@infohazard.org wrote:

 This is a genuine, heartfelt plea:  The Builder pattern
 (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
 layering an API on top of the low-level API.

 Let's say you are writing some code by hand that creates a
 FetchOptions with a limit and an offset:

 FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);

 Pretty straightforward when typing it out by hand, but the lack of
 orthogonality between withLimit() and limit() is a PITA when you're
 trying to automate the creation of a builder.  The problem is, you
 can't start with a blank FetchOptions.  The result is we end up
 writing lots of code like this:

 if (limit != null)
 {
        if (opts == null)
                opts = FetchOptions.Builder.withLimit(limit);
        else
                opts = opts.limit(limit);
 }

 This wouldn't be necessary if FetchOptions.Builder had a create()
 method that would produce a blank FetchOptions.  Or if FetchOptions
 had a public constructor.  Or if FetchOptions was an interface or even
 a nonfinal class.

 I notice that DatastoreServiceConfig is following in the path of
 FetchOptions.  My initial reaction was Noo!  :-)

 Thanks for listening,
 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-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.


-- 
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: Eventually consistent reads and JDO

2010-04-01 Thread Isdal
Thanks Ikai!

I noticed that the docs are updated now too. This page has a couple
examples on it as well:
http://code.google.com/appengine/docs/java/datastore/usingjdo.html

// Tomas

On Mar 30, 3:57 pm, Ikai L (Google) ika...@google.com wrote:
 Yep. The example is documented here:

 http://googleappengine.blogspot.com/2010/03/read-consistency-deadline...

 http://googleappengine.blogspot.com/2010/03/read-consistency-deadline...Query
 q = pm.newQuery(Employee.class);
 q.addExtension(datanucleus.appengine.datastoreReadConsistency,
 EVENTUAL);



 On Fri, Mar 26, 2010 at 5:12 PM, Isdal tomas.is...@gmail.com wrote:
  Hi all,

  Thanks for all new new features in 1.3.2!

  I was just wondering if it is possible to use the
  ReadPolicy.Consistency.EVENTUAL feature and still use the JDO
  interface.

  I am currently getting a PersistenceManager with:
  JDOHelper.getPersistenceManagerFactory(transactions-
  optional);

  Is there a way to tell the PersistenceManager to tell the datastore to
  accept eventually consistent reads? Most of my app can handle stale
  data, and any performance improvement would be great!

  Thanks!

  // Tomas

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

 --
 Ikai Lan
 Developer Programs Engineer, Google App 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

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



Re: [appengine-java] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Jeff Schnitzer
Oh, I wasn't suggesting a constructor that takes all the arguments,
I'm just wondering why this:

FetchOptions opts = FetchOptions.Builder.withLimit(10).offset(200);

...is better than this...

FetchOptions opts = new FetchOptions().limit(10).offset(200);

...or even...

FetchOptions opts = FetchOptions.create().limit(10).offset(200);

Adding the Builder with duplicate-but-differently-named methods seems awkward.

Jeff

On Thu, Apr 1, 2010 at 11:43 AM, Max Ross (Google)
maxr+appeng...@google.com wrote:
 Ok, we'll expose that method.

 With a public constructor it's very easy to mix up your args, especially
 when you have args of the same type.  For example, someone is pretty much
 guaranteed to mix up the offset, limit, and prefetch args.  A Builder
 prevents this.  Josh Bloch has a nice chapter on this in the 2nd edition of
 Effective Java.

 Max

 On Thu, Apr 1, 2010 at 11:10 AM, Jeff Schnitzer j...@infohazard.org wrote:

 Yes, that would solve the problem.  Although I have to wonder, how is
 this any better than having a public constructor?

 Jeff

 On Thu, Apr 1, 2010 at 10:08 AM, Max Ross (Google)
 maxr+appeng...@google.com wrote:
  Hi Jeff,
 
  Note that DatastoreServiceConfig exposes a withDefaults() method.
  FetchOptions has one too but it's package protected.  We didn't expose
  it
  because FetchOptions isn't required for many low level datastore calls
  and
  we didn't see why users would want to create one if they didn't plan to
  adjust the offset, the limit, the prefetch size, etc.  We didn't
  consider
  your use case though, and it makes perfect sense.  Unless there's some
  other
  aspect of the Builder pattern that is getting in your way that you have
  explained, I think we could easily address your concern if we exposed
  FetchOptions.withDefaults().  Is that right?
 
  Thanks,
  Max
 
 
  On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer j...@infohazard.org
  wrote:
 
  This is a genuine, heartfelt plea:  The Builder pattern
  (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
  layering an API on top of the low-level API.
 
  Let's say you are writing some code by hand that creates a
  FetchOptions with a limit and an offset:
 
  FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);
 
  Pretty straightforward when typing it out by hand, but the lack of
  orthogonality between withLimit() and limit() is a PITA when you're
  trying to automate the creation of a builder.  The problem is, you
  can't start with a blank FetchOptions.  The result is we end up
  writing lots of code like this:
 
  if (limit != null)
  {
         if (opts == null)
                 opts = FetchOptions.Builder.withLimit(limit);
         else
                 opts = opts.limit(limit);
  }
 
  This wouldn't be necessary if FetchOptions.Builder had a create()
  method that would produce a blank FetchOptions.  Or if FetchOptions
  had a public constructor.  Or if FetchOptions was an interface or even
  a nonfinal class.
 
  I notice that DatastoreServiceConfig is following in the path of
  FetchOptions.  My initial reaction was Noo!  :-)
 
  Thanks for listening,
  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-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.
 

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


-- 
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: How to exclude requests to /stats when viewing appstats?

2010-04-01 Thread Peter Ondruska
Well, then let the filter filter explicitly those url-patterns you
want to check stats for.

On 1 dub, 16:20, Ice13ill andrei.fifi...@gmail.com wrote:
 I'm trying to use appstats to view the requests to my app. But i can't
 exclude the requests to /stats/ as stated in the dev guide:

 This installs the filter for all URLs, with the url-pattern of /*.
 (This includes the Appstats web-based administration interface
 discussed in the next section, which you may prefer to exclude from
 recording.) You can specify a different pattern to limit Appstats to
 URLs that match the pattern.

 I tried creating a filter witch treats request to url-pattern /stats/*
 and placing it before the AppstatsFilter mapping in the web.xml file,
 but it just shows a blank page, not the appstats GUI.

 Is there an exclusion tag or regex to use within the url-patter tag ?

-- 
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] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Max Ross (Google)
The 2 options you listed are indeed better, but they don't work if your goal
is to prevent access to an uninitialized FetchOptions object.  That was our
original intent, so that's how we ended up steering you through the Builder
at the start.  At one point before we launched we had a more standard
Builder that you had to call build() on at the end.  I liked it because it
meant that all the FetchOptions members could be final, but there was some
debate within the team and we ultimately decided that in this case
conciseness trumps immutability, so we dropped the explicit build() call and
moved the setters to FetchOptions itself.  We also considered putting the
with constructors directly on FetchOptions and getting rid of the Builder
entirely, but we decided that a static method named
FetchOptions.withLimit(int limit) and an instance method named
FetchOptions.limit(limit) wouldn't give enough of a hint about the intended
usage.  So here we are.

API design is hard.

Max

On Thu, Apr 1, 2010 at 12:14 PM, Jeff Schnitzer j...@infohazard.org wrote:

 Oh, I wasn't suggesting a constructor that takes all the arguments,
 I'm just wondering why this:

 FetchOptions opts = FetchOptions.Builder.withLimit(10).offset(200);

 ...is better than this...

 FetchOptions opts = new FetchOptions().limit(10).offset(200);

 ...or even...

 FetchOptions opts = FetchOptions.create().limit(10).offset(200);

 Adding the Builder with duplicate-but-differently-named methods seems
 awkward.

 Jeff

 On Thu, Apr 1, 2010 at 11:43 AM, Max Ross (Google)
 maxr+appeng...@google.com maxr%2bappeng...@google.com wrote:
  Ok, we'll expose that method.
 
  With a public constructor it's very easy to mix up your args, especially
  when you have args of the same type.  For example, someone is pretty much
  guaranteed to mix up the offset, limit, and prefetch args.  A Builder
  prevents this.  Josh Bloch has a nice chapter on this in the 2nd edition
 of
  Effective Java.
 
  Max
 
  On Thu, Apr 1, 2010 at 11:10 AM, Jeff Schnitzer j...@infohazard.org
 wrote:
 
  Yes, that would solve the problem.  Although I have to wonder, how is
  this any better than having a public constructor?
 
  Jeff
 
  On Thu, Apr 1, 2010 at 10:08 AM, Max Ross (Google)
  maxr+appeng...@google.com maxr%2bappeng...@google.com wrote:
   Hi Jeff,
  
   Note that DatastoreServiceConfig exposes a withDefaults() method.
   FetchOptions has one too but it's package protected.  We didn't expose
   it
   because FetchOptions isn't required for many low level datastore calls
   and
   we didn't see why users would want to create one if they didn't plan
 to
   adjust the offset, the limit, the prefetch size, etc.  We didn't
   consider
   your use case though, and it makes perfect sense.  Unless there's some
   other
   aspect of the Builder pattern that is getting in your way that you
 have
   explained, I think we could easily address your concern if we exposed
   FetchOptions.withDefaults().  Is that right?
  
   Thanks,
   Max
  
  
   On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer j...@infohazard.org
   wrote:
  
   This is a genuine, heartfelt plea:  The Builder pattern
   (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
   layering an API on top of the low-level API.
  
   Let's say you are writing some code by hand that creates a
   FetchOptions with a limit and an offset:
  
   FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);
  
   Pretty straightforward when typing it out by hand, but the lack of
   orthogonality between withLimit() and limit() is a PITA when you're
   trying to automate the creation of a builder.  The problem is, you
   can't start with a blank FetchOptions.  The result is we end up
   writing lots of code like this:
  
   if (limit != null)
   {
  if (opts == null)
  opts = FetchOptions.Builder.withLimit(limit);
  else
  opts = opts.limit(limit);
   }
  
   This wouldn't be necessary if FetchOptions.Builder had a create()
   method that would produce a blank FetchOptions.  Or if FetchOptions
   had a public constructor.  Or if FetchOptions was an interface or
 even
   a nonfinal class.
  
   I notice that DatastoreServiceConfig is following in the path of
   FetchOptions.  My initial reaction was Noo!  :-)
  
   Thanks for listening,
   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-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 

[appengine-java] Re: javax.net.ssl.HttpsURLConnection

2010-04-01 Thread jcjones1515
Ok.  I was able to implement the solution described here:
http://esxx.blogspot.com/2009/06/using-apaches-httpclient-on-google-app.html


On Apr 1, 11:37 am, Don Schwarz schwa...@google.com wrote:
 Yes, you're right.  HttpsURLConnection is not currently available and we
 should remove the reference to it from the documentation.

 Do you need to be able to provide client-side certificates, validate
 server-side certificates or do custom hostname validation?  If so, please
 star one of the following relevant issues:

 http://code.google.com/p/googleappengine/issues/detail?id=46http://code.google.com/p/googleappengine/issues/detail?id=1036
 or file your own.

 If you don't need these, you can use use URL.openConnection() with a
 https:// URL and you will receive a HttpURLConnection that is capable of
 retrieving HTTPS data.

 However, if you are trying to use a library where that is not sufficient
 (because it checks for an https:// URL itself and tries to cast the
 connection class?) please open a new issue in an issue tracker and explain
 what we can do to help.

 Thanks,
 Don



 On Thu, Apr 1, 2010 at 10:21 AM, jcjones1515 jcjo...@gmail.com wrote:
  This doc:
 http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html...
  seems to indicate that using javax.net.ssl.HttpsURLConnection is
  acceptable, however it is not included in the JRE white list.  When I
  try to use it I get the following:

  java.lang.NoClassDefFoundError: javax.net.ssl.HttpsURLConnection is a
  restricted class. Please see the Google App Engine developer's guide
  for more details.

  I understand I could use the URLFetch API directly, but this would
  preclude me from using HTTPClient.

  Is this an oversight in the JRE white list?  Or should

 http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html...
  be corrected?

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



[appengine-java] Re: java.lang.ClassNotFoundException: com.google.appengine.tools.appstats.AppstatsFilter

2010-04-01 Thread KarthikR
Hi

In my 1.3.2 installation, the missing class
com.google.appengine.tools.appstats.AppstatsFilter is part of
'appengine-api-labs-1.3.2.jar'. The jar is found in the following
directories: lib\impl\ , lib\user and demos\guestbook\war\WEB-INF
\lib .

Can you check if your install has the labs api jar? And if so, check
the build script to see if the jar file is being copied to app's WEB-
INF.

Regards,
KarthikR

On Apr 1, 6:18 am, Prashant Gupta nextprash...@gmail.com wrote:
 someone please help me out

 following is the code I added to my web.xml file :

 filter
        filter-nameappstats/filter-name
        filter-
 classcom.google.appengine.tools.appstats.AppstatsFilter/filter-
 class
        init-param
            param-namelogMessage/param-name
            param-valueAppstats available: /appstats/details?time={ID}
 /param-value
         /init-param
    /filter
    filter-mapping
        filter-nameappstats/filter-name
        url-pattern/*/url-pattern
    /filter-mapping

    servlet
        servlet-nameappstats/servlet-name
        servlet-
 classcom.google.appengine.tools.appstats.AppstatsServlet/servlet-
 class
    /servlet
    servlet-mapping
        servlet-nameappstats/servlet-name
        url-pattern/appstats/*/url-pattern
    /servlet-mapping

    security-constraint
        web-resource-collection
            url-pattern/appstats/*/url-pattern
        /web-resource-collection
        auth-constraint
            role-nameadmin/role-name
        /auth-constraint
    /security-constraint

-- 
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] MEMCACHE JCACHE NOT CLEARING ON DEVELOPENT ENV OR PRODUCTION

2010-04-01 Thread Geo
Hi GAE Team

First, I want to say that this is a great system.  I like the
collaboration, and total outcome of GAE.

Now to my issue.  I am sure I am doing something wrong, but after I
implemented caching on my test application, i see that my caching
policies are not taking effect.  Basically keeping things in the
MEMCache as long as the system likes.

Basically I retrieve a list of posts, put them on the cache, and any
subsequent request will get the list from the cache for the next 10
seconds.  After that it should get the list from datastore, and put it
again on the cache.

below part of my code:

Constructor of Class:

public NoteRepository()
{
query = select  from  + SmallNote.class.getName();
HashMapInteger, Integer cacheProp = new HashMapInteger,
Integer();
cacheProp.put(GCacheFactory.EXPIRATION_DELTA, 10);
try
{
CacheFactory cacheFactory =
CacheManager.getInstance().getCacheFactory();
cache = cacheFactory.createCache(cacheProp);
}
catch (CacheException e)
{
log.info(e.getMessage());
}
}

Get list method:

public ListSmallNote GetNotes()
{
ListSmallNote notes = new ArrayListSmallNote();
notes = (ArrayListSmallNote)cache.get(1);
if(notes==null)
{
notes = (ListSmallNote) pm.newQuery(query).execute();
ArrayListSmallNote cNotes = new 
ArrayListSmallNote();
cNotes.addAll(notes);
cache.put(1, cNotes);
}
return notes;
}

On the second line of the second method GetNotes(), it will always
return the cache disregarding the 10 seconds expiration delta placed
initially.

Any ideas?

Thanks, Geo

-- 
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] Low-level API and eventual consistency

2010-04-01 Thread keyurva
I use the low-level datastore API. At runtime, I want to use the new
eventual consistency on occasions and strong consistency at others.

I was looking at the Query class to set the consistency option but
noticed that it is only available in DatastoreServiceConfig. Is it
expected that one needs to use different DatastoreService instances
for different read policies? Or am I missing something obvious?

Thanks,
Keyur

-- 
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] Low-level API and eventual consistency

2010-04-01 Thread Ikai L (Google)
That's correct. The cost of creating an instance is negligible, though. It's
not dissimilar to creating different MemcacheService instances with
different write policies.

On Thu, Apr 1, 2010 at 4:09 PM, keyurva keyu...@gmail.com wrote:

 I use the low-level datastore API. At runtime, I want to use the new
 eventual consistency on occasions and strong consistency at others.

 I was looking at the Query class to set the consistency option but
 noticed that it is only available in DatastoreServiceConfig. Is it
 expected that one needs to use different DatastoreService instances
 for different read policies? Or am I missing something obvious?

 Thanks,
 Keyur

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




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

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



Re: [appengine-java] Like query in google datastore

2010-04-01 Thread John Patterson
Like Gal said, you would need to make your own full-text search.  You  
don't need an OR query if all values are in a single multi-valued  
property.  You could do this by creating an index entity:


CandidatesSearch
{
@Parent Candidate source;
ListString words;
}

It is a child of the Candidate so you can store and update both in a  
transaction


Add every word in name, skills etc then just do

datastore.store(candidateSearch);

datastore.find()
.type(CandidatesSearch.class)
.filter(words, EQUAL, searchcontents)
.fetchNoFields()
.returnParentsNow();

This is ObjectDatastore query syntax from Twig but the same concept  
would work in JDO, Objectify, SimpleDS etc


John

On 1 Apr 2010, at 22:27, Gal Dolber wrote:


There is no easy way to do that.
Problems:
Appengine do not support fulltext queries
Appengine do not support OR
Solutions:
Make your own fulltext search implementation
Use IN operand

2010/4/1 Manjoor manjoora...@gmail.com
I have a simple java class with following attributes

Candidates.java
name
skills
education
currentEmployer


I need app-engine java equevalent code of the following SQL query

Select * from Candidates
 where (name like '%searchcontent%') OR
(skills like '%searchcontent%') OR
(education like '%searchcontent%') OR
(currentEmployer like '%searchcontent%')



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


--
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] DatastoreService instances

2010-04-01 Thread John Patterson
As Ikai pointed out a DatastoreService is really very light weight so  
it really makes very little difference.


If you are changing the config properties from place to place your  
only options are to cache each service by config or create a new one  
each time.  If I were writing code by hand I would choose the simple  
option of creating one as needed with the options you want at the time.


On 2 Apr 2010, at 08:09, keyurva wrote:


In my application, I create a DatastoreService instance, maintain a
reference to it and use it for the life of that instance of the
application.

In another discussion I learned that the cost of creating a new
DatastoreService instance is negligible.

Given that, is it still advisable for me to maintain a copy of the
DatastoreService instance or should I create one anew every time I
need to go to the datastore?

Thanks,
Keyur

--
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-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] Book Recommendation

2010-04-01 Thread iwas9409
I'm lower intermediate programmer that would like to delve into Google
App Engine for Java using is Data store.

Can someone recommend a good book or additional places then the
'getting started' stuff on Google App Engine with Java.


-Tom

-- 
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] Book Recommendation

2010-04-01 Thread Steve Robillard
I have read every published book on GAE and this is by far the best,
Programming Google App Engine hands down, JAVA or python. Having said that
GAE is a very fast moving target and there has been much development since
this book was published last year. This book along with the online docs will
get you going pretty quickly. 

HTH,
Steve

-Original Message-
From: google-appengine-java@googlegroups.com
[mailto:google-appengine-j...@googlegroups.com] On Behalf Of iwas9409
Sent: Thursday, April 01, 2010 10:18 PM
To: Google App Engine for Java
Subject: [appengine-java] Book Recommendation

I'm lower intermediate programmer that would like to delve into Google
App Engine for Java using is Data store.

Can someone recommend a good book or additional places then the
'getting started' stuff on Google App Engine with Java.


-Tom

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

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



Re: [appengine-java] DatastoreService instances

2010-04-01 Thread Jeff Schnitzer
Appengine devs have said on a number of occasions that we should not
assume thread-safety of any class not documented as being thread-safe.
 I don't see anything in the javadocs indicating that DatastoreService
is thread-safe, therefore keeping an appwide instance of DS is
probably risky - even if it works today.

I'd suggest opening a fresh DatastoreService very time you need one.

Jeff

On Thu, Apr 1, 2010 at 7:07 PM, John Patterson jdpatter...@gmail.com wrote:
 As Ikai pointed out a DatastoreService is really very light weight so it
 really makes very little difference.

 If you are changing the config properties from place to place your only
 options are to cache each service by config or create a new one each time.
  If I were writing code by hand I would choose the simple option of creating
 one as needed with the options you want at the time.

 On 2 Apr 2010, at 08:09, keyurva wrote:

 In my application, I create a DatastoreService instance, maintain a
 reference to it and use it for the life of that instance of the
 application.

 In another discussion I learned that the cost of creating a new
 DatastoreService instance is negligible.

 Given that, is it still advisable for me to maintain a copy of the
 DatastoreService instance or should I create one anew every time I
 need to go to the datastore?

 Thanks,
 Keyur

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



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