[appengine-java] Re: Checking if I understand transactions correctly

2011-06-02 Thread Nichole
I think you might be a little confused about the difference between
appengine's
transaction in a distributed environment and an enterprise 2-phase
transaction
in a more classic client server architecture?

appengine uses a distributed datastore, so entities are stored all
over the place by default.

In order to ensure that operations on your entities occur with
anything like atomicity all the entities
have to be co-located, that is stored near one another in the
datastore.  That means that
they need to be in the same entity group (which means when you make
your keys, they have
to have the same parent = ancestor).  The appengine transaction is for
use when your entities
are in the same entity group.
Once you get that correct, you'll see that rollback is executed if the
transaction doesn't finish in the
correct state.

I've been thinking about the banking use case with a distributed
datastore for a little while, and I think that
if appengine were to offer a low-level api for increment or decrement
operations on primitives
that behind the scenes did not use full ORM, but rather operate on the
file in place, that might be helpful...
When we fetch an entity and operate on it, *if* the 'updates' occur
out of order such as can happen during
high frequency updates, we have a total that isn't what's expected.
The work arounds for this
could be several, including [you] designing history entities that
store the timestamp and operation to be performed
and a reference to the entity to be performed on.  Then writing a
service that waits a short while then
processes those 'operation entities' will leave your datastore in a
consistent state.
Note that appengine is using similar but more complex logic in its
persistence of entities already, but here you programmatically decide
the time frame for consistency and that timeframe has to be longer
that of the appengine's distributed datastore consistency.   That was
a little long winded, but I think if you're going to use this
framework
for bank-type operations then you want to think about how to assure
consistency on timescales for your datastore,
and then on timescales for your client.  The solution for client
consistency often uses memcache...

Hope that's helpful.


On May 31, 10:52 pm, Lars Borup Jensen lbor...@gmail.com wrote:
 Huh?

 As you are only able to do work in a single transactional unit-of-work
 on a single entity-group, rollback must be considered usefull.
 In the above mentioned snippet, an Account entity is looked-up,
 updated and a child entity TransactionRecord is added, all in a single
 entity-group, namely the Account's. So a rollback will undo all
 operations.
 If you had added TransactionRecord to, lets say a TransactionRecords
 entity-group, you would have gotten an error if you were operating in
 a transactional scope, or no-transaction support at all, hence a
 rollback would not have been possible.

 Cheers, Lars Borup Jensen

 On 1 Jun., 06:21, Didier Durand durand.did...@gmail.com wrote:







  Hi,

  entity group is not useful at rollback but rather limits you to which
  updates you can do: all the entities you touch in a single transaction
  must be in the same entity group.

  So, designing your groups properly is a key design issue in GAE to
  avoid unnecessary complexity when you later need to update at once
  entities that you created before in various groups.

  regards

  didier

  On May 30, 7:57 am, Jacob jacob.rho...@gmail.com wrote:

   I am writing some code that needs to do a rollback on a secondary
   object/table should the transaction fail, I believe this can be done
   via entity groups, however I am not sure if this is how it would be
   implemented. I have written some sample code to check if what I would
   be doing is correct?

   Would the following code ensure the Account object is never updated
   if the insert of the TransactionRecord object fails.

           public void addTransaction(String account, Double value, String
   description, Date date) throws EntityNotFoundException {
                   DatastoreService datastore =
   DatastoreServiceFactory.getDatastoreService();

                   int retries = 3;
                   while (true) {
                           Transaction txn = datastore.beginTransaction();
                           try {

                                   // Update the bank balance
                                   Key key = KeyFactory.createKey(Account, 
   account);
                                   Entity e = datastore.get(key);
                                   Double balance = (Double) 
   e.getProperty(balance);
                                   balance += value;
                                   e.setProperty(balance, value);
                                   datastore.put(e);

                                   // Record transaction details
                                   Entity d = new 
   Entity(TransactionRecord, key);
                                   

[appengine-java] can we use Spreadsheet api in GAE Java?

2011-06-02 Thread Rambo
Hi friends...!

Am new to Google app engine
Am deploying projects in GAE using Java codes

But i dont know how to use Spreadsheet api in that


Can we use spreadsheet api...?

If so please tell me how...?


Thanks in advance.

-- 
You received this message 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] can we use Spreadsheet api in GAE Java?

2011-06-02 Thread George Simon
Hi Rambo,
   First update appengine-web.xml by adding

system-properties
  property name=com.google.gdata.DisableCookieHandler value=true/
/system-properties

Also refer to the simple steps from Google

http://code.google.com/apis/spreadsheets/data/2.0/developers_guide_java.html


Thanks

George


On Thu, Jun 2, 2011 at 1:56 PM, Rambo ramkumarpec...@gmail.com wrote:

 Hi friends...!

Am new to Google app engine
 Am deploying projects in GAE using Java codes

 But i dont know how to use Spreadsheet api in that


 Can we use spreadsheet api...?

 If so please tell me how...?


 Thanks in advance.

 --
 You received this message 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] the id allocated for a new entity was already in use, please try again.

2011-06-02 Thread Aswath Satrasala
Hello,

I have the following

Class Party {
@Long id;
KeyTenant tenantKey;
String firstname;
}

Party p = new Party();
KeyTenant tenantKey = new KeyTenant(Tenant.class, mmc);
p.setTenantKey(tenantKey);
// create a Party in empty namespace
KeyParty partyKey = ofy.put(p);

Now, I do the following, just for illustration and to clearly understand
with namespaces.
p = ofy.get(partyKey);
tenantKey = p.getTenantKey();
NamespaceManager.set(tenantKey.getName());
ofy.put(p)
// delete the Party in the empty namespace
NamespaceManager.set();
ofy.delete(p);

Actually, I did the above logic in a mapper for few thousand Parties,
transferring the party entities into its own Namespace.

Now, I start creating Parties in the mmc namespace, I frequently get the
following error

*com.google.appengine.api.datastore.DatastoreFailureException: the id
allocated for a new entity was already in use, please try again*

Regards,
-Aswath

-- 
You received this message 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] Map Reduce

