[appengine-java] Re: When to use a String as ID? (using Objectify and GWT)

2011-06-15 Thread Thomas Wiradikusuma
Sorry for the stupid question, but in what scenarios would we need to
allocate id?

Usually if I need the id to be something, i just use string (e.g.
email address), otherwise, just let datastore set it for me (when
persisting).

On Jun 15, 6:26 pm, Drew Spencer  wrote:
> Just one question - the DatastoreService.allocateIdRange() - when would this

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



[appengine-java] Re: Newbie question: how to create the memcache across several instances

2011-06-15 Thread Didier Durand
Hi,

Memcache on GAE is based on JSR-107: see http://jcp.org/en/jsr/detail?id=107

The purpose of jsr 107 is "Specifies API and semantics for temporary,
in memory caching of Java objects, including object creation, shared
access, spooling, invalidation, and consistency across JVMs"

So, memcache is by construction shared across instances

regards

didier

On Jun 15, 8:13 pm, Inderjeet Singh  wrote:
> Hi Folks,
>
> Pardon the somewhat basic question, I did try going through various online
> guides but never really got the answer to this one.
> I am running app-engine with 3 instances. I share data across these
> instances using Memcache. What is the right way to instantiate it such that
> all three appengine instances end up writing to the same cache?
>
> Here is the code that I used:
>  public static synchronized  Map createMemcache(
>       String cacheName, ReadableDuration inactivityTimeout, @Nullable
> CacheListener cacheListener) {
>     try {
>       CacheManager cacheMgr = CacheManager.getInstance();
>       Cache cache = cacheMgr.getCache(cacheName);
>       if (cache == null) {
>         CacheFactory cacheFactory = cacheMgr.getCacheFactory();
>         ImmutableMap env =
>           ImmutableMap.of(GCacheFactory.EXPIRATION_DELTA_MILLIS,
> inactivityTimeout.getMillis());
>         cache = cacheFactory.createCache(env);
>         if (cacheListener != null) {
>           cache.addListener(cacheListener);
>         }
>         cacheMgr.registerCache(cacheName, cache);
>       }
>       return cache;
>     } catch (CacheException e) {
>     }
>
> Any comments? Will this create the shared Memcache as I want it?
>
> Thanks
> Inder

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



Re: [giannim] Re: [appengine-java] Re: No of namespaces limit ?

2011-06-15 Thread Gianni Mariani
There are costs for large numbers of namespaces but there are no hard limits
on number of namespaces per app-id.

The costs are somewhat obvious, e.g. an __namespace__ query will take
longer, meaning you'll need to segment your query, there will be datastore
stats on a per namespace basis, meaning that your "meta data" will expand on
a per namespace basis (per namespace datastore stats coming soon).

The practical limit on the number of namespaces will depend on application
code.

On Thu, Jun 16, 2011 at 12:31 PM, Ikai Lan (Google) wrote:

> No limit.
>
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blog: http://googleappengine.blogspot.com
> Twitter: http://twitter.com/app_engine
> Reddit: http://www.reddit.com/r/appengine
>
>
>
> On Thu, Jun 16, 2011 at 10:18 AM, Aswath Satrasala <
> aswath.satras...@gmail.com> wrote:
>
>> Any replies on this...
>>
>> -Aswath
>>
>>
>> On Tue, Jun 14, 2011 at 9:44 PM, Aswath Satrasala <
>> aswath.satras...@gmail.com> wrote:
>>
>>> Hello,
>>> Is there any limit on the number of namespaces per app-id.?
>>>
>>> -Aswath
>>> www.AccountingGuru.in
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-java@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> 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
> "giannim" group.
> To post to this group, send email to gian...@google.com.
> To unsubscribe from this group, send email to
> giannim+unsubscr...@google.com.
> For more options, visit this group at
> http://groups.google.com/a/google.com/group/giannim/?hl=en.
>



-- 
Gianni Mariani
Google, Sydney

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



Re: [appengine-java] Re: No of namespaces limit ?

2011-06-15 Thread Ikai Lan (Google)
No limit.

Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine



On Thu, Jun 16, 2011 at 10:18 AM, Aswath Satrasala <
aswath.satras...@gmail.com> wrote:

> Any replies on this...
>
> -Aswath
>
>
> On Tue, Jun 14, 2011 at 9:44 PM, Aswath Satrasala <
> aswath.satras...@gmail.com> wrote:
>
>> Hello,
>> Is there any limit on the number of namespaces per app-id.?
>>
>> -Aswath
>> www.AccountingGuru.in
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



[appengine-java] Re: No of namespaces limit ?

2011-06-15 Thread Aswath Satrasala
Any replies on this...

-Aswath

On Tue, Jun 14, 2011 at 9:44 PM, Aswath Satrasala <
aswath.satras...@gmail.com> wrote:

> Hello,
> Is there any limit on the number of namespaces per app-id.?
>
> -Aswath
> www.AccountingGuru.in
>

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



[appengine-java] Re: 1.5.1 SDK Prerelease

2011-06-15 Thread nischalshetty
You guys fixed the Struts 2 issue! Thank you so much :)

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



