[appengine-java] Re: Local development server classpath - com.google.appengine.tools.KickStart
Hi, You will be ok if you add not only 1 single gae jar (appengine-tools- api.jar) but all those (about 2) appearing in the GAE sdk library on Eclipse when you create a new project + those needed to run locally. The simplest way for you is to follow he hints given in http://code.google.com/appengine/docs/java/tools/ant.html regards didier On Mar 18, 8:55 pm, Benjamin Muschko wrote: > Hi, > > I have a question about the runtime classpath that is being used when > starting up a local development server. It is required to set > appengine-tools-api.jar in the classpath a parameter. My application > directory "web_app_dir" does not include some of the libraries that > are required at runtime (see below someother.jar); they sit in a > different directory. I tried to add them using the -cp parameter but > they don't seem to get evaluated. I get a > java.lang.NoClassDefFoundError. This is the call I make: > > java -cp /home/ben/dev/tools/appengine-java-sdk-1.4.2/lib/appengine- > tools-api.jar:/home/ben/dev/someother.jar > com.google.appengine.tools.KickStart > com.google.appengine.tools.development.DevAppServerMain web_app_dir > > Can somebody please shed some light on this? Are only the libraries > used that sit in web_app_dir/WEB-INF/lib? Is there any way I can add > additional libraries using an parameter? > > Thanks, > > Ben -- 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: can I perform a query in transaction without the pk-parent filler?
Hi, You don't need to explicitely use the parent filter in you query as long as all entities effectively are in the same group. The need for that is to isolate all entities potentially updated by a transaction on a single store server, i.e the one hosting the entity group. regards didier On Mar 18, 10:25 pm, Tapir wrote: > I am sure that the return entities are all in one entiry group. > Seems no errors on the dev server. But I don't know if it is ok on the > production server. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Deleting orphan blobs in blobstore
Hi, I deleted a large number of objects from the datastore that I din't required (around 7000 of them). Each of those objects had a blob associated with it, referenced by a String (blob key). As you might have guessed by now, I forgot to delete those blobs. Now I don't have any reference to them, but I want to delete them. I can't seem to find a way to do that. Any help will be appreciated. -- 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: Task Queue Production Problems.
Thanks Didier. On Feb 16, 12:26 pm, Didier Durand wrote: > Hi, > > readhttp://code.google.com/appengine/docs/adminconsole/instances.html > -> parags loading requests & warmup requests. > > regards > > didier > > On Feb 16, 7:07 am, Vinay Gaonkar wrote: > > > > > Hi > > > I have a webpage which add two task into the task queue. Its the same > > task with two different parameters. > > > When the first task starts executing I receive the warning. > > > "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." > > > The second task executes fine without any warning or error. The First > > task never completes the execution. > > > Is there a way to find out how to investigate this issue. In > > development environment everything works fine. > > > Thanks & Regards, > > - Vinay Gaonkar.- Hide quoted text - > > - Show quoted text - -- 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: Blobstore API vs Datastore API
The credit option has a budget and you can set it real low. Its unlikely unless you have huge amount of resource use that you'll go over. I've only had cents billed on my upload demo due to the amount of data stored. 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: urlfetch.Fetch() 1MB size limit - upload file to Google Docs
Try doing it in a task. I have over come a few limits in a task due to time and upload sizes. 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: Dudas sobre Aplicaciones con JPA
Este blog parece tener buenos ejemplos: http://gae-java-persistence.blogspot.com/ Estos son otras referencias, lo mas seguro las has visto antes... - http://code.google.com/appengine/docs/java/datastore/jpa/overview.html - http://code.google.com/p/datanucleus-appengine/ - http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summary.html Perdona que no te pueda informar mas, yo no uso JPA... yo uso el DatastoreService directamente. -- 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] can I perform a query in transaction without the pk-parent filler?
I am sure that the return entities are all in one entiry group. Seems no errors on the dev server. But I don't know if it is ok on the production server. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Local development server classpath - com.google.appengine.tools.KickStart
Hi, I have a question about the runtime classpath that is being used when starting up a local development server. It is required to set appengine-tools-api.jar in the classpath a parameter. My application directory "web_app_dir" does not include some of the libraries that are required at runtime (see below someother.jar); they sit in a different directory. I tried to add them using the -cp parameter but they don't seem to get evaluated. I get a java.lang.NoClassDefFoundError. This is the call I make: java -cp /home/ben/dev/tools/appengine-java-sdk-1.4.2/lib/appengine- tools-api.jar:/home/ben/dev/someother.jar com.google.appengine.tools.KickStart com.google.appengine.tools.development.DevAppServerMain web_app_dir Can somebody please shed some light on this? Are only the libraries used that sit in web_app_dir/WEB-INF/lib? Is there any way I can add additional libraries using an parameter? Thanks, Ben -- 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] urlfetch.Fetch() 1MB size limit - upload file to Google Docs
Try http://www.4shared.com Chetan On Fri, Mar 18, 2011 at 3:12 AM, Ian Gillett wrote: > I am attempting to upload a file > 1MB to Google Docs using an App > Engine application, basically I grab a submitted file using Commons > Upload and upload to Google Docs by setting .setMediaSource which all > works great. > > The problem is that there is a limit of 1MB imposed by the API call to > urlfetch.Fetch(). > > My question is - does anyone know if there are any plans to raise this > limit and if not is > there any way to work around this limit? > > -- > 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] urlfetch.Fetch() 1MB size limit - upload file to Google Docs
I am attempting to upload a file > 1MB to Google Docs using an App Engine application, basically I grab a submitted file using Commons Upload and upload to Google Docs by setting .setMediaSource which all works great. The problem is that there is a limit of 1MB imposed by the API call to urlfetch.Fetch(). My question is - does anyone know if there are any plans to raise this limit and if not is there any way to work around this limit? -- 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: GAE response returns null randomly
Here is a sample of a image transformation method I do with a task: public long createImageTransform(BlobDataFilter filter) { if (sp.getLoginData() == null || sp.getLoginData().getGoogleLoggedIn() == false) { log.warning("Ga_Service_Image.createImageTransform(): ERROR: not logged in"); return 0; } if (filter == null || filter.getThingId() == 0) { log.warning("Ga_Service_Image.createImageTransform(): ERROR: no filter or filethingid given"); return 0; } String url = "/task?task=transform&ownerid=" + sp.getUserThingId() + "&fileid=" + filter.getThingId(); if (filter.getTransformWidth() != null) { url += "&width=" + filter.getTransformWidth(); } if (filter.getTransformHeight() != null) { url += "&height=" + filter.getTransformHeight(); } if (filter.getTransformXOffset() != null) { url += "&xoffset=" + filter.getTransformXOffset(); } if (filter.getTransformYOffset() != null) { url += "&yoffset" + filter.getTransformYOffset(); } if (filter.getTile() != null) { url += "&tile=1"; } String taskName = StringUtils.getRandomString(5) + "_" + url; long taskId = new Db_Feed_TaskQue(sp).saveTask(filter.getThingId(), taskName); url = url + "&taskid=" + taskId; if (sp.getHeader("Cookie") == null || sp.getHeader("Cookie").trim().length() == 0) { log.warning("Ga_Service_Image.createImageTransform(): ERROR: No Cookie exists. This happens when you login."); return 0; } // setup request to task servlet try { TaskOptions taskOptions = TaskOptions.Builder.withUrl(url).header( "Cookie", sp.getHeader("Cookie")).method(Method.GET); Queue queue = QueueFactory.getDefaultQueue(); queue.add(taskOptions); } catch (Exception e) { new Db_Feed_TaskQue(sp).deleteTask(taskId); log.warning("Ga_Service_Image.createImageTransform(): error setting up task in que. deleting task. " + e.toString()); e.printStackTrace(); return 0; } return taskId; } -- 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: GAE response returns null randomly
10 seconds is the limit from what I read. I use a task for anything that takes over 10 seconds. Setup a servlet to init the task. The task then will start your methods, then you have up to 10 minutes to do the task before starting another task. You can use another rpc call to watch for the task completing before getting what you need, although you'll need to pass some stuff to JDO store to do this, which is another topic. 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: Using BulkUpload into Local Java Dev Server on Mac
I'm not sure this can help you, but thought I'd mention my thought. I use eclipse to deploy my files to the app server through eclipse. You could use the GWT eclipse plugin and stick your files in the war file and deploy it that way. But I'm not sure I understand whats going on, but thought that might be worth a try. 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: for the problem "Applications are limited to 150000000 bytes of resource files"
I had this happen to. What I did is setup a servlet to virtually serve them from the blob store, by using a web.xml to serve them dynamically or virtually. I had no problem with latency. http://demogaemultifileblobupload.appspot.com/ - my demo doing it. You can find source code on my site to how I did it. http://code.google.com/p/gwt-examples/wiki/DemoGAEMultiFileBlobUpload - my wiki notes on how i did it. 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] ImagesServiceFactory.makeImageFromBlob(blobKey) > image.getImageData() > gets NULL error >
When trying to get image byte data I get null using this method: (any thoughts?) Image image = ImagesServiceFactory.makeImageFromBlob(blobKey); Byte[] bytes = image.getImageData(); // this doesn't work as expected. It would be nice to fix that method to give whats expected. In my opinion the image api is thin and could use some enhancements to make it more useable. I'd like to see it become more like image magick api or GD2 linux api. Also to note, I'd like to see it have a method to stick the image into a the blob store with a method call. My Work around: private byte[] getImageBytes(BlobData blobData) { long endIndex = 1024; long startIndex = 0; BlobKey blobKey = new BlobKey(blobData.getKey()); ByteArrayOutputStream stream = new ByteArrayOutputStream(); if (endIndex > blobData.getSize()) { endIndex = blobData.getSize(); } while (endIndex <= blobData.getSize()) { byte[] b = blobstoreService.fetchData(blobKey, startIndex, endIndex); try { stream.write(b); } catch (IOException e) { e.printStackTrace(); } startIndex = startIndex + 1024; endIndex = endIndex + 1024; if (endIndex > blobData.getSize()) { endIndex = blobData.getSize(); } if (startIndex > endIndex) { break; } } byte[] r = stream.toByteArray(); return r; } Issue -> http://code.google.com/p/googleappengine/issues/detail?id=4757 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: Collection object not being updated
I still haven't figured this one out. Am I doing something wrong or there's a small bug in the JDO GAE implementation? Btw, I saw all the documentation has been changed to LowLevelAPI. Will JDO loose support sometimes soon? Thanks, Cosmin On Mar 6, 5:07 pm, Cosmin Stefan wrote: > Hey, > > I cannot use a transaction as I need to change multiple entries (as u > see, for each BigClass participant i have to remove an object from the > collection). > > Regarding the pm.makePersistent() call, I have tried with it before > and it didn't do anything different. Plus that on the GAE > documentation page they say it's not needed, as the pm tracks all the > changes. > > I have discovered another thing related to this problem. As I've shown > you, in the same persistence call I try to do these (remove smth from > the collection) changes and I also modify other objects. The weird > fact is that the last changes I make are persisted, while the others > aren't. Why is that? > > Regarding JPA I'll look into it, but it's kind of difficult as I > already have a huge part of my code written with JDO. > > Anyway, looking forward to hearing new suggestions! > > Thanks, > Cosmin > > On Mar 1, 6:59 pm, Ian Marshall wrote: > > > Hi Cosmin, > > > I do not see any calls to > > > pm.makePersistent(...); > > > I use this to persist newly-created persistent instances. > > > I know that you do not use transactions, but I do. Within an active > > transaction, one can update persistent instances and even persist or > > delete entity group child instances without calling > > > pm.makePersistent(...); > > > Have you looked at the GAE persistence blog of Max Ross of Google? > > There are some excellent working examples there... > > > Ian > > > On Feb 28, 6:55 pm, Cosmin Stefan > > wrote: > > > > So no ideea anyone? > > > > On Feb 25, 11:42 pm, Cosmin Stefan > > > wrote: > > > > > Hey, > > > > > I have an issue while trying to update one object in a collection, > > > > using JDO. > > > > > Here are the facts: > > > > o i have a class (let's call it BigClass), that has an embedded > > > > class(SmallClass) containing an ArrayList. > > > > o I DONT use/need a transaction > > > > o I query the database to get a List of BigClass items that should > > > > be modified. I iterate through each of them and I... > > > > o I remove an element from the list in the SmallClass embedded in > > > > the current BigClass, the changes are not ALWAYS persisted > > > > o if I print (log) the object after the change, it looks modified, > > > > but if i check the DataViewer, the object was not updated > > > > o i even tried using JDOHelper.makeDirty on the BigClass, with the > > > > fieldName SmallClass, and it still doesn't work. > > > > > Some relevant code: > > > > > Query q = > > > > pm.newQuery(BigClass.class,"id==:ids"); > > > > List > > > > participatingUsers=(List) > > > > q.execute(participantIDs); > > > > > //Update the participants > > > > ListIterator > > > > it=participatingUsers.listIterator(); > > > > BigClass participant; > > > > boolean modified; > > > > while(it.hasNext()) > > > > { > > > > participant=it.next(); > > > > participant.list.remove(smth); > > > > > JDOHelper.makeDirty(participant,"collection"); > > > > } > > > > > > > > modify other objects > > > > > > > > pm.close() > > > > > Another thing is that some of the changes I make after this part are > > > > persisted... > > > > > So, if you have any suggestions, shoot pls! > > > > > Cosmin -- 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: JUnit Test of Code that uses GAE/J URLFetchServiceFactory.getURLFetchService()
Thanks Didier! That does help! -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: JUnit Test of Code that uses GAE/J URLFetchServiceFactory.getURLFetchService()
Hi, There is a difference: a) the build path is what's needed to compile your source as you code it b) the classpath is what's needed to run the application The local jars provide low-level service used by the jars "facing" the user code and replace equivalent jars of the prod env. So, you don't need those jars when you compile but they are required locally when you run. Hope this helps regards didier On Mar 18, 6:40 am, James Andersen wrote: > Just for my own edification... I was comparing the build path of my test > project to my GAE project while trying to solve this... I didn't find these > jars in either one. When I launch my GAE project locally is "works" of > course... I'm using eclipse, does the "Google Web Application" launch > configuration handle loading these jars for me before my project is actually > loaded? > > Sorry still getting used to GAE and have been in the .NET world for several > years now... -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: how to persist a list of bytearray?
I normally don't do this but... if you're using Objectify, it's just: @Serialized private List attachments; Jeff On Thu, Mar 17, 2011 at 12:38 AM, Khanh Dao Minh wrote: > Dear Tao, > As I understand, you should not use byte[] in GAE store. GAE only support > some core value type > here: http://code.google.com/appengine/docs/java/datastore/entities.html#Properties_and_Value_Types > So I think you may change to ShortBlob: > http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/ShortBlob.html > > Here I go: > private List attachments = new ArrayList(); > ShortBlob foo = new ShortBlob(new byte[]...); > attachments.add(foo); > > Hope this help. > KhanhDM. > > -- > 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] Grails JPA and Embedded Classes
Hi Board, I am currently working on a port of the ACL-Plugin for grails and have some issues. Since Grails ACL domain classes use embedded classes I started to translate this using the JpaTemplate. Currently I am wondering, if there is a chance to use an embedded class as a standalone instance also? As soon as the class becomes embedded I cannot find a way to create an instance for it without embedding it within another class. Am I missing something - or is this not possible at all ? thanks four your help Thomas -- 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.