2011-06-02 Thread Aswath Satrasala
I tried using the mapper with namespace entities.  The mapper fails to run
and complains

com.google.appengine.tools.mapreduce.MapReduceServlet handleCommand:
Got exception while running command
java.lang.RuntimeException: Got an IOException while trying to make splits

Caused by: java.io.IOException: No entities in the datastore query to split.


Any ways to configure the mapper for working with all namespaces?

-Aswath

On Mon, May 16, 2011 at 10:18 PM, Stephen Johnson onepagewo...@gmail.comwrote:

 I have two questions on the Java version of mapreduce since the docs seem
 pretty sparse.
 1.) Is it possible to use mapreduce over a namespace and if so, how do you
 configure it?
 2.) Is only inputing entity keys and not the entire values supported on the
 Java version and if so, how do I configure that as well?
 Thanks,
 Stephen

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-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] When to use a String as ID? (using Objectify and GWT)

2011-06-02 Thread Drew Spencer
Hi coders,

I have a little quandary here - I'm in the early stages of developing an app 
that in essence, manages the details of companies. The 'main' objects as it 
were, are accounts (ie a client of ours - it's a bit like a CRM system)

I decided to use the company name as the unique ID, but now this is causing 
problems for when I want to change the name of the company (this does happen 
quite a lot).

I have been modifying Chris Ramsdale's Contacts MVP tutorial with some 
success over the last couple of days, but I find that when I try to update a 
contact by changing the company name or phone number, it simply adds in a 
new one and leaves the old one there (because the IDs are different the put 
doesn't overwrite the old one, whereas if they both had the same Long ID 
they could have different details on the name and phoneNumber fields but 
still the same unique identifier (@Id)).

Now I COULD hack it and pass in the old account name, delete that one and 
create a new account, but that seems like it's going to cause all manner of 
problems.

Anyone got any suggestions, or am I answering my own question here? Long IDs 
seem the way to go, but I like the fact that when I use my company name 
string I don't have to perform a put() before I start adding lists of keys 
to it, or is this just a minor thing?

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/-/UVJrWjhNODVqdW9K.
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] Using deferred tasks in Apache Wicket