[appengine-java] Re: Is Google planning to offer HR datastore migration feature

2011-06-15 Thread Brendan Doherty
I have not gone live with my app yet, so I don't mind losing all my data, 
but i'd rather not lose my appid (at least until ssl on domains are sorted).

Is it possible to switch to HR from M/S and keep the app id?

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



Re: [appengine-java] Re: When to use a String as ID? (using Objectify and GWT)

2011-06-15 Thread Jeff Schnitzer
One case is when you need to save several different entities that all
reference each other.  Let's say A has a reference to B, and B has a
reference to A.  If you relied on key autogeneration you would need 3 puts:

 * Put A (which initializes the id)
 * Set B.a to the id of A, put B
 * Set A.b to the id of B, put A again

Instead you can just allocate two ids up front and put both entities
together (in a batch if you'd like).

Jeff

On Wed, Jun 15, 2011 at 3:26 AM, Drew Spencer  wrote:

> Thanks Jeff, I think I will use Longs as you suggest. I was
> originally thinking "why add an extra piece of data when there's a unique
> value there?" Well, now I know why!
>
> Just one question - the DatastoreService.allocateIdRange() - when would
> this be used? I have read the javadoc and understand that it reserves the
> IDs for bulk loading etc, but can you give an example of when it might be
> used. At the moment I have some code that creates 5 lists of my 5 entities
> (dummy data), puts all 5 lists to the datastore, links them up using keys,
> and then puts them all again. Is there a better way to do this?
>
> Thanks again for being so helpful.
>
> Drew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine-java/-/ErZFcwnAoRUJ.
>
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] Read entity by key returns wrong result type

2011-06-15 Thread Zerot Samsa
To clear things up:
SDK = 1.4.2

The bug appears very often in development mode and very rarely in production
mode.
Any ideas?
Thanks,
Z

On Sun, Jun 12, 2011 at 3:36 PM, Zerot Samsa  wrote:

> Hi!
>
> I have a very strange problem when retrieving entities from the
> datastore (I'm using Twig as my persistence framework.)
>
> Let's say a have an entity of the type A which looks something like:
>
> class A
> {
>  private String someString;
>  @Embed
>  private B b;
>  @Embed
>  private ArrayList cList;
> }
>
> Now sometimes when reading an entity A with a given key (which is 100%
> valid -> i can see this entity in the admin console) the operation
> does return an object of the type B or C (or any other type of any of
> A's fields.)
> So basically the read/find command returns any of A's fields instead
> of the entity A.
> Any ideas?
>
> Thanks,
> Z
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: Channel API (Java) doesn't work locally, but in production mode.

2011-06-15 Thread Zerot Samsa
Thanks for the quick reply.
At least now I get what's happening under the hood ;)
I will try to simplify the client id and will inform you about the result.

We are using SDK 1.4.2
Do you think that might be the problem?
If so, we will try to migrate to 1.5.

Thanks so far.
I will post the result of simplyfing the client when I get to do it.


On Wed, Jun 15, 2011 at 8:09 PM, Moishe  wrote:

> First, what version of the SDK are you using? It looks like you're
> using something before 1.5.0 (based on the text of the error message)
> -- can you try with 1.5.0?
>
> Basically the logic that's happening here is:
>
>  - the application calls create channel
>  - the dev appserver gins up a token consisting of a random string
> plus the application-provided client id
>  - the dev appserver adds this token to a hashmap of token -> clientid
>  - the dev appserver returns the token
>
> Later, when the client connects, this happens:
>
>  - the client makes a post to /_ah/channel/dev?
> command=connect&channel={{token}}
>  - the dev appserver intercepts this request and looks up the
> "channel" query param in the hashmap of token -> clientid
>
> What seems to be happening in your case is that the dev appserver
> can't extract the "channel" query param based on the "application key
> is null" error. All I can think of is that there's something in the
> token that's preventing the query params from being parsed correctly.
> As a test, can you try simplifying your client id? (I can't read the
> whole thing because Groups thinks it's an email address and elides it)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] I must stay at v1.40 for a long time, just for a serious bug each for v1.43 and v1.50

2011-06-15 Thread Tapir
For v1.43: the bug is 
http://code.google.com/p/googleappengine/issues/detail?id=4653
For v1.50, the bug is 
http://code.google.com/p/googleappengine/issues/detail?id=5053

Hi, googlers, could you be more serious on the app engine java sdk?

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



[appengine-java] Re: 1.5.1 SDK Prerelease

2011-06-15 Thread Tapir
Warning: Failed startup of context
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@17b40fe{/,/
home/xxx/.build/war}
 [java] java.lang.NullPointerException
 [java] at
com.google.appengine.tools.appstats.Recorder.checkNotNull(Recorder.java:
365)
 [java] at
com.google.appengine.tools.appstats.Recorder.(Recorder.java:207)
 [java] at
com.google.appengine.tools.appstats.Recorder.(Recorder.java:197)
 [java] at
com.google.appengine.tools.appstats.AppstatsFilter.init(AppstatsFilter.java:
183)
 [java] at
org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
 [java] at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
 [java] at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:
662)
 [java] at
org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
 [java] at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:
1250)
 [java] at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
517)
 [java] at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
 [java] at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
 [java] at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
