[appengine-java] jdo update is inserting when I don't want it to
I'm new to jdo and GAE so I probably have some simple misunderstanding that someone can quickly solve. I have one servlet A that modifies an entity and another servlet B that deletes the same entity. The problem is that when both are called at the same time, the entity is being recreated after it was deleted. What I mean is: servlet A does delme = pm.getObjectById( Thingy.class, sameKey ); Transaction tx = pm.currentTransaction(); try{ tx.begin(); pm.deletePersistent( delme ); tx.commit(); } finally{ if( tx.isActive() ){ tx.rollback(); } } servlet B does persistme = pm.getObjectById( Thingy.class, sameKey ); persistme.changeSomeValue(); Transaction tx = pm.currentTransaction(); try{ tx.begin(); pm.makePersistent( persistme ); tx.commit(); } finally{ if( tx.isActive() ){ tx.rollback(); } } I would like servlet B to fail if the entity was deleted by Servlet A. Instead, Servlet B just recreates the deleted entity. Anyone know what I need to do here? (the actual code is a little more complex than this eg the entity I am modifying is actually a dependent child in an list of another entity) -- 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] Indexing Problem...Defect
Hi, I got a weird index problem I had a entity claas A like his Class A{ //Few properties SetKey locationIds; Date lastSaveDate; } and i was querying it like this select * from A where locationIds = SomeKey order by lastSaveDate DESC It was working good... then i needed to add extra property adtype, so my class became Class A{ //Few properties SetKey locationIds; Date lastSaveDate; SetLong adType; } and my query is now(using low level datatsore APIs) select * from A where locationIds = SomeKey and adType in Lit of types order by lastSaveDate DESC So to run this query i need to create a new index and i created it I checked in admin panel all indexes were ready to server including new one now i had around 600 records in this table and i create done task to read it and save it again... and i expected that it will re create new indexes Now its not returning all my records..some records are not coming at all... so on pages where i use to get say 15 records now i get like 8-9 records just a subset is coming, and the records which are not coming should come and they full fill query criteria My older version of app is still shwoing those records but new is showing only subset of that data. and there are no errors in error log...its behaving as if these records do not exists. Please help i am not sure what is happening -- 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] Backup restore of my app - Is this really a joke or am I missing something?
J, does the situation change when billing is enabled? -- 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] downloading appengine logs to server that has no development environment
Hi, we'd like to download the appengine logs of our application to a separate machine that doesn't have the application's development environment available. We develop on workstations but the log download and analysis should run on one of our servers, automatically, i.e. there's no source tree (and I'd like to keep it that way). The way I found so far is this: * install appengine sdk on the server * create a directory structure such as app/WEB-INF/ somewhere * place application's web.xml and appengine-web.xml in resulting WEB-INF dir * run appcfg.sh as documented, pointing to above dir Works for me, but took me a while to figure out. What I'd like to know is whether there is either a better way to do this, or what the shortcomings of my approach would be. Thanks! h. -- 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: Backup restore of my app - Is this really a joke or am I missing something?
It isn't free as I have billing enabled and always use up my free allowance each day. Regardless, how exactly is being a beta and free service a valid reason for accepting critical features such as backup/ restore are not available? I'm surprised people haven't moaned about this more regularly which leads me to believe people must have found some kind of solution. Can a Googler please pitch in on this discussion and offer some advice? I need to know what would happen if my data were to become corrupt/lost etc. On Apr 26, 12:18 am, jem...@gmail.com jem...@gmail.com wrote: What do you expect for a beta and free service? - Reply message - From: mscwd01 mscw...@gmail.com Date: Mon, Apr 25, 2011 6:44 pm Subject: [appengine-java] Backup restore of my app - Is this really a joke or am I missing something? To: Google App Engine for Java google-appengine-java@googlegroups.com Hey Okay, I have a simple request - I want to backup all of my apps data on my local machine so that in the event of my data becoming corrupt or lost I can do a restore. So I search backup/restore on gae and only really find the bulk loader as a solution. The trouble is it really isn't a solution, it seems like an inadequate hack. Here is the first thing I read regarding the bulkloader: Note: This document applies to apps that use the master/slave datastore. If your app uses the High Replication datastore, it is possible to copy data from the app, but Google does not currently support this use case. If you attempt to copy from a High Replication datastore, you'll see a high_replication_warning error in the Admin Console, and the downloaded data might not include recently saved entities. I use the HR datastore :( So please tell me I'm missing something and there is a viable method to backup and restore your data. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Backup restore of my app - Is this really a joke or am I missing something?
What exactly are you missing? The fact that the backup may be missing recently committed data? By definition, backups always contain stale data. Omitting not-yet replicated data from a backup is not terrible nor unexpected. Perhaps you would like a 'checkpoint' feature? Suggest it in a ticket... On Tue, Apr 26, 2011 at 12:44 AM, mscwd01 mscw...@gmail.com wrote: Hey Okay, I have a simple request - I want to backup all of my apps data on my local machine so that in the event of my data becoming corrupt or lost I can do a restore. So I search backup/restore on gae and only really find the bulk loader as a solution. The trouble is it really isn't a solution, it seems like an inadequate hack. Here is the first thing I read regarding the bulkloader: Note: This document applies to apps that use the master/slave datastore. If your app uses the High Replication datastore, it is possible to copy data from the app, but Google does not currently support this use case. If you attempt to copy from a High Replication datastore, you'll see a high_replication_warning error in the Admin Console, and the downloaded data might not include recently saved entities. I use the HR datastore :( So please tell me I'm missing something and there is a viable method to backup and restore your data. -- 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] Systematic DeadlineExceededError
Hi, I develop work on an application with Gae / Spring / Jdo. Since a few days, the Spring initialization always fail on a HardDeadlineExceededError. My apps is certainly not the perfect one but it has always could start on app engine servers. To be sure, I tried to deploy an ancient version of sources which I had successfully run on app engine servers and same results. My apps takes approcimatly 5 secs to load the first time in local. I found lots of posts on problems about Spring initialization time but never read about application completly broken because of that... What am I missing ? Is there any issue on Java platform ? Matthieu PS : my apps id is worldofgenesia. -- 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: Backup restore of my app - Is this really a joke or am I missing something?
Well from reading: If your app uses the High Replication datastore, it is possible to copy data from the app, but Google does not currently support this use case I assumed the bulkloader would not be a viable solution to download the entire contents of my apps datastore. Is this the case or does it indeed work fine? Maybe I assumed wrong and it will work well enough, I'll test it when I get home. On Apr 26, 10:20 am, A. Stevko andy.ste...@gmail.com wrote: What exactly are you missing? The fact that the backup may be missing recently committed data? By definition, backups always contain stale data. Omitting not-yet replicated data from a backup is not terrible nor unexpected. Perhaps you would like a 'checkpoint' feature? Suggest it in a ticket... On Tue, Apr 26, 2011 at 12:44 AM, mscwd01 mscw...@gmail.com wrote: Hey Okay, I have a simple request - I want to backup all of my apps data on my local machine so that in the event of my data becoming corrupt or lost I can do a restore. So I search backup/restore on gae and only really find the bulk loader as a solution. The trouble is it really isn't a solution, it seems like an inadequate hack. Here is the first thing I read regarding the bulkloader: Note: This document applies to apps that use the master/slave datastore. If your app uses the High Replication datastore, it is possible to copy data from the app, but Google does not currently support this use case. If you attempt to copy from a High Replication datastore, you'll see a high_replication_warning error in the Admin Console, and the downloaded data might not include recently saved entities. I use the HR datastore :( So please tell me I'm missing something and there is a viable method to backup and restore your data. -- 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] Απ: Google Plugin for Eclipse beta available
-rw-r--r-- 1 gmosx gmosx 127114 2011-04-24 16:21 gdata-client-1.0.jar -rw-r--r-- 1 gmosx gmosx69903 2011-04-24 16:21 gdata-contacts-3.0.jar -rw-r--r-- 1 gmosx gmosx 1448 2011-04-24 16:21 gdata-contacts-meta-3.0.jar -rw-r--r-- 1 gmosx gmosx 548821 2011-04-24 16:21 google-collect-1.0-rc1.jar -rw-r--r-- 1 gmosx gmosx33017 2011-04-24 16:21 jsr305.jar com.google.gdata.client.GoogleService is not included in any of these jars (I would expect to find this class inside the gdata-client-1.0.jar). -g. -- 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: Backup restore of my app - Is this really a joke or am I missing something?
You might be interested in this issue : http://code.google.com/p/googleappengine/issues/detail?id=776 Francois -- 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: Backup restore of my app - Is this really a joke or am I missing something?
Yeah, I'm aware this exists, I'm also aware of the date it was raised: Reported by tran.the...@gmail.com, Oct 8, 2008 It's obvious the GAE team listen to important issues! On Apr 26, 11:38 am, Francois Masurel f.masu...@gmail.com wrote: You might be interested in this issue : http://code.google.com/p/googleappengine/issues/detail?id=776 Francois -- 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 do I run DeferredTasks in a Unit Test
I've also tried the code below, however I get the following error on the line client.sendRequest(request); Perhaps I'm not encoding the task body correctly? com.google.apphosting.utils.servlet.DeferredTaskServlet: Deferred task failed exception: com.google.apphosting.utils.servlet.DeferredTaskServlet$DeferredTaskException: java.io.StreamCorruptedException: invalid stream header: EFBFBDEF String queueName = QueueFactory.getDefaultQueue().getQueueName(); ServletRunner sr = new ServletRunner(); sr.registerServlet( /_ah/queue/__deferred__, com.google.apphosting.utils.servlet.DeferredTaskServlet.class.getCanonicalName()); LocalTaskQueue localTaskQueue = LocalTaskQueueTestConfig.getLocalTaskQueue(); ServletUnitClient client = sr.newClient(); while (!getQueue().getTaskInfo().isEmpty()) { TaskStateInfo taskInfo = getQueue().getTaskInfo().iterator().next(); String queuedTask = taskInfo.getBody(); String taskName = taskInfo.getTaskName(); WebRequest request = new PostMethodWebRequest(http:/_ah/queue/__deferred__, new ByteArrayInputStream(queuedTask.getBytes()), application/x-binary-app-engine-java-runnable-task); request.setHeaderField(X-AppEngine-QueueName, queueName); try { client.sendRequest(request); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } // localTaskQueue.runTask(queueName, taskName); localTaskQueue.deleteTask(queueName, taskName); } localTaskQueue.flushQueue(queueName); -- 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: Systematic DeadlineExceededError
Could you post your trace from the log? Is the problem intermittent? How much memory is your app running? Do you have other errors in the trace? Does it init fine on your dev? Brandon http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Flash/ajax file upload to blobstore?
Yes. I've done it with a java app. You'll have to setup a servlet to get a blob url, and then post to it. http://code.google.com/p/gwt-examples/source/browse/trunk/#trunk%2FGAE_FileUpload%2Fsrc%2Fcom%2Fgonevertical%2Fupload - my java app source http://code.google.com/p/gwt-examples/wiki/DemoGAEMultiFileBlobUpload - some of my blob notes Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Resize image to exact size using ImagesService
I agree, the image service is thin. I've been asking for more features too. http://code.google.com/p/googleappengine/issues/detail?id=2990 Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: How to add parameters to HTTP Post
Are you looking to write the parameters as application/x-form- urlencoded into the POST body or simply add them as parameters in the url? For the case where you want to write to the post body I have had success with something like the following: //create the url encoded post body as a string // deviceToken=760ff5e341de1ca9209bcfbd320625b047b44f5b394c191899dd5885a1f65bf2notificationText=What %3FbadgeNumber=4sound=defaultpayload=5+and+7 String postBody = deviceToken=760ff5e341de1ca9209bcfbd320625b047b44f5b394c191899dd5885a1f65bf2notificationText=What %3FbadgeNumber=4sound=defaultpayload=5+and+7 URL url = new URL(http://www.example.com/comment;); HttpURLConnection connection = (HttpURLConnection)url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod(POST); connection.getOutputStream().write( postBody.getBytes() ); On Apr 25, 1:58 pm, Icarus pr.a...@gmail.com wrote: Hi, I am trying the Google App Engine for Java link for making a HTTP Post request from my Web App. I am using the following code from the example :http://code.google.com/appengine/docs/java/urlfetch/usingjavanet.html URL url = new URL(http://www.example.com/comment;); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod(POST); OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); writer.write(message= + message); writer.close(); How do I actually set the parameters for a POST call ? I tried the low level API but it requires a byte[]. How do we initialize that ? Thanks, Ic -- 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] Always On and warm up requests
I'm trying to figure out how to configure our GWT app to avoid latency. At the moment, it isn't used much so the app loads new instances regularly. We've got warmup requests enabled and have turned Always On on for all three instances. At the moment, we don't have any servlets specified as load-on-startup because it's a GWT app so we don't really need any specifically loaded at start-up. With this setup, we still see the following log message several times a day: 1. 1. This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application. Furthermore, on one particular page, we make two RPC requests to the server in succession. This log message often appears for both calls which suggests to me that they are each going to different instances and each one is launching a new process for the app. Is there something else we need to do to ensure the app remains loaded? We see some serious latency (up to 8 seconds) when these log messages appear. I was thinking we could have a dummy servlet that simply retrieves something from the datastore to ensure the application code is loaded but that seems like it shouldn't be necessary. -- 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] ERROR: Unable to update: java.net.UnknownHostException: appengine.google.com at java.net.PlainSocketImpl.connect
I tried to deploy a simple web application.. followed the tutorial given on google app engine website for java.. i was trying to deploy guestbook application which is given in demos folder of App Engine Java SDK. while i tried to deploy it i got unable to update error.. i googled this problem bt got nthing significant..evry1 worte its may be a proxy error.. i believe its nt a proxy problem as i am able to open http://appengine.google.com in my browser without any problem... i m nt using Eclipse.. trying to deploy it by using cmd on windows.. please suggest me some solution.. here is the error log file: Unable to update: java.net.UnknownHostException: appengine.google.com at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550) at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.protocol.https.HttpsClient.init(HttpsClient.java:272) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:793) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:896) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230) at com.google.appengine.tools.admin.AbstractServerConnection.connect(AbstractServerConnection.java:120) at com.google.appengine.tools.admin.AbstractServerConnection.send(AbstractServerConnection.java:229) at com.google.appengine.tools.admin.AbstractServerConnection.post(AbstractServerConnection.java:207) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:638) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:446) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:137) at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:259) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:47) at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:572) at com.google.appengine.tools.admin.AppCfg.init(AppCfg.java:144) at com.google.appengine.tools.admin.AppCfg.init(AppCfg.java:65) at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:61) com.google.appengine.tools.admin.AdminException: Unable to update app: appengine.google.com at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:264) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:47) at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:572) at com.google.appengine.tools.admin.AppCfg.init(AppCfg.java:144) at com.google.appengine.tools.admin.AppCfg.init(AppCfg.java:65) at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:61) Caused by: java.net.UnknownHostException: appengine.google.com at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550) at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.protocol.https.HttpsClient.init(HttpsClient.java:272) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:793) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:896) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230) at com.google.appengine.tools.admin.AbstractServerConnection.connect(AbstractServerConnection.java:120) at
[appengine-java] FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
BlobKey blobKey = FileServiceFactory.getFileService().getBlobKey(file); - this is returning null even though the file object is legit. I've found that the blobkey exists in the file object. here are the file object parts trace -: fileSystem: BLOBSTORE path=/blobstore/writable:AD8BvulcvaJwfaNXq9Xpg_X6ZqHZNnFpO5x0KBehyFY-gN59EB9j9MBQUBD3TcxfldC2uoU0y0LPrmJjzHjVYfKJS0Il5k9ZlI41Hu_DVsOHCxWQdeCkZiQ-VrnQMrsmLs4q25EPXGGmNx2YPsmYGx-JAz1TDCEavxBT3phRz9sBh7n1Kbd8jFW75dggcbpwjc-b6LRPfTo_bVwkn193weQ6I2uKtEavH0lWLn31PYFCgna82RsUfSr9yP4IbPebsnAUwFpctK6C namePart=writable:AD8BvulcvaJwfaNXq9Xpg_X6ZqHZNnFpO5x0KBehyFY-gN59EB9j9MBQUBD3TcxfldC2uoU0y0LPrmJjzHjVYfKJS0Il5k9ZlI41Hu_DVsOHCxWQdeCkZiQ-VrnQMrsmLs4q25EPXGGmNx2YPsmYGx-JAz1TDCEavxBT3phRz9sBh7n1Kbd8jFW75dggcbpwjc-b6LRPfTo_bVwkn193weQ6I2uKtEavH0lWLn31PYFCgna82RsUfSr9yP4IbPebsnAUwFpctK6C file.toString()=/blobstore/writable:AD8BvulcvaJwfaNXq9Xpg_X6ZqHZNnFpO5x0KBehyFY-gN59EB9j9MBQUBD3TcxfldC2uoU0y0LPrmJjzHjVYfKJS0Il5k9ZlI41Hu_DVsOHCxWQdeCkZiQ-VrnQMrsmLs4q25EPXGGmNx2YPsmYGx-JAz1TDCEavxBT3phRz9sBh7n1Kbd8jFW75dggcbpwjc-b6LRPfTo_bVwkn193weQ6I2uKtEavH0lWLn31PYFCgna82RsUfSr9yP4IbPebsnAUwFpctK6C I believe the blobkey parser is not working correctly. Brandon Donnelson http://gwt-examples.googlecode.com http://code.google.com/p/googleappengine/issues/detail?id=4872 -- 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: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
It doesn't look like this happens every time, but something is not parsing correctly when trying to read the blobkey out of the file object. -- 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: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
My code snippet that procured the above trace: public long uploadBlob_ByFile(long fileThingId, String fileName, String contentType, byte[] filebytes) { if (filebytes == null || filebytes.length == 0) { log.warning(uploadBlob_ByFile(): Warn: filebytes is null or length=0); return -1; } log.info(uploadBlob_ByFile(): filebytes.length= + filebytes.length); // Get a file service FileService fileService = FileServiceFactory.getFileService(); // Create a new Blob file with mime-type AppEngineFile file = null; try { file = fileService.createNewBlobFile(contentType, fileName); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 1: could not fileService.createNewBlobFile: + e.toString()); e.printStackTrace(); return 0; } if (file == null) { log.severe(uploadBlob_ByFile(): Error: file is null. exiting file upload.); return 0; } // Open a channel to write to it boolean lock = true; FileWriteChannel writeChannel = null; try { writeChannel = fileService.openWriteChannel(file, lock); } catch (FileNotFoundException e) { e.printStackTrace(); log.severe(uploadBlob_ByFile(): Error 2: + e.toString()); return 0; } catch (FinalizationException e) { e.printStackTrace(); } catch (LockException e) { log.severe(uploadBlob_ByFile(): Error 3: + e.toString()); e.printStackTrace(); return 0; } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 4: + e.toString()); e.printStackTrace(); return 0; } ByteBuffer bb = ByteBuffer.wrap(filebytes); // This time we write to the channel using standard Java try { writeChannel.write(bb); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 5: + e.toString()); e.printStackTrace(); return 0; } BlobKey blobKey = FileServiceFactory.getFileService().getBlobKey(file); if (blobKey == null) { log.severe(uploadBlob_ByFile(): Error 5.1, Testing if blobKey is null before closing channel: ); } else { log.info(uploadBlob_ByFile(): INFO 5.1, blobkey WORKED ! ); } try { writeChannel.close(); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 5.5: + e.toString()); e.printStackTrace(); } // Now finalize try { writeChannel.closeFinally(); } catch (IllegalStateException e) { log.severe(uploadBlob_ByFile(): Error 6: + e.toString()); e.printStackTrace(); return 0; } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 7: + e.toString()); e.printStackTrace(); return 0; } blobKey = FileServiceFactory.getFileService().getBlobKey(file); FileSystem fileSytem = file.getFileSystem(); String path = file.getFullPath(); String namePart = file.getNamePart(); String fs = null; if (fileSytem != null) { fs = fileSytem.toString(); } log.info(uploadBlob_ByFile(): Info: fileSystem: + fs + path= + path + namePart= + namePart + file.toString()= + file.toString()); if (blobKey == null) { log.severe(uploadBlob_ByFile(): Error 8: blobkey is null); return 0; } //... } Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
I'd like to note related bugs on GAE side not dev side: - FileReadChannel won't read all the bytes of a blob. - BlobInfo records the wrong byte size for base64 upload -- 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] low level datastore and numbers
It seems all numbers stored as long? If I store int number and want to get int back i get class cast exception, because it's stored as long Is there a way to store an int? 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: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
Trying work around: private BlobKey getBlobKey(AppEngineFile file) { BlobKey key = FileServiceFactory.getFileService().getBlobKey(file); if (key == null file.getNamePart().contains(:) == true) { String[] s = file.getNamePart().split(:); if (s != null s.length == 2) { key = new BlobKey(s[1]); } } return key; } Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Deferred Task with non default queue
The preconfigured URL mapping for the DeferredTaskServlet may be used for any queue. There is no need to specify your own URL mapping that I can see. On Apr 22, 8:05 pm, Marcel Overdijk marceloverd...@gmail.com wrote: I did some quick testing and I found out: QueueFactory.getQueue(email- queue).add(TaskOptions.Builder.withPayload(new EmailTask(email)).url(/email-queue)); that with above I can enqueue adeferredtaskin the another queue (not default). I had to to use the url(/email-queue) setting otherwise it was pushed to the default __deferred__ handler. I just configured the com.google.apphosting.utils.servlet.DeferredTaskServlet and mapped it to /email-queue When I try System.out.println(queue name: + DeferredTaskContext.getCurrentRequest().getHeader(X-AppEngine- QueueName)); I see the correct e-mail-queue being printed thus so far everything seems to work. I also configured task-retry-limit5/task-retry-limit for this queue but this does not seem to work. So the setup is working but the DeferredTask / DeferredTaskServlet do not seem to look into the settings configured in queue.xml Can somebody confirm this? Do you have more information on how you determined that this is not working? On Apr 22, 11:13 am, Marcel Overdijk marceloverd...@gmail.com wrote: Maybe use additional mappings to com.google.apphosting.utils.servlet.DeferredTaskServlet The documentation onDeferredTasks is a little bit sparse... Any pointers appreciated. Basically what I would like to do is have multiple queue defined with different throttling settings. And use DeferredTask to send them to one of the queues depending on the my needs. I would have no problem with configuring additional servlet mappings using com.google.apphosting.utils.servlet.DeferredTaskServlet On Apr 22, 8:58 am, Marcel Overdijk marceloverd...@gmail.com wrote: Is it possible to useDeferredTasks outside the default queue? I would like to setup multiple queues with different config settings. For theDeferredTasks a specific handler is setup at /_ah/queue/ __deferred__ so I wonder how that would work with multiple queues -- 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] Eclipse: Validation exclusions don't work?
This has been asked elsewhere, but not here; see: http://stackoverflow.com/questions/3324848/scala-on-google-app-engine-with-eclipse A Scala-based GAE project causes the Eclipse plugin to freak out on Scala sources, obviously because they're not Java sources. The exception backtrace begins: java.lang.NullPointerException at com.google.appengine.eclipse.core.validators.java.JavaCompilationParticipant.validateCompilationUnit(JavaCompilationParticipant.java: 74) at com.google.appengine.eclipse.core.validators.java.JavaCompilationParticipant.reconcile(JavaCompilationParticipant.java: 180) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation $1.run(ReconcileWorkingCopyOperation.java:257) ... In project Properties - Google - App Engine - Validation, I've tried adding all sorts of patterns to exclude these source files, including **.scala, **/*.scala, and even simply **/* and **. Nothing seems to prevent this exception, and it's quite annoying, as it causes the Eclipse Error Log view to keep popping up. Is there a known issue here with a possibly known fix? Environment of the above: Eclipse Helios SR2 (3.6.2), Google Plugin for Eclipse 2.2.1, GAE/J 1.4.3. -- 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: Deferred Task with non default queue
But is it possible to change queue settings for Deferred task? Like a deferred Email task I would like to throttle differently then anotther queue (using Deferred Task( So baically the questions are: - With Deferred task, can you have multiple queues? - Is it possible to change throttling configuration per Deferred task queue? On Apr 26, 4:59 pm, Gianni Mariani gmari...@google.com wrote: The preconfigured URL mapping for the DeferredTaskServlet may be used for any queue. There is no need to specify your own URL mapping that I can see. On Apr 22, 8:05 pm, Marcel Overdijk marceloverd...@gmail.com wrote: I did some quick testing and I found out: QueueFactory.getQueue(email- queue).add(TaskOptions.Builder.withPayload(new EmailTask(email)).url(/email-queue)); that with above I can enqueue adeferredtaskin the another queue (not default). I had to to use the url(/email-queue) setting otherwise it was pushed to the default __deferred__ handler. I just configured the com.google.apphosting.utils.servlet.DeferredTaskServlet and mapped it to /email-queue When I try System.out.println(queue name: + DeferredTaskContext.getCurrentRequest().getHeader(X-AppEngine- QueueName)); I see the correct e-mail-queue being printed thus so far everything seems to work. I also configured task-retry-limit5/task-retry-limit for this queue but this does not seem to work. So the setup is working but the DeferredTask / DeferredTaskServlet do not seem to look into the settings configured in queue.xml Can somebody confirm this? Do you have more information on how you determined that this is not working? On Apr 22, 11:13 am, Marcel Overdijk marceloverd...@gmail.com wrote: Maybe use additional mappings to com.google.apphosting.utils.servlet.DeferredTaskServlet The documentation onDeferredTasks is a little bit sparse... Any pointers appreciated. Basically what I would like to do is have multiple queue defined with different throttling settings. And use DeferredTask to send them to one of the queues depending on the my needs. I would have no problem with configuring additional servlet mappings using com.google.apphosting.utils.servlet.DeferredTaskServlet On Apr 22, 8:58 am, Marcel Overdijk marceloverd...@gmail.com wrote: Is it possible to useDeferredTasks outside the default queue? I would like to setup multiple queues with different config settings. For theDeferredTasks a specific handler is setup at /_ah/queue/ __deferred__ so I wonder how that would work with multiple queues -- 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: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
On Apr 26, 7:42 am, branflake2267 branflake2...@gmail.com wrote: My code snippet that procured the above trace: public long uploadBlob_ByFile(long fileThingId, String fileName, String contentType, byte[] filebytes) { if (filebytes == null || filebytes.length == 0) { log.warning(uploadBlob_ByFile(): Warn: filebytes is null or length=0); return -1; } log.info(uploadBlob_ByFile(): filebytes.length= + filebytes.length); // Get a file service FileService fileService = FileServiceFactory.getFileService(); // Create a new Blob file with mime-type AppEngineFile file = null; try { file = fileService.createNewBlobFile(contentType, fileName); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 1: could not fileService.createNewBlobFile: + e.toString()); e.printStackTrace(); return 0; } if (file == null) { log.severe(uploadBlob_ByFile(): Error: file is null. exiting file upload.); return 0; } // Open a channel to write to it boolean lock = true; FileWriteChannel writeChannel = null; try { writeChannel = fileService.openWriteChannel(file, lock); } catch (FileNotFoundException e) { e.printStackTrace(); log.severe(uploadBlob_ByFile(): Error 2: + e.toString()); return 0; } catch (FinalizationException e) { e.printStackTrace(); } catch (LockException e) { log.severe(uploadBlob_ByFile(): Error 3: + e.toString()); e.printStackTrace(); return 0; } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 4: + e.toString()); e.printStackTrace(); return 0; } ByteBuffer bb = ByteBuffer.wrap(filebytes); // This time we write to the channel using standard Java try { writeChannel.write(bb); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 5: + e.toString()); e.printStackTrace(); return 0; } BlobKey blobKey = FileServiceFactory.getFileService().getBlobKey(file); At this point the file has not been finalized so null will be returned. See http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/files/FileService.html#getBlobKey(com.google.appengine.api.files.AppEngineFile) if (blobKey == null) { log.severe(uploadBlob_ByFile(): Error 5.1, Testing if blobKey is null before closing channel: ); } else { log.info(uploadBlob_ByFile(): INFO 5.1, blobkey WORKED ! ); } try { writeChannel.close(); } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 5.5: + e.toString()); e.printStackTrace(); } // Now finalize try { writeChannel.closeFinally(); } catch (IllegalStateException e) { log.severe(uploadBlob_ByFile(): Error 6: + e.toString()); e.printStackTrace(); return 0; } catch (IOException e) { log.severe(uploadBlob_ByFile(): Error 7: + e.toString()); e.printStackTrace(); return 0; } blobKey = FileServiceFactory.getFileService().getBlobKey(file); FileSystem fileSytem = file.getFileSystem(); String path = file.getFullPath(); String namePart = file.getNamePart(); String fs = null; if (fileSytem != null) { fs = fileSytem.toString(); } log.info(uploadBlob_ByFile(): Info: fileSystem: + fs + path= + path + namePart= + namePart + file.toString()= + file.toString()); if (blobKey == null) { log.severe(uploadBlob_ByFile(): Error 8: blobkey is null); return 0; } //... } Brandon Donnelsonhttp://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] makePersistent silently failing after MetaDataValidator$DatastoreMetaDataException in development
I have a first entity MediaAlbum with a @Transient field that holds a List of another entity Media. After querying for a list of MediaAlbum I get an exception: Error in meta-data for com.yumyumlabs.foundation.appengine.media.model.Media.id: Cannot have a java.lang.Long primary key and be a child object (owning field is com.yumyumlabs.foundation.appengine.media.model.MediaAlbum.media). org.datanucleus.store.appengine.MetaDataValidator$DatastoreMetaDataException: Error in meta-data for com.yumyumlabs.foundation.appengine.media.model.Media.id: Cannot have a java.lang.Long primary key and be a child object (owning field is com.yumyumlabs.foundation.appengine.media.model.MediaAlbum.media). at org.datanucleus.store.appengine.MetaDataValidator.checkForIllegalChildField(MetaDataValidator.java:376) Once this exception has been raised I can no longer persist Media objects, as calling persistence manager makePersistent silently fails and the Media object I was trying to save does not have an id assigned and does not appear to be in the datastore. If I kill the server and restart, I can continue creating Media objects until I again try to list them and get the above exception, and then Media cannot be persisted again. I'm running app engine 1.4.3. Any ideas? -- 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] makePersistent silently failing after MetaDataValidator$DatastoreMetaDataException in development
I supposed you used Long as the primary key in the owned/child entity? If true, that is not allowed and it has to be Key not Long. Hth On Apr 26, 2011 5:49 PM, Mike Prince m...@mikeprince.com wrote: I have a first entity MediaAlbum with a @Transient field that holds a List of another entity Media. After querying for a list of MediaAlbum I get an exception: Error in meta-data for com.yumyumlabs.foundation.appengine.media.model.Media.id: Cannot have a java.lang.Long primary key and be a child object (owning field is com.yumyumlabs.foundation.appengine.media.model.MediaAlbum.media). org.datanucleus.store.appengine.MetaDataValidator$DatastoreMetaDataException: Error in meta-data for com.yumyumlabs.foundation.appengine.media.model.Media.id: Cannot have a java.lang.Long primary key and be a child object (owning field is com.yumyumlabs.foundation.appengine.media.model.MediaAlbum.media). at org.datanucleus.store.appengine.MetaDataValidator.checkForIllegalChildField(MetaDataValidator.java:376) Once this exception has been raised I can no longer persist Media objects, as calling persistence manager makePersistent silently fails and the Media object I was trying to save does not have an id assigned and does not appear to be in the datastore. If I kill the server and restart, I can continue creating Media objects until I again try to list them and get the above exception, and then Media cannot be persisted again. I'm running app engine 1.4.3. Any ideas? -- 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: How to add parameters to HTTP Post
something like this... import com.google.appengine.api.urlfetch.*; import static com.google.appengine.api.urlfetch.HTTPMethod.POST; import static com.google.appengine.api.urlfetch.FetchOptions.Builder.withDeadline; import static com.google.appengine.api.urlfetch.URLFetchServiceFactory.getURLFetchService; public class PostClass { public void postMethod() throws Exception { HTTPRequest req = new HTTPRequest(http://www.example.com/comment;, POST, withDeadline(10.0)); req.setHeader(new HTTPHeader(x-header-one, some header)); String params = x=yy=zz=abc; req.setPayload(params.getBytes()); HTTPResponse resp = getURLFetchService().fetch(proxyRequest); if (resp != null) { int responseCode = resp.getResponseCode(); ListHTTPHeader headers = resp.getHeaders(); byte[] content = resp.getContent(); } } } -- 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 add parameters to HTTP Post
import com.google.appengine.api.urlfetch.*; import static com.google.appengine.api.urlfetch.HTTPMethod.POST; import static com.google.appengine.api.urlfetch.FetchOptions.Builder.withDeadline; import static com.google.appengine.api.urlfetch.URLFetchServiceFactory.getURLFetchService; public class PostClass { public void postMethod() throws Exception { HTTPRequest req = new HTTPRequest(http://www.example.com/comment;, POST, withDeadline(10.0)); req.setHeader(new HTTPHeader(x-header-one, some header)); String params = x=yy=zz=abc; req.setPayload(params.getBytes()); HTTPResponse resp = getURLFetchService().fetch(req); if (resp != null) { int responseCode = resp.getResponseCode(); ListHTTPHeader headers = resp.getHeaders(); byte[] content = resp.getContent(); } } } -- 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] [appengine-java] Re: Deferred Task with non default queue
On Wed, Apr 27, 2011 at 4:19 AM, Marcel Overdijk marceloverd...@gmail.comwrote: But is it possible to change queue settings for Deferred task? A DeferredTask is just like any other task. There is no restriction on DeferredTasks with respect to queue settings or which queues you put them in. The fact that a special handler exists for deferred task is inconsequential. It's just a simplification, in that you don't need to do that for yourself. i.e. if you do not specify a URL, it will work out of the box. The task is automatically set to the correct handler when you set the DeferredTask payload. Like a deferred Email task I would like to throttle differently then anotther queue (using Deferred Task( So baically the questions are: - With Deferred task, can you have multiple queues? Like any task. You can add a deferred task to any queue. - Is it possible to change throttling configuration per Deferred task queue? DeferredTasks may be placed in any queue. Just a note. You seem to be conflating handlers/servlet mappings with queues. There is nothing stopping you from having a single handler accept requests from any queue. In the case of the TaskOptions.payload(DeferredTask) method, it will automatically set the handler url for you if it is not otherwise specified. URL is somewhat irrelevant for deferred task since the run() method you define is essentially the entry point for the task. On Apr 26, 4:59 pm, Gianni Mariani gmari...@google.com wrote: The preconfigured URL mapping for the DeferredTaskServlet may be used for any queue. There is no need to specify your own URL mapping that I can see. On Apr 22, 8:05 pm, Marcel Overdijk marceloverd...@gmail.com wrote: I did some quick testing and I found out: QueueFactory.getQueue(email- queue).add(TaskOptions.Builder.withPayload(new EmailTask(email)).url(/email-queue)); that with above I can enqueue adeferredtaskin the another queue (not default). I had to to use the url(/email-queue) setting otherwise it was pushed to the default __deferred__ handler. I just configured the com.google.apphosting.utils.servlet.DeferredTaskServlet and mapped it to /email-queue When I try System.out.println(queue name: + DeferredTaskContext.getCurrentRequest().getHeader(X-AppEngine- QueueName)); I see the correct e-mail-queue being printed thus so far everything seems to work. I also configured task-retry-limit5/task-retry-limit for this queue but this does not seem to work. So the setup is working but the DeferredTask / DeferredTaskServlet do not seem to look into the settings configured in queue.xml Can somebody confirm this? Do you have more information on how you determined that this is not working? On Apr 22, 11:13 am, Marcel Overdijk marceloverd...@gmail.com wrote: Maybe use additional mappings to com.google.apphosting.utils.servlet.DeferredTaskServlet The documentation onDeferredTasks is a little bit sparse... Any pointers appreciated. Basically what I would like to do is have multiple queue defined with different throttling settings. And use DeferredTask to send them to one of the queues depending on the my needs. I would have no problem with configuring additional servlet mappings using com.google.apphosting.utils.servlet.DeferredTaskServlet On Apr 22, 8:58 am, Marcel Overdijk marceloverd...@gmail.com wrote: Is it possible to useDeferredTasks outside the default queue? I would like to setup multiple queues with different config settings. For theDeferredTasks a specific handler is setup at /_ah/queue/ __deferred__ so I wonder how that would work with multiple queues -- 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.
[appengine-java] Re: pdfJet issue
I use iTextPDF for creating pdf inside appengine with no problem. http://www.itextpdf.com/ -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: How do I run DeferredTasks in a Unit Test
I'm not sure what this is not working (given that it worked previously). I'll take a look. The task is binary data. My first guess is this:- String queuedTask = taskInfo.getBody(); String is UTF-16 encoded while the body is a bunch of bytes. The process of decoding and re-encoding has a potential of corrupting the data. I suggest using *getBodyAsByteshttp://code.google.com/appengine/docs/java/tools/localunittesting/javadoc/com/google/appengine/api/taskqueue/dev/QueueStateInfo.TaskStateInfo.html#getBodyAsBytes() instead.* On Tue, Apr 26, 2011 at 11:00 PM, Brendan Doherty bren...@propertysimplified.com wrote: I've also tried the code below, however I get the following error on the line client.sendRequest(request); Perhaps I'm not encoding the task body correctly? com.google.apphosting.utils.servlet.DeferredTaskServlet: Deferred task failed exception: com.google.apphosting.utils.servlet.DeferredTaskServlet$DeferredTaskException: java.io.StreamCorruptedException: invalid stream header: EFBFBDEF String queueName = QueueFactory.getDefaultQueue().getQueueName(); ServletRunner sr = new ServletRunner(); sr.registerServlet( /_ah/queue/__deferred__, com.google.apphosting.utils.servlet.DeferredTaskServlet.class.getCanonicalName()); LocalTaskQueue localTaskQueue = LocalTaskQueueTestConfig.getLocalTaskQueue(); ServletUnitClient client = sr.newClient(); while (!getQueue().getTaskInfo().isEmpty()) { TaskStateInfo taskInfo = getQueue().getTaskInfo().iterator().next(); String queuedTask = taskInfo.getBody(); String taskName = taskInfo.getTaskName(); WebRequest request = new PostMethodWebRequest(http:/_ah/queue/__deferred__, new ByteArrayInputStream(queuedTask.getBytes()), application/x-binary-app-engine-java-runnable-task); request.setHeaderField(X-AppEngine-QueueName, queueName); try { client.sendRequest(request); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } // localTaskQueue.runTask(queueName, taskName); localTaskQueue.deleteTask(queueName, taskName); } localTaskQueue.flushQueue(queueName); -- 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. -- 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: How do I run DeferredTasks in a Unit Test
Thanks. I'll give that a try and report back. Do you know if the first approach I tried with LocalTaskQueueTestConfig.getLocalTaskQueue().runTask(queueName, taskName) should ever work from a JUnit test case, or will ServletUnit always be the way to go? It seems like something didn't work properly when it reported Local task queue initialized with base url http://localhost:8080;, as later on couldn't connect with Connection to http://localhost:8080 refused. Brendan New Zealand -- 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: FileServiceFactory.getFileService().getBlobKey(file) is Broken, blobkey parser returns null
I kinda figured, since it shows experimental. I've got a work around, for sucking out of the object. I like using it, very nice work so far! Thanks for looking. Brandon -- 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 do I run DeferredTasks in a Unit Test
getBodyAsBytes() solves the problem. The following code will run each of the queued DeferredTasks from within a JUnit test. String queueName = QueueFactory.getDefaultQueue().getQueueName(); ServletRunner sr = new ServletRunner(); sr.registerServlet( /_ah/queue/__deferred__, com.google.apphosting.utils.servlet.DeferredTaskServlet.class.getCanonicalName()); LocalTaskQueue localTaskQueue = LocalTaskQueueTestConfig.getLocalTaskQueue(); ServletUnitClient client = sr.newClient(); while (!getQueue().getTaskInfo().isEmpty()) { TaskStateInfo taskInfo = getQueue().getTaskInfo().iterator().next(); byte[] taskBody = taskInfo.getBodyAsBytes(); String taskName = taskInfo.getTaskName(); WebRequest request = new PostMethodWebRequest(http:/_ah/queue/__deferred__, new ByteArrayInputStream(taskBody), application/x-binary-app-engine-java-runnable-task); request.setHeaderField(X-AppEngine-QueueName, queueName); try { client.sendRequest(request); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { localTaskQueue.deleteTask(queueName, taskName); } } localTaskQueue.flushQueue(queueName); -- 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: low level datastore and numbers
Yes. Stick the int var in your class with @Persistent. @Persistent private int myInt; http://code.google.com/appengine/docs/java/datastore/entities.html#Properties_and_Value_Types Casting from long to int should not throw anything I'm aware of. It might truncate a number into int. long test = 1234; int myInt; myInt = (int) test; should not throw. Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: jdo update is inserting when I don't want it to
pm.makePersistent( persistme ); is called after the deletion it will recreate it. You'll have to query it by objectid first and see if it exists. If it exists you could update. SQL would need an ID to update, but in JDO, it will make a new ID on insert and update depending on existence. like so: MyClassJdo exists = pm.getObjectById(MyClassJdo.class, keyId); Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Timeout when trying to upload to Blobstore (files 5k)
Hmmm, I can't see anything obvious. I know this can be be a bear b/c I've done it too. 10 seconds is all you got, unless you move to a task. Although, it will allow you to load any size file to the store, but after its loaded you got 10 seconds to do processing. It shouldn't hang. Can you find the file in the blobstore after running above and before you think it hangs? It should be before you hit the upload servlet? http://code.google.com/p/gwt-examples/wiki/DemoGAEMultiFileBlobUpload - here are some more notes I put together on blob stuff http://code.google.com/p/gwt-examples/wiki/gwt_hmtl5#Upload_Canvas_Image - another thing I do to upload Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Help Me...!
Are you wanting to use oAuth? If not, the api is really easy. Otherwise you have a few steps to do to get oauth to work. http://code.google.com/p/gwt-examples/wiki/DemoGwtGData - I have oauth notes here Brandon Donnelson http://gwt-examples.googlecode.eom -- 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: Performance of blobstore upload API vs the new files api
I've done them all and don't see any difference in the apis. The File api has a few bugs and is experimental, at least I think thats the one your talking about. I prefer the HTML post method b/c its well defined, and there are libs available to put together a post. Its a multistep process, one to get the blob url, which is very fast and then post and wait for upload. I figure either road you take same steps different way. Some more notes with demos. I made an java app with source there to that uploads from desktop. - http://code.google.com/p/gwt-examples/wiki/DemoGAEMultiFileBlobUpload Good luck in your adventure, Brandon Donnelson http://gwt-examples.googlecode.com -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: pdfJet issue
How? with the patch? because when i tried to use it, app engine throws a no definition class exception - and all forums that i'v been to mentioned that itext can not works with app engine. On Apr 26, 6:15 pm, nacho vela.igna...@gmail.com wrote: I use iTextPDF for creating pdf inside appengine with no problem. http://www.itextpdf.com/ -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.