2011-06-02 Thread Ian Marshall
I have tried using deferred tasks in Apache Wicket.

They do indeed run, but I cannot access the bulk of my data exchange
code since it needs the context of an application and/or a session to
work.

I have reverted to using enqueued tasks to fire up a web page and do
my processing from there. But I was interested in using DeferredTask
since I wanted to:

  ·  bypass the 30-second web page response limit and use the 10-
minute task processing limit instead
  ·  obviate having to code new web pages and just implement the
DeferredTask.run() method.

Has anyone got to use DeferredTask within the context of an
application and session successfully?

-- 
You received this message 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] Problem running the Hello World app

2011-06-02 Thread lionel mommeja
My config: Eclipse Version: 3.6.2 / Windows 7 64 Bits
I carefully followed all the instructions to install the AppEngine eclipse 
plug-in and to execute the sample app. However I am getting the following 
problem.
Any help very much appreciated.
Cheers

Jun 2, 2011 2:03:08 PM java.util.prefs.WindowsPreferences init
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at 
root 0x8002. Windows RegCreateKeyEx(...) returned error code 5.
java.lang.RuntimeException: Unable to create a DevAppServer
at 
com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:90)
at 
com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:38)
at 
com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:154)
at 
com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at 
com.google.appengine.tools.development.DevAppServerMain.init(DevAppServerMain.java:113)
at 
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: 
sun.net.www.protocol.https.Handler.openConnection(java.net.URL)
at 
com.google.appengine.tools.development.StreamHandlerFactory.getDeclaredMethod(StreamHandlerFactory.java:161)
at 
com.google.appengine.tools.development.LocalURLFetchServiceStreamHandler.init(LocalURLFetchServiceStreamHandler.java:52)
at 
com.google.appengine.tools.development.StreamHandlerFactory.init(StreamHandlerFactory.java:106)
at 
com.google.appengine.tools.development.StreamHandlerFactory.install(StreamHandlerFactory.java:65)
at 
com.google.appengine.tools.development.DevAppServerImpl.init(DevAppServerImpl.java:110)
at 
com.google.appengine.tools.development.DevAppServerImpl.init(DevAppServerImpl.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
at 
com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:84)
... 5 more
Caused by: java.lang.NoSuchMethodException: 
sun.net.www.protocol.https.Handler.openConnection(java.net.URL)
at java.lang.Class.throwNoSuchMethodException(Class.java:286)
at java.lang.Class.getDeclaredMethod(Class.java:612)
at 
com.google.appengine.tools.development.StreamHandlerFactory.getDeclaredMethod(StreamHandlerFactory.java:157)
... 15 more
I believe I have carefully followed all the instructions to configure my 
AppEngine plugin in Eclipse 

-- 
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/-/X2p4M0V6MV9MeFlK.
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] When to use a String as ID? (using Objectify and GWT)

2011-06-02 Thread Jeff Schnitzer
This is the classic synthetic key vs natural key debate, and the
general consensus is that synthetic keys are almost always the way to
go.  For exactly the reasons you describe.  Yup, I think you answered
your own question :-)

Jeff