130)
 [java] at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
 [java] at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
130)
 [java] at org.mortbay.jetty.Server.doStart(Server.java:224)
 [java] at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
 [java] at
com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:
186)
 [java] at
com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:
162)
 [java] at
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:
164)
 [java] at com.google.appengine.tools.development.DevAppServerMain
$StartAction.apply(DevAppServerMain.java:164)
 [java] at com.google.appengine.tools.util.Parser
$ParseResult.applyArgs(Parser.java:48)
 [java] at
com.google.appengine.tools.development.DevAppServerMain.(DevAppServerMain.java:
113)
 [java] at
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:
89)


On Jun 15, 5:19 pm, Johan Euphrosine  wrote:
> Hi everyone,
>
> Prerelease SDK for 1.5.1 is ready for testing, feel free to download
> and give it a try for local 
> verification:http://code.google.com/p/googleappengine/downloads/list
>
> See release notes below: notice ProtoRPC, Channel API presence, WebP
> support, X-AppEngine-Country header and a lot of bug fixes.
>
> Happy testing!
>
> Python
> 
> - ProtoRPC is a new experimental library that provides a simple method for
>   creating a well-defined and easy-to-use web-based RPC service.
> - The development server's datastore implementation now contains logic that
>   closely replicates the consistency guarantees of the High Replication
>   datastore. To use, run the dev_appserver with the flag --high_replication 
> set
>   to True.
> - All user request have an X-AppEngine-Country header which contains the
>   ISO-3166-1 alpha-2 country code for the user, based on the IP address of the
>   client request.
> - The Channel API can now provide user presence, this can be configured by
>   adding channel_presence to the list of inbound services for your 
> application.
> - The Images API now supports the WebP format. Due to limitations in PIL, the
>   SDK does not support the WebP format.
> - You can switch the timezone for App Engine logs in the Admin Console.
>  http://code.google.com/p/googleappengine/issues/detail?id=734
> - Fixed an issue in the SDK where leased tasks had the POST method. They now
>   have a PULL method.
> - Fixed an issue where the Channel API didn't work with non-default versions 
> of
>   applications using the High Replication datastore.
> - When displaying corrupt data in the Admin Console dataviewer, a useful error
>   will be displayed, instead of a 500.
>  http://code.google.com/p/googleappengine/issues/detail?id=4945
>
> Java
> =
> - The development server's datastore and testing service implementations now
>   contains logic that closely replicates the consistency guarantees of the 
> High
>   Replication datastore. To use, run the dev_appserver with the flag
>   -Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20.
> - All user request have an X-AppEngine-Country header which contains the
>   ISO-3166-1 alpha-2 country code for the user, based on the IP address of the
>   client request.
> - The Channel API can now provide user presence, this can be configured by
>   adding channel_presence to the list of inbound ser

[appengine-java] Newbie question: how to create the memcache across several instances

2011-06-15 Thread Inderjeet Singh
Hi Folks, 

Pardon the somewhat basic question, I did try going through various online 
guides but never really got the answer to this one. 
I am running app-engine with 3 instances. I share data across these 
instances using Memcache. What is the right way to instantiate it such that 
all three appengine instances end up writing to the same cache? 

