[appengine-java] Base64DecoderException
Hi all So I tried following junit code with SDK 1.2.6 and Java 6 -- KeyRange keyRange = DatastoreServiceFactory.getDatastoreService ().allocateIds(Account, 1); String keyString = keyRange.getStart().toString(); System.out.println(keyString.toString()); Key key = KeyFactory.stringToKey(keyString); System.out.println(key.toString()); -- Then I am facing following error. -- java.lang.IllegalArgumentException: Cannot parse: Account(1)== at com.google.appengine.api.datastore.KeyFactory.stringToKey (KeyFactory.java:192) at net.mapslog.gwt.server.db.dao.MarkerDaoS3ImplTest.testAddMarker (MarkerDaoS3ImplTest.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run (JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) Caused by: com.google.appengine.repackaged.com.google.common.util.Base64DecoderException: Bad Base64 input character at 7: 40(decimal) at com.google.appengine.repackaged.com.google.common.util.Base64.decode (Base64.java:550) at com.google.appengine.repackaged.com.google.common.util.Base64.decodeWebSafe (Base64.java:493) at com.google.appengine.api.datastore.KeyFactory.stringToKey (KeyFactory.java:190) ... 21 more -- Kind regards Toru Tomita --~--~-~--~~~---~--~~ 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: primary key portability
I ported my Open Source EJB3/JPA application to Google App Engine many months ago and almost at the beginning it was obvious that I had to split my entity classes to two versions: Google App Engine and non Google App Engine. Impossible to achieve 100% source compatibility. Primary key not compatible is only the one element of the whole story. http://hoteljavaopensource.blogspot.com/2009/09/migration-to-google-app-engine.html --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
I didn't use Spring, but I found detach/attach annoying and irrelevant in GAE context because: 1. Without detaching, when you update a field, and later on close the PM, the object will be committed regardless. This makes no sense in GAE as 99.99% of time you want to control what you commit or not. Worse yet if you persist other object and have a transaction, it might fail because the objects are in different entity group. 2. To get around #1, you might want to detachCopy the object once it's fetched, so that it won't be accidentally committed. However, when the object have a child object (or fields that's not in default fetch group), detach won't work (when you get child will throw error). You need to first get that child, detach it, then use the child as is. It's very messy when detaching a object with different types of children. 3. Putting object (that has children) in memcache is even more annoying. You can't just put it in memcache, because when it's read, you can't get the child. I am not sure if I get the child first then I will be able to read it later. I just couldn't make it work. 4. When serialized (happens when you memcache put), the size is actually bigger then necessary because some datastore connection related information is also serialized. I don't remember exactly, but a minimal JDO object is like ~500byte. If I serialize its fields with Hessian it's ~50 bytes. Probably not a issue when your object is big. The object I want to cache is some Session info, which is very small, but there might be lots of them. Also, if you really want to cache a JDO object as is, try to make it transient first, it will be smaller. Overall I just feel like detach/attach create more problems then its worth. I just can't think of a scenario that the JDO states are actually beneficial within a GAE context. Here's what I just found out with JDO today: If you change a type of a field, say from Long to Double, you can never delete the entries with JDO. You need to fetch the object first, then delete it, but you can't fetch it because a ClassCast exception will happen. I end up writing low level keys only query and using low level API to delete the entities with keys. I can go on but I am tired. :) On Oct 22, 7:21 pm, Rusty Wright rwright.li...@gmail.com wrote: Peter, it was gratifying to hear you say detach/attach is also problematic when dealing with caching and transactions because I've been banging my head against the wall trying to write integration tests with GAE's datastore, using JDO and Spring's transactions. I either get the is managed by a different Object Manager error or my objects don't get persisted or other errors I can't remember now. I can't figure out if I'm getting bit by Spring, GAE's datastore, or JDO, and it's very frustrating. What has been your experience, war stories, etc.? Peter Liu wrote: Awesome! I recently played with the lower level API as well. Some of the features are not available in JDO, like reserving a key before committing a new object. The detach/attach is also problematic when dealing with caching and transaction. I also noticed small JDO objects are much bigger than it needs to be when serialized. Just wondering do you have any performance profiling stats? I also feel like JDO is overkill, but I couldn't justify porting all JDO objects to another simple type without knowing how much cpu_ms it will save. Also, do you keep track of which field is dirty and avoid committing unmodified fields? I believe this is important to minimize api_cpu to avoid unnecessary index updates. On Oct 22, 2:37 am, Nacho Coloma icol...@gmail.com wrote: Hi all, We have been developing a persistence framework for the AppEngine Datastore based on the raw DatastoreService API. For our (simple) persistence case, both JDO and JPA were a bit overkill as we were spending a significant amount of time jumping through hoops to make our application roll, but at the same time the Datastore API was a too low-level solution to be usable. So we reinvented our wheel. In two days. SimpleDS is a light wrapper around the DatastoreService APIs that provide a simple interface for java persistent classes. It does not include fancy stuff or any super features, it's just the DatastoreService ported to a world where Java entities can be persisted directly (using a subset of JPA annotations). This is _not_ a JPA/JDO replacement, and will never be. But we have been using it for some weeks and are quite happy with it. Any kind of feedback from the AppEngine community would be welcome. Before calling the typical but we already have JPA/JDO! argument, please notice the following: * There are lots of considerations in a relational database that do not apply to AppEngine. This allows a specific solution to be simplified big time. Just see the depth of your typical stack trace to understand what I am talking about. *
[appengine-java] Re: SimpleDS: an alternative for Datastore persistence
1. Without detaching, when you update a field, and later on close the PM, the object will be committed regardless. This makes no sense in GAE as 99.99% of time you want to control what you commit or not. Worse yet if you persist other object and have a transaction, it might fail because the objects are in different entity group. Which is why there are transactions in JDO, and the use of rollback(). How GAE/J want to make use of these is down to them, but this is not a limitation of JDO. 2. To get around #1, you might want to detachCopy the object once it's fetched, so that it won't be accidentally committed. However, when the object have a child object (or fields that's not in default fetch group), detach won't work (when you get child will throw error). You need to first get that child, detach it, then use the child as is. It's very messy when detaching a object with different types of children. Which is why there are fetch groups in JDO and fetch depth so you, the user, has full control over what gets detached. You can detach whatever you need. 3. Putting object (that has children) in memcache is even more annoying. You can't just put it in memcache, because when it's read, you can't get the child. I am not sure if I get the child first then I will be able to read it later. I just couldn't make it work. JDO supports Level2 Cache. This is turned off by default but you could enable it, to use the memcached feature of GAE/J. This will mean objects are put into the L2 cache for you, and taken out when you need them. If you change a type of a field, say from Long to Double, you can never delete the entries with JDO. You need to fetch the object first, then delete it, but you can't fetch it because a ClassCast exception will happen. I end up writing low level keys only query and using low level API to delete the entities with keys. This is again not a limitation of JDO. You get the same issue with RDBMS; you have to migrate your schema. Google could provide a schema upgrade facility to take an existing schema definition and migrate to the updated form. I can go on but I am tired. :) I'm tired too ;-) --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
I think most complains about JDO in this group is not saying that JDO has issues. It just that GAE is so different then traditional environments that old frameworks aren't 100% suitable. If there's a modify version of JDO that strip out irrelevant features, and put in some important low level api features, it will be much much better. I believe the users who are writing there own frameworks are doing exactly that, from the ground. On Oct 23, 1:19 am, datanucleus andy_jeffer...@yahoo.com wrote: 1. Without detaching, when you update a field, and later on close the PM, the object will be committed regardless. This makes no sense in GAE as 99.99% of time you want to control what you commit or not. Worse yet if you persist other object and have a transaction, it might fail because the objects are in different entity group. Which is why there are transactions in JDO, and the use of rollback(). How GAE/J want to make use of these is down to them, but this is not a limitation of JDO. 2. To get around #1, you might want to detachCopy the object once it's fetched, so that it won't be accidentally committed. However, when the object have a child object (or fields that's not in default fetch group), detach won't work (when you get child will throw error). You need to first get that child, detach it, then use the child as is. It's very messy when detaching a object with different types of children. Which is why there are fetch groups in JDO and fetch depth so you, the user, has full control over what gets detached. You can detach whatever you need. 3. Putting object (that has children) in memcache is even more annoying. You can't just put it in memcache, because when it's read, you can't get the child. I am not sure if I get the child first then I will be able to read it later. I just couldn't make it work. JDO supports Level2 Cache. This is turned off by default but you could enable it, to use the memcached feature of GAE/J. This will mean objects are put into the L2 cache for you, and taken out when you need them. If you change a type of a field, say from Long to Double, you can never delete the entries with JDO. You need to fetch the object first, then delete it, but you can't fetch it because a ClassCast exception will happen. I end up writing low level keys only query and using low level API to delete the entities with keys. This is again not a limitation of JDO. You get the same issue with RDBMS; you have to migrate your schema. Google could provide a schema upgrade facility to take an existing schema definition and migrate to the updated form. I can go on but I am tired. :) I'm tired too ;-) --~--~-~--~~~---~--~~ 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 contains(Key) in JDO query
Hi Andy, query.setFilter(key == :keyList); ListMaster list = (ListMaster) query.execute(keyList); I'd like to know if that works with GAE/J, because it is illegal JDOQL syntax and would be a bug. JDOQL is supposed to follow Java syntax, and you simply cannot do Key == ListKey and get success in Java. You are right, but unfortunately the above query works on GAE/J. I should have recommended the following query: ListKey keys = ...; ListObject ids = new ArrayListObject(); for (Key key : keys) { ids.add(pm.newObjectIdInstance(Master.class, key)); } ListMaster list = (ListMaster) pm.getObjectsById(ids); Thanks, Yasuo Higa --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-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: SimpleDS: an alternative for Datastore persistence
I think most complains about JDO in this group is not saying that JDO has issues. It just that GAE is so different then traditional environments that old frameworks aren't 100% suitable. If there's a modify version of JDO that strip out irrelevant features, and put in some important low level api features, it will be much much better. Totally agree there are features of the ***ORM part of the JDO specification*** that aren't applicable to BigTable, but the whole point of JDO is that those should only be used where they are applicable to the datastore. To give an example, we (DataNucleus) support persistence to ODF documents, yet such a thing as @SecondaryTable is simply ignored there since it makes no sense. The same idea should be applied to GAE/J. There is absolutely nothing in the JDO ***API*** that is irrelevant to GAE/J and BigTable. When somebody actually defines what are these low level features that can't be handled by the JDO API then there would be a basis for comment, so if someone wants to define that then there can be meaningful discussion. --~--~-~--~~~---~--~~ 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] POLYMORPHISM: Failing to retrieve child-objects in a one-to-many JDO relationship
Hi Jason and Max, I was making some tests on this today and I've found out that one-to-many relationship child objects retrieving works as long as the one-to-many relationship doesn't involve polymorphisms. For example, if we make the Child class abstract and save subclasses into the list the retrieving fails. In the following the snippet that fails. Is this a bug? Am I doing something wrong?? Thanks --- String parentId = "test"; PersistenceManager pm = PMF.get().getPersistenceManager(); pm.currentTransaction().begin(); Parent parent = new Parent(); Child subChild = new SubChild(); subChild.setParentId(parentId); parent.getChilds().add(subChild); pm.makePersistent(parent); pm.currentTransaction().commit(); pm.close(); pm = PMF.get().getPersistenceManager(); parent = pm.getObjectById(Parent.class, parentId); assertEquals(1, parent.getModules().size()); pm.close(); --- --- public abstract class Child implements Serializable { private static final long serialVersionUID = -5125563546796512541L; @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") protected String encodedKey; @Persistent @Extension(vendorName="datanucleus", key="gae.pk-name", value="true") protected String parentId; [...] } @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") public class SubChild extends Child { private static final long serialVersionUID = 521265701642620882L; @Persistent(defaultFetchGroup="true") private String name; } -- Jason (Google) wrote: Max is right, although there's a small issue with the syntax: @Persistent(mappedBy="parent", defaultFetchGroup = "true") public ListChild childs; - Jason On Mon, Oct 19, 2009 at 10:26 PM, Max Zhu thebb...@gmail.com wrote: Hi Lars, Try to annotate your relationship as follows: @Persistent(mappedBy="parent", default-fetch-group="true") public ListChild childs; On Tue, Oct 20, 2009 at 12:19 AM, Lars lsor...@gmail.com wrote: Hi, I am failing to retrieve child-objects in a one-to-many JDO relation in the datastore. The case is as follows; I have two classes (Parent Child, code-snippet below) with a defined one-to-many relation. It is no problem storing the structure with the 'store'-operation defined below. This is easily verified by web-browsing the datastore. However, when retrievning the parent-object from the datastore ('fetchParents'), the ''childs' attribute is always null. What must be done to (auto-)populate this attribute from the datastore? Also, the 'parent'-attribute of the Child-objects will also be null if they are fetched in a similar way. All clues appreciated... Lars - - - - - - - Code samples below - - - - - - @PersistenceCapable(identityType = IdentityType.APPLICATION) public class ParentDTO { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String encodedKey; @Persistent public String name; @Persistent(mappedBy="parent") public ListChild childs; public ParentDTO() { } public void add(Child c) { if (childs == null) childs = new ArrayListChild(); kids.add(c); } } - - - - @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Child { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") public String encodedKey; @Persistent public String name; @Persistent public Parent parent; public Child() { } public String getEncodedKey() { return encodedKey; } } - - - - - Storing to datastore (works perfectly) public void store() { Parent p = new Parent(); p.navn = "nils"; Child c = new Child(); c.name = "jim"; p.add(c); c = new ChildDTO(); c.name = "anne"; p.add(c); PersistenceManager pm = PMF.get().getPersistenceManager(); try { pm.makePersistent(p); } catch (Exception ee) { res = ee.getMessage(); } finally { pm.close(); } } - - - - - - Fetching data (not working) public String fetchParents() { String res = ""; PersistenceManager pm = PMF.get().getPersistenceManager(); javax.jdo.Query query = pm.newQuery(Parent.class); ListParent parents = (ListParent) query.execute(); IteratorParent iterF = parents.iterator();
[appengine-java] Re: Problem with saving parent entity
It looks for me that you mix JPA annotations (OneToMany, Entity, Id) with JDO api. - using PersistenceManager. It is hard to say how it behaves and disentangle that issue. But if you want to have bi-directional ownership - in News entity Source instance - follow this thread, it could shed some light. http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/28d9c3b99df25e43/de54fff7bc059f11?lnk=gstq=snippet#de54fff7bc059f11 --~--~-~--~~~---~--~~ 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: Custom subdomain map with app engine
Hi, I have a domain myid.com mapped to google apps and I managed to configure my Java appengine to be served from www.myid.com. I would also like to serve the same Java appengine from myid.com. How can this be accomplished? Is there a DNS record which would alias myid.com to www.myid.com? I would more than pleased to be able to configure a 301redirect from myid.com to www.myid.com but I am not sure how can I do this with myid.com being mapped to google apps. Please advise, Marius On Oct 14, 10:16 pm, Jason (Google) apija...@google.com wrote: Please try not to double post in the future:http://groups.google.com/group/google-appengine-java/browse_thread/th... Thanks, - Jason On Mon, Oct 12, 2009 at 10:33 AM, Haroon Idrees haroo...@gmail.com wrote: I want to map google app application on subdomain but gets error I create cname on domain site which details is below site.haroonidrees.com IN CNAME ghs.google.com 3600s (1h) and Server error is Sorry, you've reached a login page for a domain that isn't using Google Apps. Please check the web address and try again. I search in group and found have to register my sub-domain in below link http://www.google.com/a/cpanel/domain/new I register it ,but the process of verification found tricky, It need to add CName in domain sever with alias googled75ead2b4ef9e1d9 to poiting to google.com because of sub-domain I can add this is parent domian manager (May be wrong) and also add CNAME for desire sub domain which details available below DNS server handling your query: localhost DNS server's address: 127.0.0.1#53 Non-authoritative answer: site.haroonidrees.com canonical name = ghs.google.com. ghs.google.com canonical name = ghs.l.google.com. Name: ghs.l.google.com Address: 74.125.47.121 then try to add domain ,found that above error get fix but still my sub-domain is not working kindly guide me what I do Please help ,May be I am missing some thing please points out if I miss any thing Regards -- Regards Haroon Idrees Software Team Lead IBL Group cell:0321-2066747 msn:haroon.idr...@hotmail.com msn%3aharoon.idr...@hotmail.com http://www.linkedin.com/in/haroonob --~--~-~--~~~---~--~~ 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: Authentication with Google Apps
At the time of creating an application-id on appengine, you have an option to allow authentication only for users of a particular domain or for all google account users. If you already have the application setup for universal google account authentication, then you need to create a new application-id specifying which domain users can authenticate on your application. On Oct 22, 7:20 pm, sportrider sportri...@gmail.com wrote: I am working to publish a site on App Engine and would like to authenticate users by using their Google Apps email rather than a gmail email. For example I'd like my users to enter their u...@mycompany.com email rather than someb...@gmail.com. Is this possible? I've tried adding mycompany.com to the authDomain argument on userService.createLoginURL(), but this didn't seem to do anything. Many thanks, Chris --~--~-~--~~~---~--~~ 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: Authentication with Google Apps
For example I'd like my users to enter their u...@mycompany.com email rather than someb...@gmail.com. Is this possible? I have a GAE app defined as public which I can authenticate to using u...@mycompany.com. The rules for when this does and doesn't work seem ill defined. then you need to create a new application-id specifying which domain users can authenticate on your application. Remember you need to get prior approval from Google before you create multiple duplicate applications On Fri, Oct 23, 2009 at 1:34 PM, Mansoor khaja.mans...@gmail.com wrote: At the time of creating an application-id on appengine, you have an option to allow authentication only for users of a particular domain or for all google account users. If you already have the application setup for universal google account authentication, then you need to create a new application-id specifying which domain users can authenticate on your application. On Oct 22, 7:20 pm, sportrider sportri...@gmail.com wrote: I am working to publish a site on App Engine and would like to authenticate users by using their Google Apps email rather than a gmail email. For example I'd like my users to enter their u...@mycompany.com email rather than someb...@gmail.com. Is this possible? I've tried adding mycompany.com to the authDomain argument on userService.createLoginURL(), but this didn't seem to do anything. Many thanks, Chris --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
There is absolutely nothing in the JDO ***API*** that is irrelevant to GAE/J and BigTable. I disagree, and that's the main reason why we developed our own framework. These are just some random thoughts about this subject: * Transactions in JDO is a global thing tied to the persistence store (one database = one transaction), but for GAE it's one transaction per entity group. It's perfectly reasonable to execute two transactions at the same time, which is hard to fit into the traditional development model with spring. * The current way of generating a primary key with a parent is not natural IMHO. My key attribute already has a parent, why should I add _another_ attribute with the parent PK? * Entity retrieval can be done just by providing the primary key, but JDO and JPA are not prepared for it - you must provide the entity class as well. This is redundant. * There are a lot of use cases (structures etc) supported by datanucleus that can be optimized out. This is important in a system where I pay per CPU cycle. The list goes on. The point is that you cannot develop a standard framework that works fine with a RDBMS and expect it to be the optimal solution for a storage that is entirely different. For me, there are enough differences that justify going for a specific solution. My .02 euro. P.S.: Please keep in mind that I have absolutely nothing against datanucleus, which is indeed a nice implementation. --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
I recently played with the lower level API as well. Some of the features are not available in JDO, like reserving a key before committing a new object. Yes, we wanted to get access to those. Specially, the create several keys at once and persist several entities at once are great, we combined those to implement the put(IterableObject) method. Just wondering do you have any performance profiling stats? I also feel like JDO is overkill, but I couldn't justify porting all JDO objects to another simple type without knowing how much cpu_ms it will save. Nope. I can tell you that deployments are much faster and the typical stack trace has dropped from 10-15 lines to 3. And, of course, class enhancements are no longer necessary. Also, do you keep track of which field is dirty and avoid committing unmodified fields? I believe this is important to minimize api_cpu to avoid unnecessary index updates. I don't think you can do that (please someone correct me if I'm wrong). If you omit any field while putting an entity, you lose those fields in the persisted entity because it's schema-less. What you can do is disable field checks (required fields while saving, existing fields while querying) to make it faster in production, if you feel confident in your QA. Regards, Nacho. --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
Do you have some more doc/java doc ? I was browsing through your page and found nothing. As far as I caught you implemented simple set of CRUD operations on items and simple query mechanism. Am I right ? The decision to get rid of relationships is very sound because this GAE/J implementation is rather like a bargain - it brings more troubles than advantages. The only advantage of owned relationship is to persist it under transactions - but you can achieve transactional behavior in more straightforward way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: LIKE query workaround for the Low Level API
Support for StartsWith was added. I think most of us are moving from the SQL world to Bigtable world and things are little bit done differently and we expect it work the same as SQL . You can use and which is same as like. - Harjit On Oct 22, 10:10 pm, Max Zhu thebb...@gmail.com wrote: So far as I know, Bigtable only supports: myString LIKE foo,% On Fri, Oct 23, 2009 at 6:24 AM, Nicholas Albion nalb...@gmail.com wrote: I don't suppose it's possible to do: myString LIKE %,foo,% I'm surprised that the datastore used by a search engine doesn't have better support for string searching/comparison... --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
I have uploaded the generated javadoc here: http://code.google.com/p/simpleds/downloads/list I haven't had time to review it yet, so take it with a grain of salt. The list of features you should look for are: * CRUD operations at the EntityManager interface * SimpleQuery * PagedQuery That's it. The generated javadoc also makes reference to some classes that are not yet included in the library, such as @MultivaluedIndex which is a feature we are playing with to avoid the hassle of implementing Relation Index Entities. Regards, Nacho. On Fri, Oct 23, 2009 at 4:34 PM, leszek leszek.ptokar...@gmail.com wrote: Do you have some more doc/java doc ? I was browsing through your page and found nothing. As far as I caught you implemented simple set of CRUD operations on items and simple query mechanism. Am I right ? The decision to get rid of relationships is very sound because this GAE/J implementation is rather like a bargain - it brings more troubles than advantages. The only advantage of owned relationship is to persist it under transactions - but you can achieve transactional behavior in more straightforward way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Photo and Video services
In terms of performance does gaevfs accmmodate http resource timestamp checks to avoid re-downloading repeated requests for the same images? On Oct 22, 8:22 pm, Vince Bonfanti vbonfa...@gmail.com wrote: That's the most GAE will let you upload in one request (for now). Again, there's a Service for storing and serving large files feature on the roadmap, but the details of this feature have not be revealed. Vince On Thu, Oct 22, 2009 at 7:40 PM, Diana Cruise diana.l.cru...@gmail.com wrote: What is the nature of the 10Mb limit again? On Oct 22, 6:38 pm, Diana Cruise diana.l.cru...@gmail.com wrote: Yes, that worked ok from another system so it must be an IE7 problem...good catch! On Oct 22, 5:55 pm, Vince Bonfanti vbonfa...@gmail.com wrote: Can you try a different browser? From the logs it looks like you're using IE7. I just tried with IE8, Chrome, and Firefox 3 (all on Windows) and they all worked fine. Something about the path being sent by the browser is causing the error--if we can narrow it to IE7 then I can investigate further. The only degradation I've ever seen is that larger files take longer to download, which you'd expect. However, I've never done any real load or stress testing. Vince On Thu, Oct 22, 2009 at 6:07 PM, Diana Cruise diana.l.cru...@gmail.com wrote: Actually, I tried simple files without spaces also and they failed too. When I hit your photo I noticed execellent response time...have you noticed any particular degradation when displaying lists of photos, for example? On Oct 22, 3:58 pm, Diana Cruise diana.l.cru...@gmail.com wrote: Thanks Baz. Vince, I hit your demo site and just entered a path like /gaevfs/mypic or /gaevfs/images/mypic, then selected a local small photo. On submitting the form, received the 500 error...perhaps the photo had spaces in the name? On Oct 22, 3:10 pm, Vince Bonfanti vbonfa...@gmail.com wrote: You were unable to upload a small photo on my demo site, or in your development environment? I just successfully uploaded an image to the demo site, which you can download from here: http://gaevfs.appspot.com/gaevfs/images/ Yes, the images get stored in blocks of 1MB or less. GaeVFS implements a virtual file system, so you refer to the file using URL links, just as you would for a static file. For example, here's an image I just uploaded: http://gaevfs.appspot.com/gaevfs/images/img4.jpg The GaeVfsServlet handles both upload and download, and demonstrates how this is done: http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant... The GaeVfsServlet also handles setting the content type for the response. Vince On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise diana.l.cru...@gmail.com wrote: Vince, I was unable to upload small photos...getting error code 500! What is the basic principle behind this solution? It appears you are storing the file in datastore in increments of 1M or less...along the lines of what Raphael was getting at. How do you display a list of images from the datastore on a webpage? On Oct 22, 1:33 pm, Vince Bonfanti vbonfa...@gmail.com wrote: Hi Diana, I've created GaeVFS to solve this problem: http://code.google.com/p/gaevfs/ You can view a demonstration here: http://gaevfs.appspot.com/ Note that the current released version (0.3) will only upload about 2.0MB before timing out; the latest code in SVN will support the full 10.0MB allowed by Google App Engine. There's a feature on the roadmap called Service for storing and serving large files, but there's apparently no additional information available on this feature: http://code.google.com/appengine/docs/roadmap.html Vince On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise diana.l.cru...@gmail.com wrote: What options do I have in GAE to allow Users to upload, store, and view media (photos, video, audio, etc) from my within my application? Is there a special data type in datastore that would be used to store media? If I store a media item in datastore then how do I display it to the User? In a regular app server, I would do this as a static file reference where I first transfer the data from the database to a file accessible under webroot (if it is not already present). But in GAE the application can NOT create files in the static area due to permissions...so is there another technique to accomplish this? Would videos best be served indirectly via youtube? If so, how do I know they will NOT be removed prematurely by youtube?
[appengine-java] 403 Forbidden You do not have permission to modify this app
Guys, I am trying to develop a Google app engine test project as the tutorial. It runs well in local but when I want to deploy by the Eclipse Button Deploy App Engine Project After some operation it show the error. Here is my error log: !ENTRY com.google.appengine.eclipse.core 4 0 2009-10-23 12:45:21.812 !MESSAGE Unable to update app: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=2590177version=1; 403 Forbidden You do not have permission to modify this app (app_id=u'2590177'). See the deployment console for more details !STACK 0 com.google.appengine.tools.admin.AdminException: Unable to update app: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=2590177version=1; 403 Forbidden You do not have permission to modify this app (app_id=u'2590177'). at com.google.appengine.tools.admin.AppAdminImpl.update (AppAdminImpl.java:62) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy (AppEngineBridgeImpl.java:271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace (DeployProjectJob.java:148) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.io.IOException: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=2590177version=1; 403 Forbidden You do not have permission to modify this app (app_id=u'2590177'). at com.google.appengine.tools.admin.ServerConnection.send (ServerConnection.java:143) at com.google.appengine.tools.admin.ServerConnection.post (ServerConnection.java:81) at com.google.appengine.tools.admin.AppVersionUpload.send (AppVersionUpload.java:427) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction (AppVersionUpload.java:241) at com.google.appengine.tools.admin.AppVersionUpload.doUpload (AppVersionUpload.java:98) at com.google.appengine.tools.admin.AppAdminImpl.update (AppAdminImpl.java:56) ... 4 more --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] extracting zip files on GAE
once I have uploaded a zip file onto the GAE Virtual File System, how do I access the zip entries. am really stuck here. could someone help me out?! --~--~-~--~~~---~--~~ 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] Servlet widgets - an alternative to GWT or servlet dispatch jsp paradigm
I'm very pleased with the Google Web Toolkit (GWT) and it would very nice to adopt the same way of building html code user interfaces in servlets in GAE - as an alternative to the servlet dispatching jsp paradigm. In short - from inside servlet doPost (or doGet) method - it would be nice to add widgets like panels, buttons ... and basic html (with attributes and parameters) - to the document before written to the response. - a GWT-clone creating html code directly to the servlet response instead of GWT creating javascript in the server that creates html in the browser. Any tips to java html-widget libraries? --~--~-~--~~~---~--~~ 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] Problems with file upload using jakarta fileupload
Hello, I have a problem with uploading files using jakarta fileupload library in my GAE application(commons-fileupload-1.2.1.jar). I'm using struts and FormFile class to handle uploaded file. On development GAE server everything is fine and works as expected but on production server I see NullPointerException in the log of my application (see corresponding part of the log at the and of this message). So it looks like library code failed to get temporary directory for uploading file. Can anybody give me the way how to fix this problem or workaround for this issue? Thanks in advance. org.apache.struts.chain.commands.AbstractExceptionHandler execute: Unhandled exception java.lang.NullPointerException at org.apache.struts.upload.CommonsMultipartRequestHandler.getRepositoryPath (CommonsMultipartRequestHandler.java:364) at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest (CommonsMultipartRequestHandler.java:175) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java: 410) at org.apache.struts.chain.commands.servlet.PopulateActionForm.populate (PopulateActionForm.java:50) at org.apache.struts.chain.commands.AbstractPopulateActionForm.execute (AbstractPopulateActionForm.java:60) at org.apache.struts.chain.commands.ActionCommandBase.execute (ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java: 191) at org.apache.commons.chain.generic.LookupCommand.execute (LookupCommand.java:305) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java: 191) at org.apache.struts.chain.ComposableRequestProcessor.process (ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java: 462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:713) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1093) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter (SaveSessionFilter.java:35) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1084) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter (TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle (ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle (SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle (SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle (ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 405) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle (AppVersionHandlerMap.java:238) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 506) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete (HttpConnection.java:830) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable (RpcRequestParser.java:76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest (JettyServletEngineAdapter.java:139) at com.google.apphosting.runtime.JavaRuntime.handleRequest (JavaRuntime.java:239) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5135) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5133) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest (BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java: 363) at com.google.net.rpc.impl.Server$2.run(Server.java:814) at com.google.tracing.LocalTraceSpanRunnable.run (LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan (LocalTraceSpanBuilder.java:516) at com.google.net.rpc.impl.Server.startRpc(Server.java:769) at com.google.net.rpc.impl.Server.processRequest(Server.java:351) at com.google.net.rpc.impl.ServerConnection.messageReceived (ServerConnection.java:437) at com.google.net.rpc.impl.RpcConnection.parseMessages (RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived (RpcConnection.java:290) at
[appengine-java] Changing default encryption policy of GAE
Hi All, My webapp works on my notebook and can handle encryption/decryption with higher strength keys. This is possible because I have downloaded the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. And installed these Policy Files in my notebook. Unluckily GAE seems to have the default policy setting of Java, and not capable of handling encryption/decryption with higher strength keys. The max allowed key length is only 128 with transformation shown below. int keyLenght = Cipher.getMaxAllowedKeyLength(AES/CBC/PKCS5Padding); I am trying to cross over from C# to Java. My program is ready but can't figure out how to change encryption policy of GAE. Anyone has a solution to this issue? Regards, GoSharpLite --~--~-~--~~~---~--~~ 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] Datastore retrieve error
I have a object mapped to the Datastore that looks like: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class SyncConfiguration { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private Account account1; @Persistent private Account account2; .. } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Account { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private String email; . } if i am now loading the object back from the store with final SyncConfiguration syncConfig = pm.getObjectById (SyncConfiguration.class, action.getSyncConfigId()); the fields account1 and account2 have the same instance. Do i have to configure something in a different way or is it a bug? --~--~-~--~~~---~--~~ 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] Incoming Email Service
Hi, I was able to put together an incoming email servlet that can read the subject and the metadata. However, I have not been able to successfully extract the body of the message. Can anyone post an example? Here's what I have so far: import java.io.IOException; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.servlet.http.*; @SuppressWarnings(serial) public class MailHandlerServlet extends HttpServlet { public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { Properties props = new Properties(); Session session = Session.getDefaultInstance(props, null); try { MimeMessage message = new MimeMessage(session, req.getInputStream ()); Message emailMessage = new MimeMessage(session); emailMessage.setFrom(new InternetAddress(k...@gmail.com, from address)); emailMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(k...@gmail.com, to address)); emailMessage.setSubject(message.getSubject()); // HOW DO I GET THE MESSAGE? emailMessage.setText(message); Transport.send(emailMessage); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } --~--~-~--~~~---~--~~ 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] UserService.isUserAdmin() returns false for domain administrator of certain domains
On some domains the UserService.isUserAdmin() is returning false for domain administrators. Which group/issue tracker is the right one to post this issue? --~--~-~--~~~---~--~~ 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: SimpleDS: an alternative for Datastore persistence
* Transactions in JDO is a global thing tied to the persistence store (one database = one transaction), but for GAE it's one transaction per entity group. It's perfectly reasonable to execute two transactions at the same time, which is hard to fit into the traditional development model with spring. One txn per PM, at any one time. You can have multiple PMs open, hence multiple txns. How Spring handles that is for Spring. * The current way of generating a primary key with a parent is not natural IMHO. My key attribute already has a parent, why should I add _another_ attribute with the parent PK? That is the problem of Google for exposing their Key. A user doesn't care about internal handling. When we provided support for db4o we didn't expose db4o's key, instead providing a clean long/String/int type etc, and doing conversions internally ... aka transparent ... the whole point of JDO. * Entity retrieval can be done just by providing the primary key, but JDO and JPA are not prepared for it - you must provide the entity class as well. This is redundant. pm.getObjectById(Object id) It's an id, a JDO identity (pm.getObjectId(obj)). Can't get simpler. JPA insists on the class too but then that's JPA. * There are a lot of use cases (structures etc) supported by datanucleus that can be optimized out. This is important in a system where I pay per CPU cycle. Yes, but when the plugin doing the work (the GAE/J DN plugin) doesn't (shouldn't) touch the majority of those then that is minimal The list goes on. Please do continue the list, because I'm sure Max et al will be interested to know what you think are problem areas so they can cater for such things in their DN plugin. P.S.: Please keep in mind that I have absolutely nothing against datanucleus, which is indeed a nice implementation. Not a problem, neither do I have anything against any alternative, just wanting to understand the motivations, and to see if there is something that can be adapted. The fact is that the GAE/J DN plugin is open source too, and Max et al are open to input on it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Photo and Video services
No, not yet. It's on the TODO list (see line 171 of the GaeVfsServlet source code). If you--or anyone else--wants to add this I'll be happy to accept a patch. Vince On Fri, Oct 23, 2009 at 11:42 AM, Diana Cruise diana.l.cru...@gmail.com wrote: In terms of performance does gaevfs accmmodate http resource timestamp checks to avoid re-downloading repeated requests for the same images? --~--~-~--~~~---~--~~ 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: extracting zip files on GAE
I assume you're using GaeVFS (http://code.google.com/p/gaevfs/)? Basically, you need to create a java.util.ZipInputStream instance to read the zip file. GaeVFS implements a file system API based on Apache Commons VFS (http://commons.apache.org/vfs/). To open an InputStream for a file using GaeVFS do the following: FileSystemManager fsManager = GaeVFS.getManager(); FileObject zipFileObject = fsManager.resolveFile( /path/to/myZipFile.zip ); InputStream in = zipFileObject.getContent().getInputStream(); Now you can create a ZipInputStream to read the file: ZipInputStream zipIn = new ZipInputStream( in ); If you're so inclined, you can reduce this all to: ZipInputStream zipIn = new ZipInputStream( GaeVFS.resolveFile( /path/to/myZipFile.zip ).getContent().getInputStream() ); Don't forget to close the ZipInputStream when you're finished with it. See the following for more information: http://code.google.com/p/gaevfs/wiki/UsingGaeVFS http://code.google.com/p/gaevfs/wiki/CombinedLocalOption http://code.google.com/p/gaevfs/wiki/ApplicationPortability Vince On Fri, Oct 23, 2009 at 5:09 AM, deft somondig...@gmail.com wrote: once I have uploaded a zip file onto the GAE Virtual File System, how do I access the zip entries. am really stuck here. could someone help me out?! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Java vs. Python X-AppEngine-Estimated-CPM-US-Dollars
Hi David. What is your application's ID? - Jason On Wed, Oct 21, 2009 at 3:46 PM, david.zverina david.zver...@gmail.comwrote: Keeping steady HTTP traffic does not work either. I have a script which 'http pings' my application every 30 seconds. Yet my app-engine instance experienced 70 spin downs yesterday alone! I am REALLY looking to this update - until then I'd highly recommend staying away from Spring! On Oct 21, 6:59 pm, Jason (Google) apija...@google.com wrote: Aside from keeping steady HTTP traffic to your site, I'm afraid not. But as I wrote in my last post, we're making updates over the next few releases to drive this startup time lower. - Jason On Tue, Oct 20, 2009 at 2:06 AM, Marcel Overdijk marceloverd...@gmail.comwrote: Is there any other way to keep an instance warm? Startup of instance just takes to much time to have an effective GAE/J application... On 19 okt, 22:58, Jason (Google) apija...@google.com wrote: To answer your question, no, having a cron job run every minute to keep an instance warm will not work. If all application instances have spun down, then a fresh HTTP request will require a new instance to be created, which will incur the startup costs. - Jason On Fri, Oct 16, 2009 at 6:45 AM, Toby tobias.ro...@sunnymail.mobi wrote: That is an interesting thread. I was asking myself the same question. My problem is, that I have some expensive initialization that is done when the webapp is initialized. I recognized that the very first request (after a longer time of idle) takes a lot of time. And as you say is expensive. I wonder if it would make sense to have a cron job that runs every minute to prevent this? On Oct 15, 10:52 pm, Timwillhack timwillh...@gmail.com wrote: I should probably point out that when I say 'Timed out' I really mean, clean start after waiting say 10 minutes to refresh a page, its not a 30 second endless while loop or anything, its actually just outputting one character from a string array. On Oct 15, 2:46 pm, Timwillhack timwillh...@gmail.com wrote: I was just curious if the initialization of the Java VM is actually charged a client? Here are some sample headers from Java vs. Python after letting the server timeout: VERY EXPENSIVE JAVA (timed out - guessing restarting VM): X-AppEngine-Estimated-CPM-US-Dollars: $0.149171 X-AppEngine-Resource-Usage: ms=4152 cpu_ms=6440 api_cpu_ms=0 X-AppEngine-Estimated-CPM-US-Dollars: $0.145377 X-AppEngine-Resource-Usage: ms=3890 cpu_ms=6276 api_cpu_ms=0 Cheap JAVA (quick refresh): X-AppEngine-Estimated-CPM-US-Dollars: $0.000168 X-AppEngine-Resource-Usage: ms=41 cpu_ms=3 api_cpu_ms=0 X-AppEngine-Estimated-CPM-US-Dollars: $0.000189 X-AppEngine-Resource-Usage: ms=19 cpu_ms=4 api_cpu_ms=0 CHEAP PYTHON FRESH START (waited about 10 mins before connecting): X-AppEngine-Estimated-CPM-US-Dollars: $0.002778 X-AppEngine-Resource-Usage: ms=103 cpu_ms=116 api_cpu_ms=0 X-AppEngine-Estimated-CPM-US-Dollars: $0.002778 X-AppEngine-Resource-Usage: ms=106 cpu_ms=116 api_cpu_ms=0 PYTHON RECONNECT QUICKLY: X-AppEngine-Estimated-CPM-US-Dollars: $0.000231 X-AppEngine-Resource-Usage: ms=7 cpu_ms=6 api_cpu_ms=0 Python is reporting very very very cheaper pricing per 1000. Is this the case or does google not really charge for the initialization for java? I sat here refreshing a page with a friend doing the same, out of the 40 or so requests about 4 were skyrocketed in price. This makes me very wary about making something that is hit excessively, since it seems like each instance is only taking 10 requests each per minute or whatver Yuck, are my numbers flawed or something? Or is Python just so much more efficient to use on app engine? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-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: SimpleDS: an alternative for Datastore persistence
On Fri, Oct 23, 2009 at 6:06 PM, datanucleus andy_jeffer...@yahoo.comwrote: * Transactions in JDO is a global thing tied to the persistence store (one database = one transaction), but for GAE it's one transaction per entity group. It's perfectly reasonable to execute two transactions at the same time, which is hard to fit into the traditional development model with spring. One txn per PM, at any one time. You can have multiple PMs open, hence multiple txns. How Spring handles that is for Spring. Injecting one PM per transaction seems cumbersome to me. It's also not documented anywhere AFAIK (at least, not in the transactions page). * The current way of generating a primary key with a parent is not natural IMHO. My key attribute already has a parent, why should I add _another_ attribute with the parent PK? That is the problem of Google for exposing their Key. A user doesn't care about internal handling. When we provided support for db4o we didn't expose db4o's key, instead providing a clean long/String/int type etc, and doing conversions internally ... aka transparent ... the whole point of JDO. I would say that AppEngine users care a big deal about the internals, specially when considering sharding. I understand that Google low-level interface does not fit well with JDO key conversion, but again that is my whole point - that maybe the standard is not the best option for this concrete case. Please do continue the list, because I'm sure Max et al will be interested to know what you think are problem areas so they can cater for such things in their DN plugin. Now that we are discussing it, I am curious: why does datanucleus only support owned relationships? There is not that much difference between the typical Foreign Key field and a GAE Key property. The fact is that the GAE/J DN plugin is open source too, and Max et al are open to input on it I am really grateful for all the insight about the subject. 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: Spring MVC + Sitemesh problem
Yes, please try changing the log levels to .INFO or .FINEST -- it's possible that the log output that the frameworks are generating is just not getting surfaced because of the default logging level. After you deploy, you say that all you see is an empty site. Have you tried refreshing several times to see if your application eventually appears? This could point to a failed initialization and HardDeadlineExceeded error. Please post your application ID so we can determine this for certain. - Jason On Wed, Oct 21, 2009 at 11:20 AM, Abhinav Lele abhinav.l...@gmail.comwrote: Have you tried increasing the log levels ? -- Abhinav -Original Message- From: appenginetester jsand...@zerofeelistings.com Sent: 21 October 2009 23:46 To: Google App Engine for Java google-appengine-java@googlegroups.com Subject: [appengine-java] Re: Spring MVC + Sitemesh problem Thanks for this post, i thought i was going insane. I have deployed and redeployed dozens of times and see the same isssue -- empty site, no logs. Everything works fine in local eclipse environment. The deplyment to the app engine works with no errors. But when I access the application, there is an empty site and no logs on the server. On Oct 20, 5:35 am, Shponter shpon...@gmail.com wrote: Hi everybody! I'm using Spring MVC (3.0.0.RC1) with Sitemesh (2.4.2). Locally it works fine - generated jsp is decorated by sitemesh. When I deploy application on AppEngine I get empty site. There is also no exceptions or log messages... I don't have any ideas how to solve this... Cheers --~--~-~--~~~---~--~~ 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 contains(Key) in JDO query
Thanks so much for the feedback. I actually tried to extend the Key CONTAINS concept to other fields but ran into a big wall right away. It would be great to get your 2 cents. Here is the root of my problem: I have a student object, it has a number of qualifying attributes, for example: int gpa: 1 = 0 to 2.0, 2 = 2.0 to 3.0, 3 = 3.0 to 4.0 int ageGroup: 1 = 0 to 17, 2 = 18 to 30, 3 = 30 to 65, 4 = 65+ ArrayList schoolPreference: [0] = 'MIT', [1] = 'Stanford', [2] = 'Harvard', [3] = 'Yale' Now, I need to create a query to find out all the students where (gpa = 2 or gpa = 3) AND (age group = 3 or age group = 4) AND (schoolPreference contains MIT or Yale, or both) As far as I know, GAE doesn't support OR operator in a query, so the only way I can get the query above to work is to have multiple sub- queries and do a manual join on all the datastore resultsets to artificially create a union. If so, big problem arises: Since I have so many OR sub-conditions, if every OR translates into a separate sub-query, literally speaking, I need to do a full permutation of all the conditions (full product of all the OR and AND conditions) in all my sub-queries to achieve my goal, which doesn't make any sense if I keep adding more value types (such as more schools being selected in the student preference criteria) into my attributes, not to mention adding more attributes to my student object. Is there any way to accomplish this query in GAE? Your help is greatly appreciated because this can be the deal breaker of whether my whole project can migrate to GAE or not. Thanks a lot in advance. On Oct 23, 1:51 am, Yasuo Higa higaya...@gmail.com wrote: Hi Andy, query.setFilter(key == :keyList); ListMaster list = (ListMaster) query.execute(keyList); I'd like to know if that works with GAE/J, because it is illegal JDOQL syntax and would be a bug. JDOQL is supposed to follow Java syntax, and you simply cannot do Key == ListKey and get success in Java. You are right, but unfortunately the above query works on GAE/J. I should have recommended the following query: ListKey keys = ...; ListObject ids = new ArrayListObject(); for (Key key : keys) { ids.add(pm.newObjectIdInstance(Master.class, key));} ListMaster list = (ListMaster) pm.getObjectsById(ids); Thanks, Yasuo Higa --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-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] trouble with SDK 1.2.6
I'm having no luck with SDK 1.2.6 within Eclipse 3.5.1 (Windows). Yes, I've added the -javaagent VM argument to my debug configuration. However, if I try to do almost anything at all within my ServletContextListener.contextInitialized() method I get this: 2009-10-23 17:48:59.192::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2009-10-23 17:48:59.526::INFO: jetty-6.1.x 2009-10-23 17:49:00.487::WARN: failed com.google.apphosting.utils.jetty.devappenginewebappcont...@429c19{/,C:\Users\vinceb\workspace\gaevfs\war} java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.agent.runtime.Runtime.clinit(Runtime.java:32) at com.newatlanta.appengine.servlet.GaeVfsServletEventListener.contextInitialized(GaeVfsServletEventListener.java:48) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:217) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:181) at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:116) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217) at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:162) at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48) at com.google.appengine.tools.development.DevAppServerMain.init(DevAppServerMain.java:113) at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89) Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.agent.AppEngineDevAgent at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 20 more 2009-10-23 17:49:00.489::WARN: failed jettycontainerservice$apiproxyhand...@116318b java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.agent.runtime.Runtime.clinit(Runtime.java:32) at com.newatlanta.appengine.servlet.GaeVfsServletEventListener.contextInitialized(GaeVfsServletEventListener.java:48) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:217) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:181) at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:116) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217) at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:162) at
[appengine-java] SDK does not upload files that start with .
The SDK (1.2.5) does not upload file with names that start with . such as .h2.server.properties. I assume this is because such files are considered hidden on Linux/UNIX; but, I'm running on Windows, so this must be something in the SDK itself and not caused by the file system. Is this intentional, or should I open a bug report? Vince --~--~-~--~~~---~--~~ 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 Performance
Hi Diana. As others have stated, App Engine can write to multiple entity groups in parallel, so if each User entity is a root entity or is otherwise placed in a different entity group, then there shouldn't be any issues. Regarding performance, all apps should generally be able to handle up to 30 simultaneous dynamic requests assuming a 75ms processing time for each (average load), for a throughput of 400 qps or so: http://code.google.com/appengine/docs/java/runtime.html#Quotas_and_Limits If you want any other performance or cost-related numbers, let me know. For updates to the same entity or entity group, App Engine uses optimistic concurrency as opposed to locking. If an entity is already being updated, then the second request will fail and will automatically get retried on the server. After consistent failures, an exception will be thrown which you can catch to either handle gracefully. Datastore writes will fail from time to time, generally about 0.1 to 0.2 percent of the time, but the failure rate will be higher when there is contention, i.e. a high rate of simultaneous writes to the same entity/entity group. http://code.google.com/appengine/articles/scaling/contention.html - Jason On Thu, Oct 22, 2009 at 8:04 AM, Diana Cruise diana.l.cru...@gmail.comwrote: I'm glad to hear that the 1-10 requests/second is per User root entity...in my case this means that huge number of Users logged in around the world should expect sub-second response even if tens of thousands clicked the Update button at the same instance in time! The only problem is we do NOT hear from anyone outside of Google to confirm performance of large volume for specific applications and what the real costs are!!! Regarding deadlock, I hear GAE does NOT both with lock timeouts so as soon as a transaction trys to retrieve a record that is already locked, it will receive an error and have to retry. On Oct 19, 5:50 pm, Dr. Flufenstein michael.brink...@gmail.com wrote: Preface: Please note, I'm not speaking for google at all in this note and a lot of what I've written is speculation based on what I've read in various GAE docs as well as some meager knowledge of how relational DBs generally work. And yes, I know datastore isn't a relational DB, but I believe that their indexing implementation likely runs into many of the same problems you have with indexing relational data although that assumption could be completely wrong. From what I can tell, the update bottleneck you're referring to is for updating what you would often think of as a single record if you were persisting one instance of your User as a single denormalized record in a relational schema. I suspect this bottleneck is due to the datastore architecture and the way that data updates are accumulated (possibly grouped/keyed by PK) in a queue, which is probably read from like a cache if read requests come in before the data has been flushed into the actual storage medium and replicated to the other datacenters. So if each of your users were updating their own User records, I don't believe you'd experience that limitation which may be an artifact of how those in-memory queue/cache structures are managed/locked during updates (i.e. a new update for a record may be held until it's been flushed from the queue to the storage medium to prevent having to merge/reconcile records in the queue). If they were all updating a single shared record, then I think you'd hit this pretty quick. Let's say though that your users are updating separate records...as your data size grows, you will probably see your update throughput decrease as other factors become dominant, and I believe this will primarily be dependent on the number and composition of the indexes on your data as well as the number of entities persisted. To me, this is the much riskier unknown because your average index structure is harder to update piecewise in parallel because the index must allow you to order/search all of the records' indexed columns. In an RDBMS like SQL Server or Oracle, you'd see some level of index locking take place during each transaction (maybe one page of an index) to allow concurrent updates to different sections of an index before the updates are committed, the transaction is ended and the locks are released. In relational persistence systems, this gets slower as the indexes become larger and is usually overcome with a technique like partitioning which, if you aren't familiar with it, sort of gives you a top level of your index tree where the data is actually spread into n groups of tables/indexes depending on some value in each record, and you usually pick a partition key so that data volume in each partition is kind of naturally balanced because rebalancing across partitions is expensive. I'm not sure that any kind of similar mechanism has been exposed in the GAE datastore right now
[appengine-java] creating Word and Excel docs
I accidentally posted this in the old general GAE group by mistake. : ( I need to allow my users to export into Word and Excel formats from my GAE app, and I know Apache POI is not supported. So, I'm trying to figure out how to avoid running a server elsewhere whose sole purpose is generating Word and Excel documents based on data in my GAE datastore. Google Docs seems like a good fit, so would it work to use the API to create documents there from my App Engine code and then export the created docs and pull them for storage in my App Engine datastore so that my users can download them whenever I want? Or do you foresee roadblocks to this, e.g. some sort of limit on the number of Google Docs my GAE app can create even if they're temporary files that are immediately deleted? --~--~-~--~~~---~--~~ 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: trouble with SDK 1.2.6
I just figured out the problem. I had added appengine-api-stubs.jar and appengine-local-runtime.jar to my project build path to support junit testing. Upgrading to the 1.2.6 versions only changed the error message, but removing them from the build path solved the problem. Now I just have to figure out how to configure things properly to support junit testing... Thanks. Vince 2009/10/23 Miguel Méndez mmen...@google.com: I'm going to check and see if I can reproduce this using your project. On Fri, Oct 23, 2009 at 2:06 PM, Vince Bonfanti vbonfa...@gmail.com wrote: I'm having no luck with SDK 1.2.6 within Eclipse 3.5.1 (Windows). Yes, I've added the -javaagent VM argument to my debug configuration. However, if I try to do almost anything at all within my ServletContextListener.contextInitialized() method I get this: 2009-10-23 17:48:59.192::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2009-10-23 17:48:59.526::INFO: jetty-6.1.x 2009-10-23 17:49:00.487::WARN: failed com.google.apphosting.utils.jetty.devappenginewebappcont...@429c19{/,C:\Users\vinceb\workspace\gaevfs\war} java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.agent.runtime.Runtime.clinit(Runtime.java:32) at com.newatlanta.appengine.servlet.GaeVfsServletEventListener.contextInitialized(GaeVfsServletEventListener.java:48) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:217) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:181) at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:116) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217) at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:162) at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48) at com.google.appengine.tools.development.DevAppServerMain.init(DevAppServerMain.java:113) at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89) Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.agent.AppEngineDevAgent at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 20 more 2009-10-23 17:49:00.489::WARN: failed jettycontainerservice$apiproxyhand...@116318b java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.agent.runtime.Runtime.clinit(Runtime.java:32) at com.newatlanta.appengine.servlet.GaeVfsServletEventListener.contextInitialized(GaeVfsServletEventListener.java:48) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:217) at
[appengine-java] Re: trouble with SDK 1.2.6
It looks like the Eclipse debug configuration automatically picks up the complete build path for the project as its classpath. Manually editing the debug configuration to remove appengine-api-stubs.jar and appengine-local-runtime.jar from the classpath fixes the problem. Vince On Fri, Oct 23, 2009 at 3:01 PM, Vince Bonfanti vbonfa...@gmail.com wrote: I just figured out the problem. I had added appengine-api-stubs.jar and appengine-local-runtime.jar to my project build path to support junit testing. Upgrading to the 1.2.6 versions only changed the error message, but removing them from the build path solved the problem. Now I just have to figure out how to configure things properly to support junit testing... Thanks. Vince 2009/10/23 Miguel Méndez mmen...@google.com: I'm going to check and see if I can reproduce this using your project. --~--~-~--~~~---~--~~ 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: Tutorial for datastore with low-level api?
Thanks Jason, I suspect this but I want to be sure. On Oct 23, 8:39 pm, Jason (Google) apija...@google.com wrote: Unlike JDO, where you do have to explicitly close every PersistenceManager in order to keep resources from leaking, any unneeded DatastoreService instances should be automatically cleaned up by the garbage collector without having to explicitly close it, etc. If you go through the Javadoc, you won't see any close method. - Jason On Thu, Oct 22, 2009 at 8:03 AM, iker98 ike...@gmail.com wrote: Jason, Is not necessary to release o close the DatastoreService when the datastore operations have finished? Thanks On Oct 19, 8:12 pm, Jason (Google) apija...@google.com wrote: Currently, most datastore examples use JDO, and the only official documentation available for the low-level API are the Javadocs that you linked to in your first post. It's a fairly straightforward API, however, so you shouldn't need too much training. Just get a reference to a DatastoreService instance and use it to get and retrieve Entity objects: DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); ... If you have any specific questions or find any descriptions confusing, please let me know and I'll be happy to work through these issues with you. - Jason On Thu, Oct 15, 2009 at 1:45 PM, Iqbal Yusuf Dipu iqbalyusufd...@gmail.comwrote: Hi, Is there any online reference material with some examples available for low-level api with datastore in Java without using JDO/JPA? The main app engine site has only reference to api doc for datastore. http://code.google.com/appengine/docs/java/javadoc/com/google/appengi. .. 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: SimpleDS: an alternative for Datastore persistence
I believe there are a lot of reasons and use cases not to go the JDO/ JPA way and look for a light weight solution. I came up with a similar idea like Nacho and created a simple class to persist Java objects using the low-level API. However I consider my code not being in a state yet for publising it. I also agree that this initiatives/ideas should not claim to be a replacement for JPA/JDO. It is simply an alternative. In the situation where I not even can write a file something as simple like a file might be attractive. Also it seems to me that JPA/JDO is tight to the relational model and the datastore is not. Java is not either. So going from Java to the relational model and the mapping back to a non-relational somehow seems to be odd. JPA/ JDO would be attractive to hide if there is a non-relational or relational store to a Java developer. Just provide the annotations/ configuration and do not care about the characteristics of the store. But looking at all the limitations I doubt that it will ever work like this. I am eager to follow this discussion and as you said: at the end we will benefit all from sharing thoughts and ideas how we can improve things. Jens --~--~-~--~~~---~--~~ 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 anyone provide me an example on add/remove tag to an Entity?
There isn't a large difference between using Category objects versus simple Strings. There is a semantic distinction -- a String doesn't necessarily have to represent a tag -- and Category objects may make it easier to add a restriction on accepted tag values when arbitrary tags aren't supported, but this can also be accomplished using Strings, so it's the semantic distinction more than anything. - Jason On Tue, Oct 20, 2009 at 8:09 PM, Max Zhu thebb...@gmail.com wrote: Hi Rusty, Thanks for your reply. I know that is a tag, but what I am looking for is how to implement using GAE. Hi Jason, I can not make my question more specific because I totally have no idea on it. :) Can I say we just simply put a SetCategory to an Entity? Then how can I make use of it when making a global search? Shall we iterate through every SetCategory? If that's the case, then what's the difference between SetCategory and SetString ? Regards, Max On Wed, Oct 21, 2009 at 1:23 AM, Jason (Google) apija...@google.comwrote: Hi Max. This is currently the only reference available: http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Category.html Do you have any specific questions around it? - Jason On Sat, Oct 17, 2009 at 10:02 AM, Max thebb...@gmail.com wrote: I am not able to find a good reference on: com.google.appengine.api.datastore.Category Thanks Max --~--~-~--~~~---~--~~ 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 Collection Load Issue
Hi Jeff. I'm having trouble reproducing this. I kept everything uncommented so the constructor adds a new object to each List/Set, then queried for the persisted Player2 object and inspected the size of each List/Set and saw 1 for each (expected). I then commented out foo1 and foo2 but left the Lists/Sets uncommented and saw the same result. There is a known issue where empty Lists (Lists which have been instantiated but don't have any objects in them) are returned as null. Does this sound like what you're running into when you leave the constructor commented out? - Jason On Thu, Oct 22, 2009 at 12:05 PM, jeffgnpc jeffg@gmail.com wrote: I am having an issue loading Collections after they have been stored in the datastore. I have simplified this issue down to a simple example listed below. If I run with the current comments, everything works fine, and the Collections are loaded. If I uncomment foo1 or foo2, the Collections no longer load (they are null). If I uncomment the constructor where I add values to the list, everything works fine again. @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Player2 { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) public Long key; //@Persistent //private Long foo1; //Cause Collection issue //@Persistent //private String foo2; //Causes Collection issue @Persistent private Key foo3; // This works @Persistent(defaultFetchGroup = true) private SetLong longSet = new HashSetLong(); @Persistent(defaultFetchGroup = true) private ListLong longList = new ArrayListLong(); @Persistent(defaultFetchGroup = true) private SetString stringSet = new HashSetString(); @Persistent(defaultFetchGroup = true) private ListString stringList = new LinkedListString(); @Persistent(defaultFetchGroup = true) private SetKey keySet = new HashSetKey(); @Persistent(defaultFetchGroup = true) private ListKey keyList = new LinkedListKey(); public Player2() { //Adding to the List Fixes Collection issue //longSet.add(1234l); //longList.add(1234l); //stringSet.add(1234l); //stringList.add(1234l); //keySet.add(KeyFactory.createKey(Player2.class.getSimpleName (), alfred.sm...@example.com)); //keyList.add(KeyFactory.createKey(Player2.class.getSimpleName (), alfred.sm...@example.com)); } } I believe this might be a similar issue to this thread: http://groups.google.com/group/google-appengine-java/browse_thread/thread/a44cb049f40d6bab/f9047e0a25e3453f?lnk=gstq=JDO+collection+null#f9047e0a25e3453f But when I run with in either of the successful ways, the Collections don't seem to be SCO fields. I will also post in that thread in case it helps with the ticket. Thanks, Jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-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 PrimaryKey class problems ... NPE in pre-comment key class is null
Hi Jason, I have looked into this somewhat, and I think there is a bug (or at least a naive assumption) in MetaDataValidator.validatePrimaryKey() around line: 331 private AbstractMemberMetaData validatePrimaryKey() { int[] pkPositions = acmd.getPKMemberPositions(); if (pkPositions == null) { throw new DatastoreMetaDataException(acmd, No primary key defined.); } if (pkPositions.length != 1) { throw new DatastoreMetaDataException(acmd, More than one primary key field.); } int pkPos = pkPositions[0]; AbstractMemberMetaData pkMemberMetaData = acmd.getMetaDataForManagedMemberAtAbsolutePosition(pkPos); Class? pkType = pkMemberMetaData.getType(); if (pkType.equals(Long.class)) { noParentAllowed = true; } else if (pkType.equals(String.class)) { if (!DatastoreManager.isEncodedPKField(acmd, pkPos)) { noParentAllowed = true; } else { // encoded string pk if (hasIdentityStrategy(IdentityStrategy.SEQUENCE, pkMemberMetaData)) { throw new DatastoreMetaDataException( acmd, pkMemberMetaData, IdentityStrategy SEQUENCE is not supported on encoded String primary keys.); } } } else if (pkType.equals(Key.class)) { if (hasIdentityStrategy(IdentityStrategy.SEQUENCE, pkMemberMetaData)) { throw new DatastoreMetaDataException( acmd, pkMemberMetaData, IdentityStrategy SEQUENCE is not supported on primary keys of type + Key.class.getName()); } } else { throw new DatastoreMetaDataException( acmd, pkMemberMetaData, Unsupported primary key type: + pkType.getName()); } return pkMemberMetaData; } this method assumes that there is a single PK field: if (pkPositions.length != 1) ... I think that what should really happen here is that each pk field should be validated/matched against the key objject id key class? let me know, I can file a bug, and perhaps even supply a fix ... On Oct 14, 2:53 pm, Jason (Google) apija...@google.com wrote: Can you go into more of what you're seeing? That definitely doesn't sound right. You have a kind which uses a String (or String-encoded key?) as its primary key, but you're not able to query for it? By runtime fails, does that mean you're seeing a stack trace? If so, can you share it? Is this fairly reproducible? How much time do you have to wait before it works and then stops working? - Jason On Wed, Oct 14, 2009 at 2:40 PM, Larry Cable larry.ca...@gmail.com wrote: Thanks Jason, I eventually discovered that by chance, that the PK class would work (mostly) with String types ... although I am now seeing even less explicable behavior where it appears that the runtime fails the 1st time I call it to query the PK class enabled entity but works subsequent times ... go figure! On Oct 14, 12:39 pm, Jason (Google) apija...@google.com wrote: App Engine's datastore, which is built on Bigtable, has a very particular format for keys -- the datastore is not a traditional RDBMS. As documented, Long, Key, and String are supported, and other objects will fail. http://code.google.com/appengine/docs/java/datastore/creatinggettinga... - Jason On Mon, Oct 12, 2009 at 10:06 PM, datanucleus andy_jeffer...@yahoo.com wrote: JDO allows you to have multiple PK fields, as does DataNucleus. GAE/J overrides this and prevents it.- Hide quoted text - - Show quoted text -- 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: receiving mail demo
I'm having the same issue Can someone please help me with this? On Oct 19, 12:44 pm, Prashant antsh...@gmail.com wrote: yes, every thing is working fine except that I am not able to fetch message body in suitable format. --~--~-~--~~~---~--~~ 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: trouble with SDK 1.2.6
Eplicitly add appengine-java-sdk-1.2.6\lib\agent\appengine-agent.jar to your java build path. On Oct 23, 11:06 am, Vince Bonfanti vbonfa...@gmail.com wrote: I'm having no luck with SDK 1.2.6 within Eclipse 3.5.1 (Windows). Yes, I've added the -javaagent VM argument to my debug configuration. However, if I try to do almost anything at all within my ServletContextListener.contextInitialized() method I get this: 2009-10-23 17:48:59.192::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2009-10-23 17:48:59.526::INFO: jetty-6.1.x 2009-10-23 17:49:00.487::WARN: failed com.google.apphosting.utils.jetty.devappenginewebappcont...@429c19{/,C:\Users\vinceb\workspace\gaevfs\war} java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.agent.runtime.Runtime.clinit(Runtime.java:32) at com.newatlanta.appengine.servlet.GaeVfsServletEventListener.contextInitialized(GaeVfsServletEventListener.java:48) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:217) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:181) at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:116) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217) at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:162) at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48) at com.google.appengine.tools.development.DevAppServerMain.init(DevAppServerMain.java:113) at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89) Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.agent.AppEngineDevAgent at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 20 more 2009-10-23 17:49:00.489::WARN: failed jettycontainerservice$apiproxyhand...@116318b java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.agent.runtime.Runtime.clinit(Runtime.java:32) at com.newatlanta.appengine.servlet.GaeVfsServletEventListener.contextInitialized(GaeVfsServletEventListener.java:48) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:217) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:181) at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:116) at
[appengine-java] Re: Casheing Static files
In case you have not yet found a solution here's one: http://www.armangal.com/How-to-create-a-simple-but-powerful-CDN-with-Google-App-Engine-%28GAE%29 On Oct 15, 1:30 am, emil reall...@gmail.com wrote: I did include the static files element. I followed the tutorial very closely. I will file a new issue. On Oct 14, 12:05 pm, Jason (Google) apija...@google.com wrote: Did you explicitly indicate that these files are static in your appengine-web.xml file? By default, all HTML, JS, and other static files are treated as both static and resource files by App Engine, but if you include the static-files element, you can change this:http://code.google.com/appengine/docs/java/config/appconfig.html#Stat... Let me know if this has an effect, and if not, I'll look into it further. You can also file a new issue in the public tracker: http://code.google.com/p/googleappengine/issues/list - Jason On Sun, Oct 11, 2009 at 1:46 PM, emil reall...@gmail.com wrote: I have been working on speeding up my app. After using the firebug's net console and the live headers plugin for Firefox, i realized that the static files are being downloaded with every new request. I increased the expiration date to one year, using the GWT recommendations (http://code.google.com/appengine/docs/java/ gettingstarted/staticfiles.html). The live headers started picking up the increased expiration date, but all requests are still coming back with 200 OK status, instead of the desired 304 Not Modified. In other words, my static files are being downloaded with every page refresh. I realized that the response headers do not include the Last-Modified tag. In addition, the request headers do not have the If-Modified- Since tag. My static files are not located in the WEB-INF/ and i get the same result even if their names include .cache. I am using the latest App Engine SDK (1.2.5) Below is a sample response tag for a static (jpg) file. -- HTTP/1.x 200 OK Date: Sun, 11 Oct 2009 20:21:02 GMT Expires: Mon, 11 Oct 2010 20:21:02 GMT Cache-Control: public, max-age=31536000 Content-Type: image/jpeg Server: Google Frontend Content-Length: 102207 X-XSS-Protection: 0 -- I checked some popular GWT apps, and they all had the same problem. I understand why aggressive caching is not enabled by default, but considering data limits and user experience, it is better if some files are not being constantly downloaded. Do you have any suggestions? --~--~-~--~~~---~--~~ 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: Error 500 - Loading data to memory during startup
Yeah, AppEngine drops your request after 30 seconds. My app takes 20 seconds to initialize in development, and half of the times it will finish loading within 30 seconds. Other times it goes pass 30 seconds and gets the same 500 error like yours. Google needs to make an exception for the initial cold boot timeout. On Oct 18, 1:57 pm, Joe Prasanna kumar joebi.m...@gmail.com wrote: Hi, I am working with my friend to build an app (hoogentia.appspot.com) which requires loading some learned model files to memory. I have a startup servlet that does this (loading model files to memory). Since it needs more mem, I run this app in dev mode with memory setting of -Xms1024m -Xmx2048m. I dont have any issues in development but when i deploy it to app engine and access my application, the startup servlet is invoked and it comes up with an Error 500. I am not getting any useful info from the logs. I am assuming the issue is with jvm settings for app engine in production. I looked at this thread (http://groups.google.com/group/google-appengine-java/browse_thread/th...) and modified appcfg.sh to java -Xmx2000m -cp $SDK_LIB/appengine-tools-api.jar \ com.google.appengine.tools.admin.AppCfg $* After doing an update, I still get the 500 Error. In dev mode, it takes like 80 seconds for the model to get loaded in memory. Any thoughts / help / suggestions greatly appreciated, thanks Joe. --~--~-~--~~~---~--~~ 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: Eclipse Plugin Update for App Engine SDK 1.2.7?
I think the 1.2.7 update is only for Python. The latest Java SDK is 1.2.6. On Fri, Oct 23, 2009 at 12:02 PM, hildenl louis.hil...@gmail.com wrote: Has anyone been able to update to 1.2.7 from Eclipse? I've got the http://dl.google.com/eclipse/plugin/3.5 configured as a software site and its enabled, but when I Check for Updates, 1.2.7 never shows up as an option and yet its been out since the 18th, --~--~-~--~~~---~--~~ 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: receiving mail demo
Same here. Started a few threads on it. No replies yet. Sent from my iPhone On Oct 23, 2009, at 11:04 AM, vs ven...@gmail.com wrote: I'm having the same issue Can someone please help me with this? On Oct 19, 12:44 pm, Prashant antsh...@gmail.com wrote: yes, every thing is working fine except that I am not able to fetch message body in suitable format. --~--~-~--~~~---~--~~ 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: primary key portability
Ok, thanks. That is helpful to know. leszek wrote: I ported my Open Source EJB3/JPA application to Google App Engine many months ago and almost at the beginning it was obvious that I had to split my entity classes to two versions: Google App Engine and non Google App Engine. Impossible to achieve 100% source compatibility. Primary key not compatible is only the one element of the whole story. http://hoteljavaopensource.blogspot.com/2009/09/migration-to-google-app-engine.html --~--~-~--~~~---~--~~ 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] datastore integration testing with spring
I've come up with a solution to my problems with data store integration tests. I don't know if this is a good solution; feedback is welcome. The problem, as much as my feeble brain can grasp, is that when Spring provides you with a PersistenceManager, you need to use transactions so that, at the appropriate time, the PersistenceManager's close() is called (by Spring). I'm assuming that in the previous, when I say transactions, I mean Spring's transactions; in my case Spring's @Transactional annotation. When I say Spring provides you with a PersistenceManager, in my case this means my DAO is subclassing JdoDaoSupport. If you don't have any transactions in your test code (including your DAO) I don't know when or if the PersistenceManager's close() is called. But you'll get errors about objects being managed by a different PersistenceManager so this doesn't seem to be an option. You'll also get errors with objects that had detachCopy() applied to them before they were returned. Some people use transactions in their DAOs. My understanding is that the transactions should be in the coarse grained methods (the service layer) and not in the fine grained methods (the DAO layer). If this doesn't sound right, have a look at the pdf available from http://apress.com/book/downloadfile/2625 Whether or not you could have your DAOs using transactions as well as your service layer classes, I don't know. If you use Spring's @Transactional annotation on your unit test's methods, that may work, but it won't if you're using a @Before method to add stuff to the data store to test with, which is what was biting me. At first I started thinking that I'd have to give up testing my DAOs and only test my service layer classes since they use @Transactional. But then it occurred to me that I could sort of achieve the same thing by wrapping all of my DAO methods in transactions *but only during testing*. So far this seems to work. My test class starts out as follows: @RunWith(SpringJUnit4ClassRunner.class) @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class }) @ContextConfiguration(locations = { classpath:spring/applicationContext.xml, classpath:spring/jdo-gae-context.xml, classpath:jdo-tx-test-context.xml }) public class FacilityDaoTest extends LocalDatastoreTestCase { private final transient Logger log = LoggerFactory.getLogger(getClass()); private final String facilityName = abc; @Autowired @Qualifier(jdo) private IFacilityDao facilityDao; final Facility[] facilities = new Facility[] { new Facility(Abc Facility, this.facilityName, false), new Facility(Def Facility, this.facilityName + -2, true), new Facility(ghi Facility, this.facilityName + -3, true), }; @Before public void insertFacilities() throws Exception { Assert.assertEquals(0, DatastoreServiceFactory .getDatastoreService() .prepare(new Query(Facility.class.getSimpleName())) .countEntities()); for (final Facility eachFacility : this.facilities) { this.facilityDao.makePersistent(eachFacility); this.log.debug(facility: {}, eachFacility); } Assert.assertEquals(this.facilities.length, DatastoreServiceFactory .getDatastoreService() .prepare(new Query(Facility.class.getSimpleName())) .countEntities()); } @Test public void findByName() { final Facility facility = this.facilityDao.findByName(this.facilityName); Assert.assertNotNull(facility should not be null, facility); } applicationContext.xml contains context:annotation-config / context:component-scan base-package=com.objecteffects.waitlist / jdo-gae-context.xml contains tx:annotation-driven transaction-manager=transactionManager / beans:bean id=dataNucleusJdoDialect class=org.datanucleus.springframework.DataNucleusJdoDialect / beans:bean id=transactionManager class=org.springframework.orm.jdo.JdoTransactionManager beans:property name=persistenceManagerFactory ref=persistenceManagerFactory / beans:property name=jdoDialect ref=dataNucleusJdoDialect / /beans:bean beans:bean id=persistenceManagerFactory class=org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean beans:property name=persistenceManagerFactoryName value=transactions-optional / /beans:bean And the trick is jdo-tx-test-context.xml, which creates an aop proxy to wrap the dao methods, and it contains tx:advice id=transactionAdvice transaction-manager=transactionManager tx:attributes tx:method name=find* read-only=true / tx:method
[appengine-java] Runtime Exceptions
I read a lot about failures and timeouts from the datastore, but I can't find any documentation and of course the development environment doesn't simulate them. Has anybody compiled a list of the various error states and exceptions that we need to code for? --~--~-~--~~~---~--~~ 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] Exception while trying to run app
Hie Today when i tried to run my GAE app in eclipse i see below exceptions. i am on 1.27 and saw these exceptions fro the first time. last time when i used all this was working fine. java.lang.RuntimeException: Unable to locate the App Engine agent. Please use dev_appserver, KickStart, or set the jvm flag: -javaagent:sdk_root/lib/agent/appengine-agent.jar at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:102) at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:77) at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:38) at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:153) at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48) at com.google.appengine.tools.development.DevAppServerMain.init(DevAppServerMain.java:113) at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89) Caused by: java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:98) ... 6 more Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.agent.AppEngineDevAgent at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 7 more Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.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 -~--~~~~--~~--~--~---