On Thu, Jun 2, 2011 at 4:21 AM, Drew Spencer slugmand...@gmail.com wrote:
 Hi coders,
 I have a little quandary here - I'm in the early stages of developing an app
 that in essence, manages the details of companies. The 'main' objects as it
 were, are accounts (ie a client of ours - it's a bit like a CRM system)
 I decided to use the company name as the unique ID, but now this is causing
 problems for when I want to change the name of the company (this does happen
 quite a lot).
 I have been modifying Chris Ramsdale's Contacts MVP tutorial with some
 success over the last couple of days, but I find that when I try to update a
 contact by changing the company name or phone number, it simply adds in a
 new one and leaves the old one there (because the IDs are different the put
 doesn't overwrite the old one, whereas if they both had the same Long ID
 they could have different details on the name and phoneNumber fields but
 still the same unique identifier (@Id)).
 Now I COULD hack it and pass in the old account name, delete that one and
 create a new account, but that seems like it's going to cause all manner of
 problems.
 Anyone got any suggestions, or am I answering my own question here? Long IDs
 seem the way to go, but I like the fact that when I use my company name
 string I don't have to perform a put() before I start adding lists of keys
 to it, or is this just a minor thing?
 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/-/UVJrWjhNODVqdW9K.
 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: Java Backends not working

2011-06-02 Thread oceandrive
I dont see anything wrong with your xml file. 

I was able to deploy my backends here is my code

?xml version=1.0 encoding=UTF-8? 
backends 
backend name=mybackend 
classB2/class 
instances5/instances 
options 
dynamictrue/dynamic 
publictrue/public 
/options 
/backend 
/backends 


After you upload you backend do you see your backend listed on the bashboard 
?

If you dont then something wrong with your upload. 

-- 
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/-/cEZzR0pnQmVwa0FK.
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] RuntimeException: Couldn't find MR with job ID: ... ??

2011-06-02 Thread Santosh kumar
Hi,

Using mapper i am trying to allocate id's to the entities which are already
in the name space. And i am using appengine-java-sdk-1.5.0.
But when i run the mapper its throwing the exception. And i could not find
what is the reason and also unable to stop the mapper ? what is this
exception ?
Is their any way to debug and find the reason behind this exception ?


   1. W2011-06-02 09:09:40.559

   /admin/mapreduce/mapperCallback
   java.lang.RuntimeException: Couldn't find MR with job ID:
job_1307030934805_0001
at 
com.google.appengine.tools.mapreduce.AppEngineJobContext.getConfigurationFromRequest(AppEngineJobContext.java:157)
at 
com.google.appengine.tools.mapreduce.AppEngineJobContext.init(AppEngineJobContext.java:110)
at 
com.google.appengine.tools.mapreduce.MapReduceServlet.handleMapperWorker(MapReduceServlet.java:576)
at 
com.google.appengine.tools.mapreduce.MapReduceServlet.doPost(MapReduceServlet.java:174)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
at 
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:28)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at 
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
at 
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:260)
at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9669)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:439)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

   2. C2011-06-02 09:09:40.560

   Uncaught exception from servlet
   java.lang.RuntimeException: Couldn't find MR with job ID:
job_1307030934805_0001
at 

[appengine-java] newbie question: redirect users (GWT 2.3.0)

2011-06-02 Thread meiaestro
Hi experts,

I'v build a web application with three entry points so far:

registration
login
start page

As you can imagine I want to (or have to)  be able to dynamically redirect a 
user - depending on his authentication/session validation, etc. -  to the 
correct entry point, regardless which URL he choose. Example: user chooses 
start page.html but is not yet logged in nor does he have a valid session 
id. So I want to redirect him to login.html automatically.

Now the question: what is the best way to redirect a user from one entry 
point to the next? Is it a simple Window.open() or is it a 
GWT.setModuleBaseURL().

Second Question:
Usually the index.html (or htmls/php/etc) is the first page a webserver is 
searching for, so people are used to it. Can I somehow map a virtual 
index.html to my entry point within the app server or should I use a simple 
header redirect? 

Thanks a lot!

-- 
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/-/d3BNUnlOcTlQbzBK.
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] GData in Dev mode error, any hint?

2011-06-02 Thread Jimmy Huang
Hi everyone:
I try to access spreadsheets in my app and get the following error.
The app works fine as I deploy it in GAE but always get errors in dev
mode.
Can anyone helps? I will appreciate a lot.

java.lang.NoClassDefFoundError: com/google/gdata/util/
AuthenticationException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:
428)
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:
339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:
35)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
58)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:
94)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:351)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.ClassNotFoundException:
com.google.gdata.util.AuthenticationException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:
176)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 37 more

-- 
You received this message 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 add task to pushQueue and when task will execute

2011-06-02 Thread ramesh
Hi All,