Here is the code that I used:
 public static synchronized  Map createMemcache(
  String cacheName, ReadableDuration inactivityTimeout, @Nullable 
CacheListener cacheListener) {
try {
  CacheManager cacheMgr = CacheManager.getInstance();
  Cache cache = cacheMgr.getCache(cacheName);
  if (cache == null) {
CacheFactory cacheFactory = cacheMgr.getCacheFactory();
ImmutableMap env =
  ImmutableMap.of(GCacheFactory.EXPIRATION_DELTA_MILLIS, 
inactivityTimeout.getMillis());
cache = cacheFactory.createCache(env);
if (cacheListener != null) {
  cache.addListener(cacheListener);
}
cacheMgr.registerCache(cacheName, cache);
  }
  return cache;
} catch (CacheException e) {
}

Any comments? Will this create the shared Memcache as I want it?

Thanks
Inder

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



[appengine-java] Re: Multi-threaded datastore test in JUnit

2011-06-15 Thread Inderjeet Singh
Thanks for the detailed reply and the code to reproduce that it works, 
Frank. 

I am using Memcache as the datastore as a temporary measure and for faster 
performance. In my application, I can live with the fact that the cache can 
be cleared out. 

Thanks
Inder
 

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



[appengine-java] Re: Channel API (Java) doesn't work locally, but in production mode.

2011-06-15 Thread Moishe
First, what version of the SDK are you using? It looks like you're
using something before 1.5.0 (based on the text of the error message)
-- can you try with 1.5.0?

Basically the logic that's happening here is:

 - the application calls create channel
 - the dev appserver gins up a token consisting of a random string
plus the application-provided client id
 - the dev appserver adds this token to a hashmap of token -> clientid
 - the dev appserver returns the token

Later, when the client connects, this happens:

 - the client makes a post to /_ah/channel/dev?
command=connect&channel={{token}}
 - the dev appserver intercepts this request and looks up the
"channel" query param in the hashmap of token -> clientid

What seems to be happening in your case is that the dev appserver
can't extract the "channel" query param based on the "application key
is null" error. All I can think of is that there's something in the
token that's preventing the query params from being parsed correctly.
As a test, can you try simplifying your client id? (I can't read the
whole thing because Groups thinks it's an email address and elides it)

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



[appengine-java] How to compare date in query

2011-06-15 Thread hairinwind
What I want to do

query.setFileter("startTime > now ")

how to pass in the parameter for 'now'?

I tried both below and non of them works

query.setFileter("startTime > " + (new Date()))
query.setFileter("startTime > " + (new Date().getTime()))

Please suggest!

Thanks!

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



[appengine-java] Re: Multi-threaded datastore test in JUnit

2011-06-15 Thread esorf
Hi, Inder.

I ran the following test, which indicates to me that memcache is shared 
nicely between threads.

@Test
public void testThreadedMemcacheAccess() throws InterruptedException {
final String key = "foo";
final String value = "bar";
 Thread t = new Thread(new Runnable() {
public void run() {
ApiProxy.setEnvironmentForCurrentThread(testEnvironment);
MemcacheService mc = MemcacheServiceFactory.getMemcacheService();
mc.put(key, value);
}
});
t.start();
t.join(); // Wait for thread to finish

final Map inCache = new HashMap(); // A 
convenience to get a value out of the following thread so that our assert 
can be in the main test thread
 t = new Thread(new Runnable() {
public void run() {
ApiProxy.setEnvironmentForCurrentThread(testEnvironment);
MemcacheService mc = MemcacheServiceFactory.getMemcacheService();
String cached = (String)mc.get(key);
inCache.put(key, cached);
}
});
t.start();
t.join(); // Wait for thread to finish
 assertEquals(value, inCache.get(key));
}

So, I suspect your problem is elsewhere.  Run this test in your environment 
to confirm it for yourself.

This scares me: << I am using Memcache as the data store>>.  You're aware 
that the memcache may be cleared at any point for many reasons?  You can't 
rely on values you put there being there the next time you look.

Good luck,
- Frank

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



[appengine-java] Re: 1.5.1 SDK Prerelease

2011-06-15 Thread Dan Dubois
Great news!
 
Where can I find more information about the Channel API's user presence 
functionality?
 
Best wishes,
Dan

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



[appengine-java] Re: Jersey / Json problem: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector

2011-06-15 Thread Raphael André Bauer
On Wed, Jun 15, 2011 at 11:28 AM, Raphael André Bauer
 wrote:
> Hi,
>
>
> I wrote a really simple rest interface setup using jersey-server /
> jersey-guice / jersey-json (1.7) and delivering json as output.
> It runs without any problems on the local dev environment, but I am getting a
>
> Could not initialize class
> com.sun.xml.bind.v2.runtime.reflect.opt.Injector (full stack trace
> attached [2]).
>
> on the production environment (1.5.0.1). This might also be related to
> discussion [1].

I just played around a bit and it seems that the problem is jaxb-impl
(group com.sun.xml.bind).
Version 2.1.12 works (yea!), version 2.2.4 (latest) does not work on
App Engine production and yields the
error I described in my previous mail.

Is this a known issue?


Best,


Raphael

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



Re: [appengine-java] Re: Channel API (Java) doesn't work locally, but in production mode.

2011-06-15 Thread Zerot Samsa
Any ideas? This problem is starting to get really frustrating :(
Help would be very appreciated :)

On Mon, Jun 13, 2011 at 3:24 PM, Zerot Samsa  wrote:

> Yes, that's the value returned by ChannelService.createChannel(channelId),
> where channelId is the email address of an user, which explains the "@".
> Should we use something else as the client id and/or remove all special
> characters of the clientId?
> Thanks.
>
>
> On Mon, Jun 13, 2011 at 2:49 PM, Moishe  wrote:
>
>> That token looks malformed to me. The dev appserver tokens shouldn't
>> have an @ in them. Is that the value directly returned by
>> ChannelService.createChannel() or is it modified in some way?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-java@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>

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



[appengine-java] Instructions for migrating a GAE-Java app to the HR datastore

2011-06-15 Thread tempy
I've finally decided to upgrade, while my data still isn't huge.
Maybe I'm missing something, but I'm yet to find an article or blog
post or group entry that has simple "recommended" steps, instead I'm
piecing the procedure together.  As I understand it, it goes something
like this:

- Install python SDK, create python version of source Java app.

- This should open the datastore admin section in the dashboard for my
app.

- Create new java app with HR datastore, this will be the target.
Create python version of that app, and also follow the directions
here: 
http://code.google.com/appengine/docs/adminconsole/datastoreadmin.html#Copying_Entities_to_Another_Application

- Copy all data from one app to the other.

- Go here: 
http://code.google.com/support/bin/request.py?contact_type=AppEngineBillingSupport
And beg them to make an alias from the old ID to the new one so that
my custom domain remains functional.

- Enable billing for new app, hope it goes smoothly.

I'm fuzzy on pretty much all of this and I'm sure I'm missing
something, and while I normally don't mind muddling through, this
procedure means downtime so I would rather not run into any
surprises.  Has anyone done this?  Is there some guidance out there
that I'm missing?  Does anyone know how this effects existing oauth
tokens generated for the app, or new ones?

Thanks!

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



[appengine-java] Re: How to design an in-memory cache?

2011-06-15 Thread tempy
Prashant, thats exactly what we were talking about, that code looks
great, thanks!

On Jun 15, 12:46 pm, Prashant  wrote:
> Hi,
>
> I am using such implementation, with 15 mins refresh time, for my
> application. you can see the implementation here ...
>
> https://code.google.com/p/claymus/source/browse/trunk/src/com/claymus...
>
>
>
>
>
>
>
> On Wed, Jun 15, 2011 at 3:37 PM, tempy  wrote:
> > Didier and J. Ganesan, I'm not talking about memcache.  I want
> > something as simple as a static map with synchronized access, within
> > which I would cache data.
>
> > Jeff, how would one accomplish that 30 minute timeout, without
> > threads, timers, etc.   I suppose I could keep the time of entry, and
> > if more than 30 minutes has elapsed then I fall back onto memcache or
> > the datastore, not pretty but it'll do.  And yes what you mention
> > would be very nice to have.
>
> > On Jun 14, 5:33 pm, "J.Ganesan"  wrote:
> > > Why not call memcacheService.delete( keyObject ) ?
>
> > > J.Ganesan
>
> > > On Jun 14, 8:25 pm, tempy  wrote:
>
> > > > Hello all,
> > > > I'm wondering if its possible to design a cache using data in static
> > > > variables.  I have certain pieces of small and unchanging data, such
> > > > as a banner for the top of the site whose contents might only change
> > > > every couple of days.  This is perfect for storing in a static
> > > > variable and falling back onto the memcache as necessary.  The one
> > > > thing I don't know how to do is to clear that cache.  If I want to
> > > > update that data, I can clear the memcache, but there's no way that I
> > > > can think of to clear static data cache, other than to wait until a
> > > > particular instance goes down, and who knows when that will happen.
> > > > Any ideas?  Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-java@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

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



Re: [appengine-java] Re: How to design an in-memory cache?

2011-06-15 Thread Prashant
Hi,

I am using such implementation, with 15 mins refresh time, for my
application. you can see the implementation here ...

https://code.google.com/p/claymus/source/browse/trunk/src/com/claymus/Localcache.java


On Wed, Jun 15, 2011 at 3:37 PM, tempy  wrote:

> Didier and J. Ganesan, I'm not talking about memcache.  I want
> something as simple as a static map with synchronized access, within
> which I would cache data.
>
> Jeff, how would one accomplish that 30 minute timeout, without
> threads, timers, etc.   I suppose I could keep the time of entry, and
> if more than 30 minutes has elapsed then I fall back onto memcache or
> the datastore, not pretty but it'll do.  And yes what you mention
> would be very nice to have.
>
> On Jun 14, 5:33 pm, "J.Ganesan"  wrote:
> > Why not call memcacheService.delete( keyObject ) ?
> >
> > J.Ganesan
> >
> > On Jun 14, 8:25 pm, tempy  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hello all,
> > > I'm wondering if its possible to design a cache using data in static
> > > variables.  I have certain pieces of small and unchanging data, such
> > > as a banner for the top of the site whose contents might only change
> > > every couple of days.  This is perfect for storing in a static
> > > variable and falling back onto the memcache as necessary.  The one
> > > thing I don't know how to do is to clear that cache.  If I want to
> > > update that data, I can clear the memcache, but there's no way that I
> > > can think of to clear static data cache, other than to wait until a
> > > particular instance goes down, and who knows when that will happen.
> > > Any ideas?  Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] Re: Multi-threaded datastore test in JUnit

2011-06-15 Thread Inderjeet Singh
I am running into a similar issue. I am using Memcache as the data store. To 
simulate access by different clients, I am using multiple threads that 
access the same memcache. However, thread A is not seeing the data put by 
thread B. I tried using ApiProxy.setEnvironmentForCurrentThread with a test 
environment, but that didn't help.

Please help!
Inder

Here is how my Test Environment looks like:
Environment testEnvironment = new Environment() {
  @Override
  public String getAppId() {
return "test";
  }

  @Override
  public Map getAttributes() {
// TODO Auto-generated method stub
return Maps.newHashMap();
  }

  @Override
  public String getAuthDomain() {
return "authDomain";
  }

  @Override
  public String getEmail() {
return "f...@bar.com";
  }

  @Override
  public String getRequestNamespace() {
return "test";
  }

  @Override
  public String getVersionId() {
return "1";
  }

  @Override
  public boolean isAdmin() {
return false;
  }

  @Override
  public boolean isLoggedIn() {
return false;
  }
};
ApiProxy.setEnvironmentForCurrentThread(testEnvironment);

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



Re: [appengine-java] Re: When to use a String as ID? (using Objectify and GWT)

2011-06-15 Thread Drew Spencer
Thanks Jeff, I think I will use Longs as you suggest. I was 
originally thinking "why add an extra piece of data when there's a unique 
value there?" Well, now I know why!

Just one question - the DatastoreService.allocateIdRange() - when would this 
be used? I have read the javadoc and understand that it reserves the IDs for 
bulk loading etc, but can you give an example of when it might be used. At 
the moment I have some code that creates 5 lists of my 5 entities (dummy 
data), puts all 5 lists to the datastore, links them up using keys, and then 
puts them all again. Is there a better way to do this?

Thanks again for being so helpful.

Drew

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



[appengine-java] Re: How to design an in-memory cache?

2011-06-15 Thread tempy
Didier and J. Ganesan, I'm not talking about memcache.  I want
something as simple as a static map with synchronized access, within
which I would cache data.

Jeff, how would one accomplish that 30 minute timeout, without
threads, timers, etc.   I suppose I could keep the time of entry, and
if more than 30 minutes has elapsed then I fall back onto memcache or
the datastore, not pretty but it'll do.  And yes what you mention
would be very nice to have.

On Jun 14, 5:33 pm, "J.Ganesan"  wrote:
> Why not call memcacheService.delete( keyObject ) ?
>
> J.Ganesan
>
> On Jun 14, 8:25 pm, tempy  wrote:
>
>
>
>
>
>
>
> > Hello all,
> > I'm wondering if its possible to design a cache using data in static
> > variables.  I have certain pieces of small and unchanging data, such
> > as a banner for the top of the site whose contents might only change
> > every couple of days.  This is perfect for storing in a static
> > variable and falling back onto the memcache as necessary.  The one
> > thing I don't know how to do is to clear that cache.  If I want to
> > update that data, I can clear the memcache, but there's no way that I
> > can think of to clear static data cache, other than to wait until a
> > particular instance goes down, and who knows when that will happen.
> > Any ideas?  Thanks!

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



[appengine-java] 1.5.1 SDK Prerelease

2011-06-15 Thread Johan Euphrosine
Hi everyone,

Prerelease SDK for 1.5.1 is ready for testing, feel free to download
and give it a try for local verification:
http://code.google.com/p/googleappengine/downloads/list

See release notes below: notice ProtoRPC, Channel API presence, WebP
support, X-AppEngine-Country header and a lot of bug fixes.

Happy testing!

Python

- ProtoRPC is a new experimental library that provides a simple method for
  creating a well-defined and easy-to-use web-based RPC service.
- The development server's datastore implementation now contains logic that
  closely replicates the consistency guarantees of the High Replication
  datastore. To use, run the dev_appserver with the flag --high_replication set
  to True.
- All user request have an X-AppEngine-Country header which contains the
  ISO-3166-1 alpha-2 country code for the user, based on the IP address of the
  client request.
- The Channel API can now provide user presence, this can be configured by
  adding channel_presence to the list of inbound services for your application.
- The Images API now supports the WebP format. Due to limitations in PIL, the
  SDK does not support the WebP format.
- You can switch the timezone for App Engine logs in the Admin Console.
  http://code.google.com/p/googleappengine/issues/detail?id=734
- Fixed an issue in the SDK where leased tasks had the POST method. They now
  have a PULL method.
- Fixed an issue where the Channel API didn't work with non-default versions of
  applications using the High Replication datastore.
- When displaying corrupt data in the Admin Console dataviewer, a useful error
  will be displayed, instead of a 500.
  http://code.google.com/p/googleappengine/issues/detail?id=4945

Java
=
- The development server's datastore and testing service implementations now
  contains logic that closely replicates the consistency guarantees of the High
  Replication datastore. To use, run the dev_appserver with the flag
  -Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20.
- All user request have an X-AppEngine-Country header which contains the
  ISO-3166-1 alpha-2 country code for the user, based on the IP address of the
  client request.
- The Channel API can now provide user presence, this can be configured by
  adding channel_presence to the list of inbound services for your application.
- The Images API now supports the WebP format.
- You can switch the timezone for App Engine logs in the Admin Console.
  http://code.google.com/p/googleappengine/issues/detail?id=734
- Added javax.xml.ws.Service$Mode to the whitelist.
  http://code.google.com/p/googleappengine/issues/detail?id=4770
- You can configure your application to asynchronously write https session data
  by adding  to your
  appengine-web.xml.
  http://code.google.com/p/googleappengine/issues/detail?id=1692
- The local task queue unit testing API now supports Deferred Tasks.
- Fixed an issue where using reserved URLs did not cause an error in the SDK.
- Fixed an issue where having a backends.xml configuration file caused logging
  to stdout to fail in the SDK.
- Fixed an issue where the Channel API didn't work with non-default versions of
  applications using the High Replication datastore.
- Fixed an issue where the Remote API rtok comparison was broken for some users,
  causing appfcg download data to fail.
- Fixed an issue with the SDK where you could not apply a transform to PNG
  images.
  http://code.google.com/p/googleappengine/issues/detail?id=3458
- When displaying corrupt data in the Admin Console dataviewer, a useful error
  will be displayed, instead of a 500.
  http://code.google.com/p/googleappengine/issues/detail?id=4945
- Fixed an issue with the SDK where non-string index names caused an error upon
  upload.
  http://code.google.com/p/googleappengine/issues/detail?id=5004
- Datanucleus now supports polymorphic relationships.
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=153
- Datanucleus now supports PreparedQuery#countEntities(FetchOptions).
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=225
- Fixed an issue with datanucleus where recursive relation did not work.
  http://code.google.com/p/datanucleus-appengine/issues/detail?id=80
-- 
Johan Euphrosine (proppy)
Developer Programs Engineer
Google Developer Relations

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



[appengine-java] Jersey / Json problem: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector

2011-06-15 Thread Raphael André Bauer
Hi,


I wrote a really simple rest interface setup using jersey-server /
jersey-guice / jersey-json (1.7) and delivering json as output.
It runs without any problems on the local dev environment, but I am getting a

Could not initialize class
com.sun.xml.bind.v2.runtime.reflect.opt.Injector (full stack trace
attached [2]).

on the production environment (1.5.0.1). This might also be related to
discussion [1].


Is there any hint from the pros what to tell jersey so that this error
goes away?
Btw - I thought that jersey / jaxb  was fully supported on the App
Engine... Maybe I am wrong...


Thanks,


Raphael


[1] 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/704a65ae169575fc

[2] Uncaught exception from servlet
java.lang.NoClassDefFoundError: Could not initialize class
com.sun.xml.bind.v2.runtime.reflect.opt.Injector
at 
com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:83)
at 
com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:176)
at 
com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:282)
at 
com.sun.xml.bind.v2.runtime.property.ArrayProperty.(ArrayProperty.java:69)
at 
com.sun.xml.bind.v2.runtime.property.ArrayERProperty.(ArrayERProperty.java:88)
at 
com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.(ArrayElementProperty.java:100)
at 
com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.(ArrayElementNodeProperty.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
at 
com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:128)
at 
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.(ClassBeanInfoImpl.java:183)
at 
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:532)
at 
com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:347)
at 
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
at 
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
at 
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:159)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:311)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:392)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:357)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:264)
at 
com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.(WadlApplicationContextImpl.java:72)
at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:97)
at 
com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)
at 
com.sun.jersey.server.impl.application.RootResourceUriRules.(RootResourceUriRules.java:106)
at 
com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
at 
com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:167)
at 
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
at 
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:769)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at 
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:769)
at 
com.sun.jersey.guice.spi.container.servlet.GuiceContainer.initiate(GuiceContainer.java:121)
at 
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
at 
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
at 
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
at 
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at 
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at 
com.google.inject.servlet.Servlet

Re: [appengine-java] Introduce a delay in client side java code

2011-06-15 Thread Ravi Sharma
I think you partially answered your self, If you cant do it on server then
use Thread.sleep at client side.

also you have option to use DelayQueue at client side(if its not
GWT)
http://download.oracle.com/javase/6/docs/api/java/util/concurrent/DelayQueue.html
Put your all request on to this queue..and  write one consumer which will
read data from this queue and send it to GAE.

Ravi



On Tue, Jun 14, 2011 at 6:59 AM, Ronald  wrote:

> I want to code on client side sending RPC to server per minute.
> As app engine does not allow Thread.sleep and timer, what is the
> workaround of that?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] Getting identity value after persist, with JPA and without transaction

2011-06-15 Thread SS Jong
I am using GAE SDK 1.5, running locally, I have entity id declared as:

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;

and transaction explicitly disabled in persistence.xml

   

but after new object is persisted by calling
entityManager.persiste(new object), the id value is null, the session
can't be flushed because it is not in transaction, and I wouldn't be
able to get the newly created id value.

if transaction is enabled, GAE entity group will prevent entity
modification across different entity groups, which mean I have to make
major modification to the codes; without transaction, I can't flush or
commit and wouldn't be able to get the newly created entity key...

am I doing something wrong? how do you get the new identity value
after persist without transaction?