I am new to Google App Engine. I was trying to add task to queue.

Its adding task to queue but task never gets executed.

To add task to queue, i did following steps.

1) created queue.xml as...

   queue-entries
  queue
namereadwebsitequeue/name
rate20/s/rate
max-concurrent-requests1/max-concurrent-requests
  /queue
/queue-entries

2) created one servlet by extending HTTPServlet. (URL pattern in
web.xml for this servlet is
/testtask)
inside doGet(),i written following code

  Queue q = QueueFactory.getQueue(readwebsitequeue);
  q.add(TaskOptions.Builder.withUrl(/test).param(key, 123));

3) created one more servlet by extending HTTPServlet (URL pattern in
web.xml for this servlet is
/task)


inside doGet(),i written my business logic say some sending
emails.


Now, when i execute my first servlet with url /testtask, it is adding
task to queue . But when task(i.e test) will execute automatically?

I am running it locally. I am able to see tasks in
http://localhost:/_ah/admin/taskqueue


I am unable to understood document provided by google app engine.

Please help me with example.


Thanks
Ramesh














-- 
You received this message 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: Sharing jsession between frontend and backend?

2011-06-02 Thread pdjamez
Not sure if this is the best pattern for using the backend to be
honest. I would suggest that you don't use the backend for end user
web requests. Here are a couple of alternatives:

- Trigger the backend process using a task so it is independent of the
client web request. Indicate to the end user that the report is being
generated. Once the process is complete the backend emails the report
to the user.

- As before, trigger the backend process using a task so it is
independent of the client web request. Forward the user to a page
listing reports generated previously with the current report marked as
pending. This report list is generated from the datastore. Once the
backend process has completed it pushes the report into the blobstore
and marks the report entity in the datastore as having been generated.
Once the client refreshes the list of reports page they will see that
it has been generated and can download it directly from the blobstore
as many times as they like.

regardz,
pdjamez

http://www.pdjamez.com

On May 31, 3:26 pm, oceandrive rams...@gmail.com wrote:
 I am looking for the solution on this. Can someone help..

 On May 30, 10:18 pm, Tom Phillips tphill0...@gmail.com wrote:



  I've got a public backend instance that I'd like to share the user
  session (java sessions are enabled for app) from the frontend with so
  that the user doesn't have to log in separately on the backend. The
  intent is that the backend will handle a few reporting pages that are
  memory intensive on the server, linked to from the frontend.

  I'm using a custom domain like:

  myapp.mydomain.com (frontend)
  mybackend.myapp.mydomain.com (backend)

  I can sign in to each fine separately, but the session and JSESSIONID
  cookie apparently aren't shared out of the box with subdomains. It
  creates a second session and cookie scoped to
  mybackend.myapp.mydomain.com.

  Anyone know how to configure things so the main cookie and session are
  shared with backend subdomains?

-- 
You received this message 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] newbie question: redirect users (GWT 2.3.0)

2011-06-02 Thread A. Stevko
Most every GWT app has only one entry point not counting the static html in
the war file.
The three pages you described are commonly set up as separate panels/views
that are dynamically placed into a main div within single page load.

You may want to read up on using  com.google.gwt.user.client.History for
tools on how to manipulate browser's history stack.
More advanced/complex apps use com.google.gwt.place.shared.Place for mapping
url tokens to presenters  views.

The war/WEB-INF/web.xml file controls the default page being loaded.
You can redirect it to whatever although I usually name my entry point
index.html.
  !-- Default page to serve --
  welcome-file-list
welcome-fileindex.html/welcome-file
  /welcome-file-list