thanks.

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



[appengine-java] Re: Multi-threaded datastore test in JUnit

2011-06-15 Thread esorf
Ok, I kept trying things until I found something that worked.  The 
information is in a few posts out there as they touch on related issues.

In each thread I call
ApiProxy.setEnvironmentForCurrentThread(testEnvironment);

The testEnvironment is just
Environment testEnvironment = new Environment() {
// Implementations of all Environment value getters.  Specifically, 
return "test" for appid in order to match default Environment 
implementation.
}

http://code.google.com/appengine/docs/java/tools/localunittesting.html no 
longer refers to Environment, but it's clearly still important for 
multi-threaded testing.

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



[appengine-java] Re: Receiving incomplete HTML MimeMessage

2011-06-15 Thread John Wheeler
Hi Dan,

I know it's been a while, but were you ever able to work around this?

Thanks
John

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



[appengine-java] Multi-threaded datastore test in JUnit

2011-06-15 Thread esorf
I'm running JUnit tests under Eclipse.  I initialize the LocalHelper objects 
in setUp().  Everything works fine in a single thread.

I'd like to test concurrent access to the datastore to see that all my 
transactioning is correct, so I spin up a bunch of threads to do that.  The 
problem is that to the threads I create, the datastore appears empty.

I've tried things like running the localhelper setUp() command within the 
threads, but I'm just guessing.

I'm looking for definitive answers to:
1. Is it possible to initialize test threads so that they point at the same 
datastore.  If not, I'll just go some other route.
2. What are the initialization steps for threads?  (I'm also accessing 
Memcache in addition to datastore).

Anyone with good references or docs or special knowledge with answers to 
this?  Thanks.

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



[appengine-java] Re: How to design an in-memory cache?

2011-06-15 Thread J.Ganesan
Why not call memcacheService.delete( keyObject ) ?

J.Ganesan

On Jun 14, 8:25 pm, tempy  wrote:
> Hello all,
> I'm wondering if its possible to design a cache using data in static
> variables.  I have certain pieces of small and unchanging data, such
> as a banner for the top of the site whose contents might only change
> every couple of days.  This is perfect for storing in a static
> variable and falling back onto the memcache as necessary.  The one
> thing I don't know how to do is to clear that cache.  If I want to
> update that data, I can clear the memcache, but there's no way that I
> can think of to clear static data cache, other than to wait until a
> particular instance goes down, and who knows when that will happen.
> Any ideas?  Thanks!

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



[appengine-java] Re: Long Term Authorisation

2011-06-15 Thread Ray
Hi Martin,

OAuth might work for you. I'm building an app on GAE using OAuth to
connect with meetup.com's API. It works like a charm once you figure
out the OAuth workflow. I'm using OAuth v1, and the access tokens
don't expire until the user explicitly revokes access to your
application. People often recommend you store the access tokens. OAuth
v2 is the way to go for new applications.