On Thu, Jun 2, 2011 at 10:14 AM, meiaestro jmalbre...@gmx.de wrote:

 Hi experts,

 I'v build a web application with three entry points so far:

 registration
 login
 start page

 As you can imagine I want to (or have to)  be able to dynamically
 redirect a user - depending on his authentication/session validation, etc. -
  to the correct entry point, regardless which URL he choose. Example: user
 chooses start page.html but is not yet logged in nor does he have a valid
 session id. So I want to redirect him to login.html automatically.

 Now the question: what is the best way to redirect a user from one entry
 point to the next? Is it a simple Window.open() or is it a
 GWT.setModuleBaseURL().

 Second Question:
 Usually the index.html (or htmls/php/etc) is the first page a webserver is
 searching for, so people are used to it. Can I somehow map a virtual
 index.html to my entry point within the app server or should I use a simple
 header redirect?

 Thanks a lot!

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




-- 
-- A. Stevko
===
If everything seems under control, you're just not going fast enough. M.
Andretti

-- 
You received this message 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] Can't create application - SMS says account already verified

2011-06-02 Thread Ikai Lan (Google)
Please do a search when you ask a question:

https://groups.google.com/forum/#!searchin/google-appengine/SMS$20account$20already$20verified

https://groups.google.com/forum/#!searchin/google-appengine/SMS$20account$20already$20verified
http://code.google.com/appengine/kb/sms.html

http://code.google.com/appengine/kb/sms.htmlThe link you want is here:

https://appengine.google.com/waitlist/sms_issues

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 Wed, Jun 1, 2011 at 2:24 PM, Joe White white.josep...@gmail.com wrote:

 I'm trying to create an application but it keeps asking me for my cell
 phone for SMS verification. When I enter it, it says that it's already
 been sent too many messages or already verified.
 What gives? How do I fix 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.



-- 
You received this message 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] Can't create application - SMS says account already verified

2011-06-02 Thread Joe White
Ikai,

thanks for your reply. I already did a search and I did not find the answer 
to my problem.
On other posts, one of the developer there told the person that they fixed 
it and to try again.
I have Verizon in the US and I have received numerous SMS messages before, 
even a calendar reminder a few minutes ago.


-- 
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/-/cEJFazI4SmVVTkFK.
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 add task to pushQueue and when task will execute

2011-06-02 Thread Didier Durand
Hi,

Did you specifically read
http://code.google.com/appengine/docs/java/tools/localunittesting.html#Writing_Task_Queue_Tests
for local tests

Via the provided sample, you can access the scheduling params of your
task

regards


didier

On Jun 2, 2:04 pm, ramesh chiluverirame...@gmail.com wrote:
 Hi All,

 I am new to Google App Engine. I was trying to add task to queue.

 Its adding task to queue but task never gets executed.

 To add task to queue, i did following steps.

 1) created queue.xml as...

    queue-entries
   queue
     namereadwebsitequeue/name
     rate20/s/rate
     max-concurrent-requests1/max-concurrent-requests
   /queue
 /queue-entries

 2) created one servlet by extending HTTPServlet. (URL pattern in
 web.xml for this servlet is
     /testtask)
     inside doGet(),i written following code

       Queue q = QueueFactory.getQueue(readwebsitequeue);
       q.add(TaskOptions.Builder.withUrl(/test).param(key, 123));

 3) created one more servlet by extending HTTPServlet (URL pattern in
 web.xml for this servlet is
     /task)

     inside doGet(),i written my business logic say some sending
 emails.

 Now, when i execute my first servlet with url /testtask, it is adding
 task to queue . But when task(i.e test) will execute automatically?

 I am running it locally. I am able to see tasks 
 inhttp://localhost:/_ah/admin/taskqueue

 I am unable to understood document provided by google app engine.

 Please help me with example.

 Thanks
 Ramesh

-- 
You received this message 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: RuntimeException: Couldn't find MR with job ID: ... ??

2011-06-02 Thread Didier Durand
Hi,

Did you check the source code at
http://appengine-mapreduce.googlecode.com/svn/trunk/java/src/com/google/appengine/tools/mapreduce/AppEngineJobContext.java

the comments at the point where exception is thron may help you
understand why you get it

regards

didier