You can still use Google accounts for authentication. But keep in mind
that the accounts people use to access the website you're connecting
to (e.g. meetup.com) might not be their Google account. So, to access
your app, in the worst case, people would need to have an account for
the website (e.g. meetup.com) and Google.

FYI .. I'm using scribe-java for OAuth: 
https://github.com/fernandezpablo85/scribe-java
and objectify-appengine for the GAE datastore: 
http://code.google.com/p/objectify-appengine/

--
Ray

On Jun 13, 1:41 pm, Martin  wrote:
> Hi Guys,
>
> I'm building a java app that serves content to multiple mobile devices
> running a phonegap-style native/web app.
> I'm looking for a way to have these devices only have to register once then
> be authenticated for all futher requests to appengine.
> From what I've read OAuth seems like a good fit but that would restrict me
> to using google accounts for authentication. Is OAuth even suitable for
> this, do the tokens expire?
> Is there a simpler way to achieve this in java by saving session objects for
> example without majorly compromising security?
>
> Any help would be much appreciated!
>
> Thanks,
>
> Martin

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



[appengine-java] Introduce a delay in client side java code

2011-06-15 Thread Ronald
I want to code on client side sending RPC to server per minute.
As app engine does not allow Thread.sleep and timer, what is the
workaround of that?

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



[appengine-java] Re: Usage of this forum

2011-06-15 Thread Simon Knott
Hi,

I suspect that it is because your last few posts have been asking questions 
about only GWT - if you keep you GAE questions in this forum and the GWT 
questions in the GWT forum, I suspect you'll get more responses!

Cheers,
Simon

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



[appengine-java] Usage of this forum

2011-06-15 Thread meiaestro
Hi Experts,

as I am a Newbie in AppEngin and GWT and therefore of this forum I was 
wondering if I use it accurately. Reason of this question is, that my first 
questions have   been read (and also answered) within just a few minutes. 
Now there hasn't had any reaction on my last 3 postings, so I was wondering 
if I do anything wrong?

I Would be thankful for any advise.
Regards.

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



Re: [appengine-java] How to design an in-memory cache?

2011-06-15 Thread Jeff Schnitzer
Sounds like you could just keep it around for 30 minutes or an hour,
refreshing it after it expires.

What would be nice is to be able to perform the refresh asynchronously.  Say
it takes 5s to build a piece of data that every appserver uses for
practically every request.  Instead of relying on memcache, it would be nice
to just keep this as static/application-scoped data in the appserver - and
have a cron job that updates every instance every 15 minutes or so.

This is easy to do if I can create threads, and a common pattern in the
JavaEE world.

Jeff

On Tue, Jun 14, 2011 at 8:25 AM, tempy  wrote:

> Hello all,
> I'm wondering if its possible to design a cache using data in static
> variables.  I have certain pieces of small and unchanging data, such
> as a banner for the top of the site whose contents might only change
> every couple of days.  This is perfect for storing in a static
> variable and falling back onto the memcache as necessary.  The one
> thing I don't know how to do is to clear that cache.  If I want to
> update that data, I can clear the memcache, but there's no way that I
> can think of to clear static data cache, other than to wait until a
> particular instance goes down, and who knows when that will happen.
> Any ideas?  Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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