On Jun 2, 7:00 pm, Santosh kumar kopp@gmail.com wrote:
 Hi,

 Using mapper i am trying to allocate id's to the entities which are already
 in the name space. And i am using appengine-java-sdk-1.5.0.
 But when i run the mapper its throwing the exception. And i could not find
 what is the reason and also unable to stop the mapper ? what is this
 exception ?
 Is their any way to debug and find the reason behind this exception ?

    1. W2011-06-02 09:09:40.559

    /admin/mapreduce/mapperCallback
    java.lang.RuntimeException: Couldn't find MR with job ID:
 job_1307030934805_0001
         at 
 com.google.appengine.tools.mapreduce.AppEngineJobContext.getConfigurationFromRequest(AppEngineJobContext.java:157)
         at 
 com.google.appengine.tools.mapreduce.AppEngineJobContext.init(AppEngineJobContext.java:110)
         at 
 com.google.appengine.tools.mapreduce.MapReduceServlet.handleMapperWorker(MapReduceServlet.java:576)
         at 
 com.google.appengine.tools.mapreduce.MapReduceServlet.doPost(MapReduceServlet.java:174)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at 
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
         at 
 com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
         at 
 com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
         at 
 com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:28)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
         at 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
         at 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
         at 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
         at 
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
         at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
         at 
 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
 com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
         at 
 com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:260)
         at 
 com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9669)
         at 
 com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:439)
         at 
 com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
         at 
 com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
         at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
         at 
 com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
         at 
 com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
         at 
 com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
         at 
 

[appengine-java] Re: newbie question: redirect users (GWT 2.3.0)

2011-06-02 Thread Didier Durand
Hi,

the beauty (or the horror...) of Java apps with GWT is that you can
stay alway in the same page: so, you don't need multiple urls with
redirects between them by any mean.

You can just programmatically decide in the java code of your unique
servlet which content you decide to put on the page.

In you case, a simple cascade of java ifs would do it: you decide via
those what you user will do next and then you give the right content
back to gwt call.

Other tricks (redirects, etc.) should be reserved to case where you
client is less powerful than the gwt architecture

regards

didier

On Jun 2, 7:14 pm, meiaestro jmalbre...@gmx.de wrote:
 Hi experts,

 I'v build a web application with three entry points so far:

 registration
 login
 start page

 As you can imagine I want to (or have to)  be able to dynamically redirect a
 user - depending on his authentication/session validation, etc. -  to the
 correct entry point, regardless which URL he choose. Example: user chooses
 start page.html but is not yet logged in nor does he have a valid session
 id. So I want to redirect him to login.html automatically.

 Now the question: what is the best way to redirect a user from one entry
 point to the next? Is it a simple Window.open() or is it a
 GWT.setModuleBaseURL().

 Second Question:
 Usually the index.html (or htmls/php/etc) is the first page a webserver is
 searching for, so people are used to it. Can I somehow map a virtual
 index.html to my entry point within the app server or should I use a simple
 header redirect?

 Thanks a lot!

-- 
You received this message 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] Old bug reappeared? createLoginURL() missing query string

2011-06-02 Thread July

Hi all:
I'm Using GAE 1.5.0 java, reproduct the bug is easy:

protected void doGet( HttpServletRequest req, HttpServletResponse resp ) 
throws ServletException, IOException
{
UserService userService = UserServiceFactory.getUserService();
if( !userService.isUserLoggedIn() )
{

String loginUrl = 
userService.createLoginURL(req.getRequestURI()+?+req.getQueryString())
req.sendRedirect(req);
}
}

so you will found that after user login and redirect back, the query string 
is missing(in fact, only the first query string is remembered):
e.g.
request URL:
http://example.appspot.com/uri?q1=aq2=bq3=c

after user login it redirect to this url:
http://example.appspot.com/uri?q1=a

q2=bq3=c is missing!

i search the forum and found about there are some thread about his, bug the 
bug has been fixed long time ago:

one of them:
https://groups.google.com/forum/?pli=1#!searchin/google-appengine-java/createloginurl$20$20$20query/google-appengine-java/ZF4RjIm9NW4/FsMXEzqZbpUJ

the local devmode is all OK, but after deployed error occurs. and i didn't 
have any filters in my web.xml

Could someone help me with it? thanks a lot.



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