[appengine-java] Create different entity (Database) for each user.
Hi, How to create an application which can share with many companies (multitenancy) with each company has their own database ie if 'Company A' logins they can see his data only. I want to use a single code base and use difference data stores for each user. How can this be done using Google Appengine datastore? For example In HR Application, user(Company) can see their own employees that means if a user adds a contact or employee which he only can see. . Thanks in advance gopal --~--~-~--~~~---~--~~ 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] Regarding Error in Jsp Code
hi i have developed a sample application by following apps given in appengine sdk demos sample apps and when i send a request from browser to that application then iam getting the following error on jsp page HTTP ERROR: 500 Unable to compile class for JSP Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: 'catch' without 'try' [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ')' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: not a statement [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ';' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 165: 'finally' without 'try' [javac] } finally { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 35: 'try' without 'catch' or 'finally' [javac] try { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 169: reached end of file while parsing [javac] } [javac] ^ [javac] 7 errors RequestURI=/ex.jsp Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: 'catch' without 'try' [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ')' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: not a statement [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ';' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 165: 'finally' without 'try' [javac] } finally { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 35: 'try' without 'catch' or 'finally' [javac] try { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 169: reached end of file while parsing [javac] } [javac] ^ [javac] 7 errors at org.apache.jasper.compiler.DefaultErrorHandler.javacError (DefaultErrorHandler.java:84) at org.apache.jasper.compiler.ErrorDispatcher.javacError (ErrorDispatcher.java:332) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java: 412) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile (JspCompilationContext.java:511) at org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at com.google.appengine.tools.development.PrivilegedJspServlet.access $101(PrivilegedJspServlet.java:23) at com.google.appengine.tools.development.PrivilegedJspServlet$2.run (PrivilegedJspServlet.java:59) at java.security.AccessController.doPrivileged(Native Method) at com.google.appengine.tools.development.PrivilegedJspServlet.service (PrivilegedJspServlet.java:57) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at
[appengine-java] Re: One-to-many relationships and saving
- When using the 1-n example from the docs I get lots of problems when trying to remove an item from the child list. Is it supported when using datanucleus to modify the list of children (remove+add) in the same transaction or is only add supported? In DataNucleus-provided datastore plugins you can do List.add/remove/ whatever in the same txn. In the datanucleus-google plugin (provided by Google) I've no idea --~--~-~--~~~---~--~~ 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't deploy my first guestbook application
Exactly the same problem here. I don't even have javac file anywhere - only javacpl and javacpl.cpl. On 12 сен, 15:10, yellowblood yellowbl...@gmail.com wrote: I followed the tutorial perfectly, yet I can't seem to deploy my application. At first, the deployment failed because it didn't find the javac file, so I copied it. I also Following some instructions I found, I edited the appcfg.cmd so it points now to the real javac location (in C:\Program Files\Java \jdk1.6.0_16\bin), and I also copied a file called tools.jar to the app-engine SDK. I'mrunningWindows XP, and using Esclipe + Java App Engine + App Engine Plugin. Googled for hours and nothing. Thanks. Creating staging directory Scanning for jsp files. Compiling jsp files. Compiling java files. com.google.appengine.tools.admin.JspCompilationException: Failed to compile the generated JSP java files. 12/09/2009 14:01:21 org.apache.jasper.JspC processFile INFO: Built File: \guestbook.jsp java.lang.NoClassDefFoundError: com/sun/tools/javac/Main Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Exception in thread main Could not find the main class: com.sun.tools.javac.Main. Program will exit.Errorwhile executing: C:\Program Files\Java\jre6\bin\javac.exe- classpath /C:/Program Files/Eclipse/plugins/ com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/appengine- java-sdk-1.2.5/lib/impl/appengine-api-labs.jar;/C:/Program Files/ Eclipse/plugins/ com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/appengine- java-sdk-1.2.5/lib/impl/appengine-api-stubs.jar;/C:/Program Files/ Eclipse/plugins/ com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/appengine- java-sdk-1.2.5/lib/impl/appengine-api.jar;/C:/Program Files/Eclipse/ plugins/com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/ appengine-java-sdk-1.2.5/lib/impl/appengine-local-runtime.jar;C: \Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\appengine-local-runtime-shared.jar;C: \Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\geronimo-el_1.0_spec-1.0.1.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\geronimo-jsp_2.1_spec-1.0.1.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\geronimo-servlet_2.5_spec-1.2.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-ant-1.6.5.jar;C: \Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-ant- launcher-1.6.5.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-commons- el-1.0.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-commons- logging-1.1.1.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-jasper-compiler-5.0.28.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-jasper- runtime-5.0.28.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\classes;C:\DOCUME~1\yb \LOCALS~1\Temp\appcfg5145010290416497529.tmp\WEB-INF\lib\appengine- api-1.0-sdk-1.2.5.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\appengine-api- labs-1.2.5.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\datanucleus- appengine-1.0.3.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\datanucleus- core-1.1.5.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\datanucleus-jpa-1.1.5.jar;C: \DOCUME~1\yb\LOCALS~1\Temp\appcfg5145010290416497529.tmp\WEB-INF\lib \geronimo-jpa_3.0_spec-1.1.1.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\geronimo- jta_1.1_spec-1.1.1.jar;C:\DOCUME~1\yb\LOCALS~1\Temp
[appengine-java] Re: Regarding Error in Jsp Code
Hi, dunno if this helps, but... % if(entries.isEmpty()) { % div class=noEntries No Entries /div In the code above, from the JSP file, the line div class=noEntries is missing a Might help. Ric --~--~-~--~~~---~--~~ 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 hook called before id is assigned?
I've created an issue for this problem (http://code.google.com/p/ googleappengine/issues/detail?id=2121). Is seems that only makePersistentAll is affected. On Sep 13, 8:31 pm, bysse erik.byst...@gmail.com wrote: More specifically that id isn't set when StoreLifecycleListener.postStore is called On Sep 13, 3:25 pm, bysse erik.byst...@gmail.com wrote: Hi, I'm trying to use Compass on appengine and everything works fine as long as i assign id to my entities manually. If i let appengine assign id to my entities it doesn't work. It seems like the JDO hooks used by Compass is called before an id is set on the entity. Does anyone have any input on this? 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: GAE takes 28 sec to read just 200 records
hie Can anyone please guide on this? Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Fri, Sep 11, 2009 at 10:24 PM, Vik vik@gmail.com wrote: hie any updates please on this Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Tue, Sep 8, 2009 at 7:33 PM, Vik vik@gmail.com wrote: hie any updates on this please? Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Sat, Sep 5, 2009 at 8:07 PM, Vik vik@gmail.com wrote: Hie yeah I did that.. and what I get are two different values from this block At first time of app startup vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in com.google.apphosting.runtime.security.userclassloa...@1f7cdc7 and in another flow vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in com.google.apphosting.runtime.security.userclassloa...@1e6f0ef So, it means it is trying to load it in two different class loaders. So, how should I fix it? Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Sat, Sep 5, 2009 at 5:14 AM, Jason (Google) apija...@google.comwrote: Based on one of your recent posts, it seems like multiple PersistenceManagerFactory instances are being created by different classloaders. Since this is an expensive operation, this could explain why you're experiencing such slow performance. Did you follow Toby's suggestion in the last post? - 1) Are you maybe loading that singleton class in different classloaders? Try logging the classloader object reference that tries to create the PersistenceManagerFactory. You can add a static initializer ABOVE pmfInstance. static { logger.log(Level.SEVERE, Loading PMF in + PMF.class.getClassLoader()); } - - Jason On Thu, Sep 3, 2009 at 10:03 AM, Vik vik@gmail.com wrote: Hie Strange to hear that if it is creating PMF again Should it do it just once when i logged in? In the logging process I do get an instance of PMF. So, why it is doing that again? Any advise what may be going wrong here? Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Thu, Sep 3, 2009 at 10:25 PM, datanucleus andy_jeffer...@yahoo.com wrote: 17. I09-03 09:46AM 31.994 vik.sakshum.sakshumweb.jsp.model.jdo.PMF clinit: Loading PMF in com.google.apphosting.runtime.security.userclassloa...@8fcc7b 18. I09-03 09:46AM 41.622 Don't you think it's a strange way to benchmark things by including known one-off operations like creating a PMF ? Personally that ought to be included in application startup timings, rather than time taken to read 200 records. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
Re: [giannim] [appengine-java] Can't deploy my first guestbook application
On Sat, Sep 12, 2009 at 9:10 PM, yellowblood yellowbl...@gmail.com wrote: I followed the tutorial perfectly, yet I can't seem to deploy my application. At first, the deployment failed because it didn't find the javac file, so I copied it. Copying javac.exe will almost certainly cause more trouble that solve it. javac will need some jars as well. It's best to point your PATH directly to the SDK bin dir or even change the appcfg.cmd to point to the javac.exe within the installed location diectly. It's likely that javac on Windows peeks into the Windows registry to find the rest of the SDK installation so it's best to use the javac from the location that it is installed. ... I also Following some instructions I found, I edited the appcfg.cmd so it points now to the real javac location (in C:\Program Files\Java \jdk1.6.0_16\bin), and I also copied a file called tools.jar to the app-engine SDK. I'm running Windows XP, and using Esclipe + Java App Engine + App Engine Plugin. Googled for hours and nothing. Thanks. Creating staging directory Scanning for jsp files. Compiling jsp files. Compiling java files. com.google.appengine.tools.admin.JspCompilationException: Failed to compile the generated JSP java files. 12/09/2009 14:01:21 org.apache.jasper.JspC processFile INFO: Built File: \guestbook.jsp java.lang.NoClassDefFoundError: com/sun/tools/javac/Main Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Exception in thread main Could not find the main class: com.sun.tools.javac.Main. Program will exit. Error while executing: C:\Program Files\Java\jre6\bin\javac.exe - classpath /C:/Program Files/Eclipse/plugins/ com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/appengine- java-sdk-1.2.5/lib/impl/appengine-api-labs.jar;/C:/Program Files/ Eclipse/plugins/ com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/appengine- java-sdk-1.2.5/lib/impl/appengine-api-stubs.jar;/C:/Program Files/ Eclipse/plugins/ com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/appengine- java-sdk-1.2.5/lib/impl/appengine-api.jar;/C:/Program Files/Eclipse/ plugins/com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031/ appengine-java-sdk-1.2.5/lib/impl/appengine-local-runtime.jar;C: \Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\appengine-local-runtime-shared.jar;C: \Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\geronimo-el_1.0_spec-1.0.1.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\geronimo-jsp_2.1_spec-1.0.1.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\geronimo-servlet_2.5_spec-1.2.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-ant-1.6.5.jar;C: \Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-ant- launcher-1.6.5.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-commons- el-1.0.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-commons- logging-1.1.1.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-jasper- compiler-5.0.28.jar;C:\Program Files\Eclipse\plugins \com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine- java-sdk-1.2.5\lib\shared\jsp\repackaged-appengine-jasper- runtime-5.0.28.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\classes;C:\DOCUME~1\yb \LOCALS~1\Temp\appcfg5145010290416497529.tmp\WEB-INF\lib\appengine- api-1.0-sdk-1.2.5.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\appengine-api- labs-1.2.5.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\datanucleus- appengine-1.0.3.jar;C:\DOCUME~1\yb\LOCALS~1\Temp \appcfg5145010290416497529.tmp\WEB-INF\lib\datanucleus-
[appengine-java] Regarding error 500
hi i am working with a sample application in gooleappengine and when iam sending a request to application through the browser iam getting the following error HTTP ERROR: 500 Must set a body RequestURI=/helloxmpp1 Caused by: java.lang.IllegalArgumentException: Must set a body at com.google.appengine.api.xmpp.MessageBuilder.build (MessageBuilder.java:54) at com.google.appengine.demos.HelloXmpp1Servlet.doGet (HelloXmpp1Servlet.java:41) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 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.utils.servlet.TransactionCleanupFilter.doFilter (TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1084) at com.google.appengine.tools.development.StaticFileFilter.doFilter (StaticFileFilter.java:121) 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.utils.jetty.DevAppEngineWebAppContext.handle (DevAppEngineWebAppContext.java:54) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139) at com.google.appengine.tools.development.JettyContainerService $ApiProxyHandler.handle(JettyContainerService.java:313) 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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at org.mortbay.io.nio.SelectChannelEndPoint.run (SelectChannelEndPoint.java:396) at org.mortbay.thread.BoundedThreadPool$PoolThread.run (BoundedThreadPool.java:442) Powered by Jetty:// actually class and xml file which i have written for my application are as follows: java class: // Copyright 2008 Google Inc. All rights reserved. package com.google.appengine.demos; import com.google.appengine.api.xmpp.JID; import com.google.appengine.api.xmpp.Message; import com.google.appengine.api.xmpp.MessageBuilder; import com.google.appengine.api.xmpp.MessageType; import com.google.appengine.api.xmpp.Presence; import com.google.appengine.api.xmpp.SendResponse; import com.google.appengine.api.xmpp.XMPPService; import com.google.appengine.api.xmpp.XMPPServiceFactory; import java.io.IOException; import java.util.Map; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * HelloXmpp is an echo bot that sends back the message it receives. */ public class HelloXmpp1Servlet extends HttpServlet { private XMPPService xmppService; @Override public void init() { this.xmppService = XMPPServiceFactory.getXMPPService(); } // For testing. Real requests are POST public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { Message message =new MessageBuilder() .withMessageType(MessageType.CHAT) .withFromJid(new JID(req.getParameter(from))) .withRecipientJids(new JID(req.getParameter(to))) .withBody(req.getParameter(body)) .build(); processMessage(message, res); } public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException { processMessage(xmppService.parseMessage(req), res); } public void processMessage(Message message, HttpServletResponse res) throws IOException { JID fromId = message.getFromJid(); Presence presence = xmppService.getPresence(fromId); String presenceString = presence.isAvailable() ? : not ; SendResponse response = xmppService.sendMessage( new MessageBuilder(). withBody(message.getBody() + (you are + presenceString + available)). withRecipientJids(fromId). build()); for (Map.EntryJID, SendResponse.Status entry : response.getStatusMap().entrySet()) { res.getWriter().println(entry.getKey() + , + entry.getValue() + br); }
[appengine-java] Re: Create different entity (Database) for each user.
Hi Gopal, I do not know how you have arranged your entities in your datastore, but using your example you could add a User field to your other persistent entities. For example, using JDO annotations (which I use), you could add the field @Persistent private User userCompany; You could add the other end of a two-way relationship to User like: @Persistent(mappedBy=userCompany) @Order(extensions = @Extension(vendorName=datanucleus, key=list- ordering, value=[Field name] ASC)) private List[Class] liUserDetails; to access the rows belonging to a User and no other User. Just a thought Ian Marshall --~--~-~--~~~---~--~~ 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: Many to Many
Hello there, Doesn't the section Java | Storing Data | Relationships | Unowned Relationships | Many-to-Many Relationships in the GAE documentation explain how to do it? (I must admit I have not done this myself so I cannot give you a working example!) --~--~-~--~~~---~--~~ 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: Datastore Limits
What do you mean by times out? Do you mean you hit the 30 second deadline? On Sep 14, 3:59 am, hg hgo...@gmail.com wrote: Hi, I am writing a script that is supposed to run quite a few inserts to the datastore - up to a couple of hundred. My script keeps timing out at 92. After I ran it a few times this evening, it wiped out my entire datastore! I did some research and came across the following error documentation: for the DatastoreTimeoutException DatastoreTimeoutException is thrown when a datastore operation times out. This can happen when you attempt to put, get, or delete too many entities or an entity with too many properties, or if the datastore is overloaded or having trouble. I was not getting this error, but it does seem to have some bearing on this case. What are the limit on entity 'putting' for a script? Any suggestions would be appreciated. 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: Can I avoid Data Nucleus and still use JPA?
Hibernate is not JPA implementation, it exposes its own API. Hibernate Entity Manager is a product build on standard Hibernate and offering full JPA interface. Google App Engine does not support Hibernate: http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine - Hibernate Versions: All Status: INCOMPATIBLE * You cannot currently use Hibernate directly. The differences between the App Engine datastore and SQL were too great to get the standard Hibernate up and running under App Engine. App Engine does support JDO and JPA, so you may be able to convert your Hibernate code to use one of these ORM interfaces. - --~--~-~--~~~---~--~~ 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: Regarding Error in Jsp Code
have you configured 'JRE System Library' to JDK ? if not have look at this http://groups.google.com/group/google-appengine-java/browse_thread/thread/2a4be3c1d4a0feed/1d55c317e54fa985?lnk=gstq=jsp#1d55c317e54fa985 --~--~-~--~~~---~--~~ 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: Create different entity (Database) for each user.
Look at this thread, may provide some useful information. http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/6ae2e6737cbb4b40/f47f015099538467?lnk=gstq=administrator#f47f015099538467 --~--~-~--~~~---~--~~ 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: Accessing Memcache in more than one servlet
For above Memcache question, I simply implemented a javax.cache.Cache singleton pattern. I now have access to the cache from more than one servlet. Is anyone aware that this implementation might problematic in the Google App Engine distributed(cloud) runtime? Thanks, Jeff On Sep 11, 2:45 pm, Jeff jeffarba...@gmail.com wrote: Hello, I plan on using Google App Engine'sMemcacheservice. I've read the online documentation and looked at a demo example. With both, theMemcacheCache instance is an instance variable within a servlet. If I use more than one servlet, but want to access the same cache, how is that done? Am I to use GCacheFactory.NAMESPACE property when I createCache(property)? Will this namespace allow me to access the same cache across servlets? 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: Cant deploy application
Hi Ravi, Check out http://code.google.com/appengine/docs/java/tools/eclipse.html jason On Sat, Sep 12, 2009 at 8:36 AM, Ravi Mandliya funkyr...@gmail.com wrote: I have a web project build in eclipse.. I have installed google plugin.. But I cant deploy it, as I dont have configuration file which carries application ID for google etc How to deploy it.. can some one give me link to tutorial? I tried to create a new project, but it does not add a servlet, the way I add in normal eclipse --~--~-~--~~~---~--~~ 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: Cant deploy application
Sorry posted too early. Looks like this tutorial is outdated (refers to appengine-web.xml, which I think you are saying you do not have?) When you go to deploy, you'll see a link to your project properties in the bottom of the deploy dialog (which normally asks for your username and password). Click on this, and you can enter the appengine application ID on the following properties page. jason On Mon, Sep 14, 2009 at 10:25 AM, Jason Parekh jasonpar...@gmail.comwrote: Hi Ravi, Check out http://code.google.com/appengine/docs/java/tools/eclipse.html jason On Sat, Sep 12, 2009 at 8:36 AM, Ravi Mandliya funkyr...@gmail.comwrote: I have a web project build in eclipse.. I have installed google plugin.. But I cant deploy it, as I dont have configuration file which carries application ID for google etc How to deploy it.. can some one give me link to tutorial? I tried to create a new project, but it does not add a servlet, the way I add in normal eclipse --~--~-~--~~~---~--~~ 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: Cant deploy application
Also, the docs from the Eclipse plugin will be helpful: http://code.google.com/eclipse/docs/appengine_deploy.html and http://code.google.com/eclipse/docs/appengine_appid_version.html jason On Mon, Sep 14, 2009 at 10:28 AM, Jason Parekh jasonpar...@gmail.comwrote: Sorry posted too early. Looks like this tutorial is outdated (refers to appengine-web.xml, which I think you are saying you do not have?) When you go to deploy, you'll see a link to your project properties in the bottom of the deploy dialog (which normally asks for your username and password). Click on this, and you can enter the appengine application ID on the following properties page. jason On Mon, Sep 14, 2009 at 10:25 AM, Jason Parekh jasonpar...@gmail.comwrote: Hi Ravi, Check out http://code.google.com/appengine/docs/java/tools/eclipse.html jason On Sat, Sep 12, 2009 at 8:36 AM, Ravi Mandliya funkyr...@gmail.comwrote: I have a web project build in eclipse.. I have installed google plugin.. But I cant deploy it, as I dont have configuration file which carries application ID for google etc How to deploy it.. can some one give me link to tutorial? I tried to create a new project, but it does not add a servlet, the way I add in normal eclipse --~--~-~--~~~---~--~~ 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: Accessing Memcache in more than one servlet
No, that sounds like a fine approach. You could even create multiple Cache instances and they would still be backed by the same underlying store (assuming they have the same namespace). On Mon, Sep 14, 2009 at 9:18 AM, Jeff jeffarba...@gmail.com wrote: For above Memcache question, I simply implemented a javax.cache.Cache singleton pattern. I now have access to the cache from more than one servlet. Is anyone aware that this implementation might problematic in the Google App Engine distributed(cloud) runtime? Thanks, Jeff On Sep 11, 2:45 pm, Jeff jeffarba...@gmail.com wrote: Hello, I plan on using Google App Engine'sMemcacheservice. I've read the online documentation and looked at a demo example. With both, theMemcacheCache instance is an instance variable within a servlet. If I use more than one servlet, but want to access the same cache, how is that done? Am I to use GCacheFactory.NAMESPACE property when I createCache(property)? Will this namespace allow me to access the same cache across servlets? 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: Regarding Error in Jsp Code
* } ** }* /table /div /div /body /html You need to surround the ending curly-braces with % and %, like so: % * } **}* *% * /table /div /div /body /html On Mon, Sep 14, 2009 at 7:04 AM, anu anunimmala.nimm...@gmail.com wrote: hi i have developed a sample application by following apps given in appengine sdk demos sample apps and when i send a request from browser to that application then iam getting the following error on jsp page HTTP ERROR: 500 Unable to compile class for JSP Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: 'catch' without 'try' [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ')' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: not a statement [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ';' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 165: 'finally' without 'try' [javac] } finally { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 35: 'try' without 'catch' or 'finally' [javac] try { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 169: reached end of file while parsing [javac] } [javac] ^ [javac] 7 errors RequestURI=/ex.jsp Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: 'catch' without 'try' [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ')' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: not a statement [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 158: ';' expected [javac] } catch (Throwable t) { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 165: 'finally' without 'try' [javac] } finally { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 35: 'try' without 'catch' or 'finally' [javac] try { [javac] ^ Generated servlet error: [javac] C:\Users\DEVELO~1.ADM\AppData\Local\Temp \Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java: 169: reached end of file while parsing [javac] } [javac] ^ [javac] 7 errors at org.apache.jasper.compiler.DefaultErrorHandler.javacError (DefaultErrorHandler.java:84) at org.apache.jasper.compiler.ErrorDispatcher.javacError (ErrorDispatcher.java:332) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java: 412) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile (JspCompilationContext.java:511) at org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at com.google.appengine.tools.development.PrivilegedJspServlet.access $101(PrivilegedJspServlet.java:23) at
[appengine-java] Re: Issue on using Spring MVC framework on GAE.
Running into the same problem here using both the bean definition and overriding the initBinder method on the SimpleFormController. Any other insight into this issue? On Sep 11, 3:13 pm, Jason (Google) apija...@google.com wrote: If you're subclassing SimpleFormController, you can also override the initBinder method in your custom classes directly. e.g.: @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(String.class, new StringTrimmerEditor(false)); binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(false)); binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, true)); } - Jason On Thu, Sep 10, 2009 at 5:00 AM, xueqiang.mi allo...@gmail.com wrote: Thanks. The problem I encountered is caused by the Spring form tag, I have fixed it. If you want to use form tag, you must override the initBinder method of WebBindingInitializer, otherwise you will get a error: org.springframework.web.servlet.tags.RequestContextAwareTag doStartTag: access denied (java.lang.RuntimePermission getClassLoader) java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader) .. Nested in org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ClassCastException: java.security.AccessControlException cannot be cast to javax.servlet.ServletException: java.lang.ClassCastException: java.security.AccessControlException cannot be cast to javax.servlet.ServletException You should write your own WebBindingInitializer class {code} public class TheFocusBindingInitializer implements WebBindingInitializer { �...@override public void initBinder(WebDataBinder binder, WebRequest request) { binder.registerCustomEditor(String.class, new StringTrimmerEditor(false)); } } {code} and then inject it into the AnnotationMethodHandlerAdapter by the following configuration: {xml} bean class=org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter property name=webBindingInitializer bean class=com.appspot.thefocus.web.TheFocusBindingInitializer / /property /bean {xml} On 9月10日, 下午4时13分, Loïc Talbot loic.tal...@gmail.com wrote: Hi, I've tried successfully spring mvc with this tutorial (Flex, graniteDS, springMVC) : http://graniteds.blogspot.com/2009/04/graniteds-20-on-google-app-engi... Moreover Spring MVC is compatible with GAE according to this : http://groups.google.com/group/google-appengine-java/web/will-it-play... You should find a more verbose and meaningful error in the console log underhttps://appengine.google.com/ The stack trace should be there. Loïc 2009/9/10 xueqiang.mi allo...@gmail.com Have anyone used Spring MVC framework on GAE? My project runs well on my pc, but after uploading on the GAE server, it doesn't work. A error comes out: Error: Server Error The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the query that caused it. http://alloyer.appspot.com Can anyone help me here? --~--~-~--~~~---~--~~ 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 Security Error
Thanks for the reply... Can u please elaborate How JDBC request can be pushed to another server I have an event coming up so I have to upload the site in urgency. any help would be appreciated. On Sep 14, 2:25 am, Gianni Mariani gian...@google.com wrote: App Engine does not allow access to JDBC. You must either use the App Engine Datastore or push you JDBC requests to another server using the UrlFetch service (perhaps using SDC). On Sun, Sep 13, 2009 at 2:14 AM, Ravi Mandliya funkyr...@gmail.com wrote: Hello everyone I just uploaded my first application, its running, and seems to be working fine, but there is a problem, I get the following error when onblur() on the textbox is activated, I have applied ajax which fetches the data from Database(IBM DB2). It generates the following error: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.io) Full error code is following: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.google.appengine.tools.development.DevAppServerFactory $CustomSecurityManager.checkPermission(DevAppServerFactory.java:139) at java.lang.SecurityManager.checkPackageAccess(Unknown Source) at org.apache.jasper.servlet.JasperLoader.loadClass (JasperLoader.java: 117) at org.apache.jasper.servlet.JasperLoader.loadClass (JasperLoader.java: 69) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at java.sql.DriverManager.getCallerClass(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.apache.jsp.validate_jsp._jspService(validate_jsp.java: 65) at org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java: 806) at org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service (JspServlet.java:236) at com.google.appengine.tools.development.PrivilegedJspServlet.access $101(PrivilegedJspServlet.java:23) at com.google.appengine.tools.development.PrivilegedJspServlet $2.run (PrivilegedJspServlet.java:59) at java.security.AccessController.doPrivileged(Native Method) at com.google.appengine.tools.development.PrivilegedJspServlet.service (PrivilegedJspServlet.java:57) 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.utils.servlet.TransactionCleanupFilter.doFilter (TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter (ServletHandler.java:1084) at com.google.appengine.tools.development.StaticFileFilter.doFilter (StaticFileFilter.java:121) 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.utils.jetty.DevAppEngineWebAppContext.handle (DevAppEngineWebAppContext.java:54) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139) at com.google.appengine.tools.development.JettyContainerService $ApiProxyHandler.handle(JettyContainerService.java:313) 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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java: 514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 211)
[appengine-java] compositing images not implemented?
On the image service overview page (http://code.google.com/appengine/ docs/java/images/overview.html), you say It can also composite multiple images into a single image. So I put a bunch of work into something that depends on compositing images and I get to actually compositing the image and I see the ImageService.composite method (http://code.google.com/appengine/docs/ java/javadoc/com/google/appengine/api/images/ImagesService.html) which looks great. But then I dig into Composite (http://code.google.com/appengine/docs/ java/javadoc/com/google/appengine/api/images/Composite.html) and it's an empty shell. Am I missing something? Did this fall through the cracks? If so, approximately when will this get implemented? --~--~-~--~~~---~--~~ 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: Many to Many
Right, I'd read the docs like Ian mentioned. The big caveat as with anything in GAE is that the queries you intend to perform will drive your model. There's more than one way to model a many to many, so you need to make sure that the model you choose supports the queries you need. On Sep 14, 7:06 am, Anita an...@ensarm.com wrote: Hi, Can any one provide me with a good example of unowned many-many relationship with jdo. I refered to the doc but could not find any good example to relate to .. --~--~-~--~~~---~--~~ 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: Datastore Limits
read this thread ... you might want to batch the writes you should get around 200-300 objects per write (under the 5 sec timeout) and probably around 2k per request before hitting the 30sec request timeout (all depends on the complexity of your objects) On Sep 14, 5:54 am, Iain iain.robe...@gmail.com wrote: What do you mean by times out? Do you mean you hit the 30 second deadline? On Sep 14, 3:59 am, hg hgo...@gmail.com wrote: Hi, I am writing a script that is supposed to run quite a few inserts to the datastore - up to a couple of hundred. My script keeps timing out at 92. After I ran it a few times this evening, it wiped out my entire datastore! I did some research and came across the following error documentation: for the DatastoreTimeoutException DatastoreTimeoutException is thrown when a datastore operation times out. This can happen when you attempt to put, get, or delete too many entities or an entity with too many properties, or if the datastore is overloaded or having trouble. I was not getting this error, but it does seem to have some bearing on this case. What are the limit on entity 'putting' for a script? Any suggestions would be appreciated. Thanks!- 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: Warning message about junit plugin from datanucleus in my logs when running Junit tests
Hi, Another way to handle this would be to create a separate logging.properties file, and then add the following to your launch configuration: -Djava.util.logging.config.file=/path/to/test/logging.properties ... This would be cleaner than modifying your code. Rajeev On Tue, Sep 8, 2009 at 7:24 PM, Erem ehb...@gmail.com wrote: The root problem unsurprisingly turns out to be logging configuration. Stop this from happening by setting the following DataNucleus loggers PRIOR to your JDOHelper.getPersistenceManagerFactory() calls: //This one caused all the WARNING and SEVERE logs about eclipse UI elements Logger.getLogger(DataNucleus.Plugin).setLevel(Level.OFF); //This one logged the last couple INFOs about Persistence configuration Logger.getLogger(DataNucleus.Persistence).setLevel(Level.WARNING); As it doesn't seem even the WARNINGs or SEVEREs affect test outcomes, this seems like a perfectly fine way to do it. On Sep 8, 3:40 pm, Erem ehb...@gmail.com wrote: I just found out that it all gets spammed as a response to JDOHelper.getPersistenceManagerFactory(). It only happens when running the Local Service implementation as specified on the AppEngine wiki On Sep 8, 3:34 pm, Erem ehb...@gmail.com wrote: Hi Rajeev, Thanks for the response! It's a normal JUnit launch config. There are only 2 classpath entries in my launch config: --- v Bootstrap Entries JRE System Library [jre1.6.0_15 - 32-bit[ v User Entries MyProject (default classpath) I still can't figure it out how to shut these logs up =/ On Aug 31, 11:52 am, Rajeev Dayal rda...@google.com wrote: Hi, Is this a normal JUnit Launch Configuration, or is there a special plugin that you're using? Can you navigate to the launch configuration's classpath tab and list out the entries? Thanks, Rajeev On Wed, Aug 26, 2009 at 4:58 PM, Amendmen7 ehb...@gmail.com wrote: I'm having the same issues. I have tried turning off all known loggers in the setUp methods of my LocalDatastoreTestCase superclass, but it has no effect re: this logspam! Has anyone found an answer? On Aug 5, 8:41 am, Stephan stephanv...@gmail.com wrote: I'm having the same problem here. Using a fresh eclipse install and a simple test-application, I get the same messages. They only appear when I use JDO in my unit tests. Except for the error log messages, everything seems to work fine. But starting each unit-test with more then 30 warnings and errors doesn't seem like a clean way to test an application. Did you find a solution yet? I'd think there would be a much larger group with the same problem, or isn't anyone unit-testing here? :) On 27 jun, 15:57, Peter Recore peterrec...@gmail.com wrote: I have a warning message showing up in my logs when I run my unit tests in Eclipse, using the junit plugin. I have the google plugin installed. The messages seem to be coming from the DataNucleus logger. Here is one line. There are about 30 more all referencing different extension points. Jun 27, 2009 8:42:40 AM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions WARNING: Extension Point org.eclipse.ui.views not registered, but plugin org.eclipse.jdt.junit defined in file:/C:/Documents%20and %20Settings/peter/Desktop/eclipse/configuration/org.eclipse.osgi/ bundles/307/1/.cp/META-INF/MANIFEST.MF refers to it. Then there are some that look like this: Jun 27, 2009 8:42:40 AM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints SEVERE: Bundle org.eclipse.jdt.junit4.runtime requires org.junit4 but it cannot be resolved. I'm hoping someone can give me a hint as to whether this is an eclipse issue, a junit issue, a datanucleus issue, or something else. 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: Get Multipart Data from the request
+1 On Sep 13, 6:18 am, Philippe Marschall philippe.marsch...@gmail.com wrote: On Jul 22, 7:41 pm, Jason (Google) apija...@google.com wrote: As indicated in the Will it play in App Engine page, you will not be able to use the traditional Apache Commons FileUpload API since it relies on java.io.File which is not a supported class. App Engine does not allow applications to write to the file system, so the DiskFileItem error thrown makes sense. You should be able to use the Streaming API or a custom solution like the one in this thread:http://groups.google.com/group/google-appengine-java/browse_thread/th... Streaming API works fine here. Cheers Philippe --~--~-~--~~~---~--~~ 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: Detching an object graph with JDO
Okej, i've learned a bit more since i've posted these messages. I didn't quite understand (still don't probably) fetchgroups and detach enough. Anyway, the problem i had with could be avoided by defining fetch groups for fields that will be stored in different tables. If i have a declaration like this: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) @FetchGroup(name = ItemValues, members = { @Persistent(name = values) }) public class Item implements Serializable { //... @Persistent private SetValue values; // ... } And i want to get an entity from the datastore including the field values. I have to the FetchGroup ItemValues to the FetchPlan: pm.setDetachAllOnCommit(true); pm.getFetchPlan().addGroup(ItemValues); Query query = pm.newQuery(Item.class); ... This way all the basic fields and the field values will be filled when the query returns. On Aug 14, 6:23 pm, bysse erik.byst...@gmail.com wrote: Ah true, i had a call to pm.setDetachAllOnCommit(true) that i didn't see. It's a bit disturbing that i can't pinpoint the error, i'll continue on this thread if it pops up again. thanks a lot for your answers On Aug 14, 6:03 pm, datanucleus andy_jeffer...@yahoo.com wrote: --~--~-~--~~~---~--~~ 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: Datastore Limits
No, I don't mean the 30 second timeout. First I thought that that was the issue, but then I counted and it wasn't near 30 seconds. I also realized that the script always stopped after 92 writes. On Sep 14, 3:54 pm, Iain iain.robe...@gmail.com wrote: What do you mean by times out? Do you mean you hit the 30 second deadline? On Sep 14, 3:59 am, hg hgo...@gmail.com wrote: Hi, I am writing a script that is supposed to run quite a few inserts to the datastore - up to a couple of hundred. My script keeps timing out at 92. After I ran it a few times this evening, it wiped out my entire datastore! I did some research and came across the following error documentation: for the DatastoreTimeoutException DatastoreTimeoutException is thrown when a datastore operation times out. This can happen when you attempt to put, get, or delete too many entities or an entity with too many properties, or if the datastore is overloaded or having trouble. I was not getting this error, but it does seem to have some bearing on this case. What are the limit on entity 'putting' for a script? Any suggestions would be appreciated. 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: Detching an object graph with JDO
Clearly i'm just as lost now as before On Sep 14, 7:54 pm, bysse erik.byst...@gmail.com wrote: Okej, i've learned a bit more since i've posted these messages. I didn't quite understand (still don't probably) fetchgroups and detach enough. Anyway, the problem i had with could be avoided by defining fetch groups for fields that will be stored in different tables. If i have a declaration like this: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) @FetchGroup(name = ItemValues, members = { @Persistent(name = values) }) public class Item implements Serializable { //... �...@persistent private SetValue values; // ... } And i want to get an entity from the datastore including the field values. I have to the FetchGroup ItemValues to the FetchPlan: pm.setDetachAllOnCommit(true); pm.getFetchPlan().addGroup(ItemValues); Query query = pm.newQuery(Item.class); ... This way all the basic fields and the field values will be filled when the query returns. On Aug 14, 6:23 pm, bysse erik.byst...@gmail.com wrote: Ah true, i had a call to pm.setDetachAllOnCommit(true) that i didn't see. It's a bit disturbing that i can't pinpoint the error, i'll continue on this thread if it pops up again. thanks a lot for your answers On Aug 14, 6:03 pm, datanucleus andy_jeffer...@yahoo.com wrote: --~--~-~--~~~---~--~~ 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] What's the Java equivalent of appcfg.py?
Hi: I'd like my app to download and upload from the datastore -- that is, to work as a file system. The only API, however, that I've found that does this is written in Python. I'd like to know what if there's a Java equivalent. --Sam --~--~-~--~~~---~--~~ 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: Datastore Limits
Thanks for replying. A couple of questions: Which thread should I read? Batching the writes seems like a great idea, I'll try it. On Sep 14, 7:01 pm, Larry Cable larry.ca...@gmail.com wrote: read this thread ... you might want to batch the writes you should get around 200-300 objects per write (under the 5 sec timeout) and probably around 2k per request before hitting the 30sec request timeout (all depends on the complexity of your objects) On Sep 14, 5:54 am, Iain iain.robe...@gmail.com wrote: What do you mean by times out? Do you mean you hit the 30 second deadline? On Sep 14, 3:59 am, hg hgo...@gmail.com wrote: Hi, I am writing a script that is supposed to run quite a few inserts to the datastore - up to a couple of hundred. My script keeps timing out at 92. After I ran it a few times this evening, it wiped out my entire datastore! I did some research and came across the following error documentation: for the DatastoreTimeoutException DatastoreTimeoutException is thrown when a datastore operation times out. This can happen when you attempt to put, get, or delete too many entities or an entity with too many properties, or if the datastore is overloaded or having trouble. I was not getting this error, but it does seem to have some bearing on this case. What are the limit on entity 'putting' for a script? Any suggestions would be appreciated. Thanks!- 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: Exhaustive JPA/JDO tutorial
This should help: http://www.datanucleus.org/products/accessplatform_1_1/index.html Regards, Esteban Java_GAE escribió: Hi, Please anybody can post a link to exhaustive and intensive tutorial on JPA/JDO. I got head and tail from the google app engine tutorial but need to understand much more than that to create my application. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Migration to Google App Engine for Java
Some thoughts based on experience. 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: What's the Java equivalent of appcfg.py?
The GaeVFS (Google App Engine Virtual File System) project implements a distributed, writable file system for Google App Engine: http://code.google.com/p/gaevfs/ The current release (0.3) supports an API based on Apache Commons VFS (http://commons.apache.org/vfs/). The latest code in SVN--which has not yet been packaged as a release--adds support for an API based on the JDK7 NIO2 project (http://openjdk.java.net/projects/nio/). GaeVFS also includes servlet for uploading and download files, and for doing directory listings: http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/servlet/GaeVfsServlet.java Finally, GaeVFS also implements a pluggable file system for the H2 relational database to provide SQL database support for Google App Engine; this is considered experimental for now: http://code.google.com/p/gaevfs/wiki/H2GAE Vince On Mon, Sep 14, 2009 at 2:52 PM, Sam Sach sam.sach...@gmail.com wrote: Hi: I'd like my app to download and upload from the datastore -- that is, to work as a file system. The only API, however, that I've found that does this is written in Python. I'd like to know what if there's a Java equivalent. --Sam --~--~-~--~~~---~--~~ 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: Datastore Limits
Thank you for replying. I tried batching the writes, and it didn't solve the problem. However, it did show me that my script is dying after I create 92 (exactly) entities, whether or not they have all been persisted. Could this be connected to the 2k per request? What exactly is the 2k per request? Thanks! On Sep 14, 7:01 pm, Larry Cable larry.ca...@gmail.com wrote: read this thread ... you might want to batch the writes you should get around 200-300 objects per write (under the 5 sec timeout) and probably around 2k per request before hitting the 30sec request timeout (all depends on the complexity of your objects) On Sep 14, 5:54 am, Iain iain.robe...@gmail.com wrote: What do you mean by times out? Do you mean you hit the 30 second deadline? On Sep 14, 3:59 am, hg hgo...@gmail.com wrote: Hi, I am writing a script that is supposed to run quite a few inserts to the datastore - up to a couple of hundred. My script keeps timing out at 92. After I ran it a few times this evening, it wiped out my entire datastore! I did some research and came across the following error documentation: for the DatastoreTimeoutException DatastoreTimeoutException is thrown when a datastore operation times out. This can happen when you attempt to put, get, or delete too many entities or an entity with too many properties, or if the datastore is overloaded or having trouble. I was not getting this error, but it does seem to have some bearing on this case. What are the limit on entity 'putting' for a script? Any suggestions would be appreciated. Thanks!- 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: What's the Java equivalent of appcfg.py?
Thanks, that answered my question. --Sam On Sep 14, 3:18 pm, Vince Bonfanti vbonfa...@gmail.com wrote: The GaeVFS (Google App Engine Virtual File System) project implements a distributed, writable file system for Google App Engine: http://code.google.com/p/gaevfs/ The current release (0.3) supports an API based on Apache Commons VFS (http://commons.apache.org/vfs/). The latest code in SVN--which has not yet been packaged as a release--adds support for an API based on the JDK7 NIO2 project (http://openjdk.java.net/projects/nio/). GaeVFS also includes servlet for uploading and download files, and for doing directory listings: http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant... Finally, GaeVFS also implements a pluggable file system for the H2 relational database to provide SQL database support for Google App Engine; this is considered experimental for now: http://code.google.com/p/gaevfs/wiki/H2GAE Vince On Mon, Sep 14, 2009 at 2:52 PM, Sam Sach sam.sach...@gmail.com wrote: Hi: I'd like my app to download and upload from the datastore -- that is, to work as a file system. The only API, however, that I've found that does this is written in Python. I'd like to know what if there's a Java equivalent. --Sam --~--~-~--~~~---~--~~ 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: Any way to work around 30 second request time limit?
Thank you for that! It looks promising. On Sep 12, 11:56 pm, Gianni Mariani gian...@google.com wrote: On Sun, Sep 13, 2009 at 5:29 AM, hg hgo...@gmail.com wrote: Hi, I have a task that I need to run via cron. It takes a fair amount of time - is there any way around the 30 second request time limit? I tried Runtime.getRuntime().exec(java , but I get a permission denied error. Does anyone have any ideas? Using Task Queues may help. The idea is that you break the job into 30 second or less chunks-o-work and queue them. -- Gianni Mariani Google, Sydney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Expression Language does not get evaluated in JSP
Did you put the jsp-property-group element inside of a jsp-config element? I tried this, and it uploaded without errors. - Jason On Thu, Sep 10, 2009 at 11:17 PM, Java_GAE next.is@gmail.com wrote: Thanks Marcel. There is another issue related with EL. When I tried to use jsp- property-group in web.xml to enable EL so I don't have to add page directive in all JSPs of the project, it throws error. jsp-property-group descriptionCommon configuration for all the JSP's/ description url-pattern*.jsp/url-pattern el-ignoredfalse/el-ignored /jsp-property-group Kindly guide. Regards On Sep 11, 1:25 am, Marcel Overdijk marceloverd...@gmail.com wrote: This is a known issue. Seehttp:// code.google.com/p/googleappengine/issues/detail?id=1478q=isEL... Cheers, Marcel On Sep 10, 8:25 pm, Java_GAE next.is@gmail.com wrote: Hi, When I use EL in JSP, I am getting unprocessed EL in the output. But when I add page directive %@ page isELIgnored=false % to the JSP pages, everything works fine. I observed that I need to add this directive only in App Engine projects while other projects work fine even without this directive. Please guide. Thanks in advance. I use Eclipse Ganemede on Windows Vista. Regards --~--~-~--~~~---~--~~ 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: Getting 'Request was aborted after waiting too long to attempt to service your request.' after application idle
Don, I have sent you my application id through email (by doing reply to author). A few of things I should mention: 1) we're using JPA 2) we are not creating EMF by doing: Persistence.createEntityManagerFactory(transactions-optional); instead it is created through spring's LocalEntityManagerFactoryBean (which we subclass to ensure only one instance of entity manager factory) The EMF initialization is done during spring intialization so it is in the servlet initialization path and not request processing path. It is just that if GAE chooses to start a new application instance to service a request, then the application startup (servlet initialization) occurs during request processing. Len On Sep 14, 10:37 am, Don Schwarz schwa...@google.com wrote: Len, what is your application ID? On Mon, Sep 14, 2009 at 12:33 PM, Larry Cable larry.ca...@gmail.com wrote: can you move the EMF creation out of the request path into the initialization path (Servlet.init(ServletConfig) or a static initializer in the Servlet class at startup ... BTW I also am using Spring IoC to create and inject the JDO EMF and I dont think I am seeing the same performance issues? Do you see similar startup costs on the local dev server as well as production? good luck - Larry On Sep 13, 5:27 pm, lent lentakeu...@gmail.com wrote: I have been doing some profiling on application startup and it seems that there is a large amount of overhead: - it takes about 5 seconds between the time the request is received to where our spring initialization code is invoked - creating an entity manager factory is taking on average 8+ seconds Sometimes these numbers can be much bigger than this, for example we have seen creating entity manager factory as much as 14 seconds. Given that the application needs to its own initialization (which we are trying to minimize), we find that the application initialization becomes very long and when the server is busy and the above number are even higher, the application initialization fails to complete in 30 seconds. Note that this is just the application initialization part and then the actual request has to be processed which will take some amount of time. Given that applications can be started on any given request, it makes things difficult with application startup time and request processing time with the 30 second limit. Len On Sep 8, 10:04 am, lent lentakeu...@gmail.com wrote: Hello, We have an application which uses GWT (using GWT RPC) on the client side. When the application is left idle for a while (~15 minutes) and the application sends a request, we get this reported on the client side: The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the query that caused it. In the log, the following is logged: Request was aborted after waiting too long to attempt to service your request. Most likely, this indicates that you have reached your simultaneous active request limit. This is almost always due to excessively high latency in your app. Please seehttp:// code.google.com/appengine/docs/quotas.htmlformore details. I believe that our application has been swapped out and and when the request comes in the application is being loaded again as we see some log entries we make when the application (servlet) gets initialized. It does take some time to get the application initialized but the error is reported way before 30 seconds has elapsed. Is there any way to avoid this problem? Len- 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] self referral one-to-many relationship with null root
I have a class which has a collection of itself as its children. It is mapped as : @Persistent private Group parent; @Persistent(mappedBy= parent) private ListGroup children; The problem is I cannot insert the root object. The call to makePersistent comes back successfully, but the entity is not in the database. I guess this object with this mapping can not have null parents. Is there anyway I can make the parent nullable? --~--~-~--~~~---~--~~ 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: appengine artifacts not updated
Hi David. We're blocked on a couple of commits that are needed before this happens, but I'll try to get another update to you soon. - Jason On Fri, Sep 11, 2009 at 3:14 AM, David Yu david.yu@gmail.com wrote: Any googler out there care to shed some light? On Sep 10, 4:28 am, Marcel Overdijk marceloverd...@gmail.com wrote: Link to issue:http://tinyurl.com/lnogw3 On Sep 9, 9:40 pm, Marcel Overdijk marceloverd...@gmail.com wrote: I just don't understand it. I also like Google to place the artifacts. At least someone from Google should answer this (as the previous thread was ignored) discussion if we can relay on artifacts inhttp:// google-maven-repository.googlecode.com/svn/repository/com/goog I've create a new issue (http://code.google.com/p/googleappengine/ issues/detail?id=2098) to always update the artifacts after a new release. Let's hope Google will include it in their release process. Cheers, Marcel On Sep 9, 6:17 pm, David david.yu@gmail.com wrote: Appengine artifacts are not updated inhttp:// google-maven-repository.googlecode.com/svn/repository/com/goog... Can we request 1.2.5 to be uploaded there? My other post regarding this topic was ignored for some reason. (http://groups.google.com/group/google-appengine-java/browse_thread/ thread/797b4ccb8e9f7c1f/fb0f4aca36a55c6b?hl=enlnk=gstq=google- maven#fb0f4aca36a55c6b) We're not sure if you have discontinued it or someone just forgot to update it. A heads-up from a googler will be appreciated. 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: Entity ID and keyName identification scope
No, you can't count on generated IDs being contiguous or monotonically increasing. - Jason On Fri, Sep 11, 2009 at 9:19 AM, iker98 ike...@gmail.com wrote: Thank you Max, I understand a bit more the numeric ID generator in datastore. Now I am aware that the numeric ID allocation for the entities belonging a kind isn't sorted or contiguous like I hope at first. On Sep 10, 8:10 pm, Max Ross maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: The URL I posted earlier in the thread explains it, but here's a little bit more detail: A parent entity plus a kind defines an id-space, so entities with the same parent and the same kind are guaranteed to have unique ids. For example, if you have an Entity with Parent:A Kind: Person Id: 10 you are guaranteed that no other entity with Parent A and Kind Person will be assigned an Id of 10. However, an entity with a different Parent and Kind Person or an entity with Parent A and a different Kind _can_ be assigned an Id of 10. The datastore pre-allocates batches of ids across multiple servers under-the-hood, so you can't make any assumptions about the Id that will get assigned in terms of contiguousness. The only safe assumption is that the id will be unique for that Parent/Kind combination. Hope this helps, Max On Thu, Sep 10, 2009 at 5:29 AM, iker98 ike...@gmail.com wrote: Definitely I don't understand the number ID generator behavior across kinds (in prod datastore). Does anyone know any URL with detailed explanation about it? Thanks On Sep 9, 11:58 am, Tica2 petrica.chir...@gmail.com wrote: Max, I like to have same behavior between local and production environment It is posible ? For instance the code: StringBuffer sb = new StringBuffer(); KeyRange range = ds.allocateIds(a, 2); for (Key key : range) { sb.append(\n a + key.toString()); } range = ds.allocateIds(b, 2); for (Key key : range) { sb.append(\n b + key.toString()); } Key parentKey = KeyFactory.createKey(c, 1); sb.append(\n c + parentKey.toString()); range = ds.allocateIds(parentKey, d, 2); for (Key key : range) { sb.append(\n d + key.toString()); } System.out.println(sb.toString()); Local produce: a a(1) a a(2) b b(3) b b(4) c c(1) d c(1)/d(5) d c(1)/d(6) But in production environment: a a(1) a a(2) b b(1001) b b(1002) c c(1) d c(1)/d(1) d c(1)/d(2) a a(1003) a a(1004) b b(3) b b(4) c c(1) d c(1)/d(1001) d c(1)/d(1002) 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: JSTL and Expression Language how to
The page has been updated. - Jason On Fri, Sep 11, 2009 at 10:59 AM, Guilherme Silveira guilherme.silve...@gmail.com wrote: Hello guys, It seems that JSP Api+JSTL does not work out of the box at appengine as it says here http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine Is there any way to update the above link? Some posts on the list mention that EL was ignored by default (due to the jasper compiled being configured this way). The following is a list of tasks one can and can not do to make it work: a) jsp-config/jsp-proprerty-group/el-ignored tag is unsupported, therefore b) all your jsp files should contain @page isElIgnored=false c) all your tag files should contain @tag isElIgnored=false d) there is no need to add the jstl jar file to your WEB-INF/lib dir Although there are some mails saying that (d) would not work if you add it, it seems to me that it depends on the version that you add to the classpath so... do not add it. Regards --~--~-~--~~~---~--~~ 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: Problem saving an object using makePersistent
Your code looks fine. I just copied it over to a non-Spring context and it worked without a hitch. Did you see this error before upgrading your SDK? Are you seeing it in both the local development server and production? If you start a new project and copy over your domain and DAO classes, does it work? - Jason On Fri, Sep 11, 2009 at 2:04 PM, cancunmods archie.she...@gmail.com wrote: Hi, I am using spring in my application and the pmf is a singleton, I put it in the class just to make sure it is not a spring issue. I am still getting the error but in my case nothing is persisted. I also added the @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) line and no dice my SDK version is the newest 1.2.5. The following is the spring code from which I am calling the saveUser method I had posted before. Any help would be greatly appreciaed, thanks. package subasta.web.users; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.web.bind.ServletRequestDataBinder; import org.springframework.web.servlet.mvc.SimpleFormController; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; import org.springframework.beans.factory.annotation.Autowired; import subasta.domain.users.User; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import java.util.logging.Logger; import subasta.service.users.GuardaUsuario; import subasta.repository.users.UserDAO; public class RegisterController extends SimpleFormController { /** Logger for this class and subclasses */ private static final Logger log = Logger.getLogger (RegisterController.class .getName()); private UserDAO userDao; public void setUserDao(UserDAO userDao) { this.userDao = userDao; } @Override public ModelAndView onSubmit(Object command) throws ServletException { String nombre = ((GuardaUsuario) command).getNombre(); log.info(Guardando usuario + nombre + .); User user = new User(nombre); userDao.saveUser(user); log.info(returning from RegisterController view to + getSuccessView()); return new ModelAndView(new RedirectView(getSuccessView())); } /* * This was added because after uploading to GAE I was getting an exception, it is * actually a pretty neat addition, taken from its javadoc: * Property editor that trims Strings. Optionally allows transforming an empty string into a null value. Needs to be explictly registered, e.g. for command binding. * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder (javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder) */ @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(String.class, new StringTrimmerEditor(false)); } } On Sep 11, 3:31 pm, Jeff j...@jgyoung.com wrote: I've been seeing the same thing, and also only on the first access after application start. It happens consistently for me with my first call to either getObjectById makePersistent or makePersistentAll. In my attempts to search the web for info, I ran across a snippet of code that included the specified error message text. A comment in that source said something like this is a harmless exception, we should figure out a way to suppress it. Yeah, I was annoyed at having spent a bunch of time thinking this was the source of an issue when it was only a red herring. Sorry I don't remember the url to that code snippet but searching for pieces of the error message from the beginning of your stack trace should eventually find it. I'm currently choosing to ignore the exception and everything appears to be working for me. On Sep 11, 12:01 pm, Jason (Google) apija...@google.com wrote: You shouldn't need the @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) line since you're using a key name and not a String-encoded ID. The only thing that looks suspicious is your pmf object. The best practice is to use a PersistenceManagerFactory singleton as documented athttp:// code.google.com/appengine/docs/java/datastore/usingjdo.html#Ge..., but I would expect to see exceptions with subsequent calls to saveUser, not the first call. All the same, I recommend you try this to see if it helps, and please also let me know which version of the SDK you're using. - Jason On Thu, Sep 10, 2009 at 1:09 AM, bysse erik.byst...@gmail.com wrote: As expected, this has nothing to do with wicket
[appengine-java] Re: Problem saving an object using makePersistent
Also, do you have any unit tests that touch the App Engine datastore, and if so, can you run these to see if they work? - Jason On Mon, Sep 14, 2009 at 3:41 PM, Jason (Google) apija...@google.com wrote: Your code looks fine. I just copied it over to a non-Spring context and it worked without a hitch. Did you see this error before upgrading your SDK? Are you seeing it in both the local development server and production? If you start a new project and copy over your domain and DAO classes, does it work? - Jason On Fri, Sep 11, 2009 at 2:04 PM, cancunmods archie.she...@gmail.comwrote: Hi, I am using spring in my application and the pmf is a singleton, I put it in the class just to make sure it is not a spring issue. I am still getting the error but in my case nothing is persisted. I also added the @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) line and no dice my SDK version is the newest 1.2.5. The following is the spring code from which I am calling the saveUser method I had posted before. Any help would be greatly appreciaed, thanks. package subasta.web.users; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.web.bind.ServletRequestDataBinder; import org.springframework.web.servlet.mvc.SimpleFormController; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; import org.springframework.beans.factory.annotation.Autowired; import subasta.domain.users.User; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import java.util.logging.Logger; import subasta.service.users.GuardaUsuario; import subasta.repository.users.UserDAO; public class RegisterController extends SimpleFormController { /** Logger for this class and subclasses */ private static final Logger log = Logger.getLogger (RegisterController.class .getName()); private UserDAO userDao; public void setUserDao(UserDAO userDao) { this.userDao = userDao; } @Override public ModelAndView onSubmit(Object command) throws ServletException { String nombre = ((GuardaUsuario) command).getNombre(); log.info(Guardando usuario + nombre + .); User user = new User(nombre); userDao.saveUser(user); log.info(returning from RegisterController view to + getSuccessView()); return new ModelAndView(new RedirectView(getSuccessView())); } /* * This was added because after uploading to GAE I was getting an exception, it is * actually a pretty neat addition, taken from its javadoc: * Property editor that trims Strings. Optionally allows transforming an empty string into a null value. Needs to be explictly registered, e.g. for command binding. * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder (javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder) */ @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(String.class, new StringTrimmerEditor(false)); } } On Sep 11, 3:31 pm, Jeff j...@jgyoung.com wrote: I've been seeing the same thing, and also only on the first access after application start. It happens consistently for me with my first call to either getObjectById makePersistent or makePersistentAll. In my attempts to search the web for info, I ran across a snippet of code that included the specified error message text. A comment in that source said something like this is a harmless exception, we should figure out a way to suppress it. Yeah, I was annoyed at having spent a bunch of time thinking this was the source of an issue when it was only a red herring. Sorry I don't remember the url to that code snippet but searching for pieces of the error message from the beginning of your stack trace should eventually find it. I'm currently choosing to ignore the exception and everything appears to be working for me. On Sep 11, 12:01 pm, Jason (Google) apija...@google.com wrote: You shouldn't need the @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) line since you're using a key name and not a String-encoded ID. The only thing that looks suspicious is your pmf object. The best practice is to use a PersistenceManagerFactory singleton as documented athttp://code.google.com/appengine/docs/java/datastore/usingjdo.html#Ge.. ., but I would expect to see exceptions with subsequent calls to saveUser, not the first call. All the same, I recommend you try this to see if it
[appengine-java] Re: Session destruction events, API availability therein
It's worth noting that session data isn't cleaned up by default. This means that you can implement your own session cleanup logic and perform any other cleanup logic hat you need to do at the same time. On Mon, Sep 14, 2009 at 5:50 PM, Jason (Google) apija...@google.com wrote: Yes, this seems reasonable. You can run this job, hitting the cleanup servlet, once a day or any interval you see fit. For more info: http://groups.google.com/group/google-appengine-java/browse_thread/thread/4f0d9af1c633d39a - Jason On Fri, Sep 11, 2009 at 6:45 PM, Erem ehb...@gmail.com wrote: Hey Jason, Thanks for the clarification. Unfortunately this leaves me at a loss for how to elegantly clean up dead sessions and manage logged-in status. Is the only remaining option to put cleanup scripts into a cronjob? On Sep 11, 6:04 pm, Jason (Google) apija...@google.com wrote: Hi Erum. App Engine doesn't support this callback, so when sessionDestroyed is triggered by the development server, it's not within an active request and hence the exception that you're seeing. In the production environment, you would see a similar result if the callback is even triggered at all. The fact that the development server does trigger sessionDestroyed is a bug in the SDK. Please file a new report in our public tracker, and I'm sorry for the bad news. http://code.google.com/p/googleappengine/issues/list - Jason On Fri, Sep 11, 2009 at 3:54 PM, Erem ehb...@gmail.com wrote: Hi Jason, Thanks for the response. I'm seeing it in the development environment. I can't even get ahold of a stack trace in production because the logged events I try to throw just aren't reaching the Logs manager. I do know that it's not working, however, because the object doesn't get inserted in the following code. Here's some sample code to show what's happening, and a stack trace of the error it throws public class SessionListener implements HttpSessionListener { private static final Logger log = Logger .getLogger(DataNucleus.JDO); @Override public void sessionCreated(HttpSessionEvent ev) { System.out.println(Session starting); ev.getSession().setMaxInactiveInterval(2); } @Override public void sessionDestroyed(HttpSessionEvent ev) { try { System.out.println(Session ending); PersistenceManager pm = PMF.get().getPersistenceManager(); System.out.println(pm); PersistMe me = new PersistMe(); me.setName(Erem); pm.makePersistent(me); pm.close(); System.out.println(Session ended); } catch (Exception e) { log.log(Level.SEVERE, Failed in session cleanup, e); } } } This code, when run from the dev server makes this error Sep 11, 2009 3:50:53 PM lotr.server.SessionListener sessionDestroyed SEVERE: Failed in session cleanup java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId (DatastoreApiHelper.java:63) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace (DatastoreApiHelper.java:73) at com.google.appengine.api.datastore.Key.init(Key.java:100) at com.google.appengine.api.datastore.Key.init(Key.java:85) at com.google.appengine.api.datastore.Key.init(Key.java:81) at com.google.appengine.api.datastore.Entity.init(Entity.java:103) at com.google.appengine.api.datastore.Entity.init(Entity.java:84) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:167) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject (DatastorePersistenceHandler.java:178) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent (JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.makePersistent (JDOStateManagerImpl.java:3161) at org.datanucleus.ObjectManagerImpl.persistObjectInternal (ObjectManagerImpl.java:1298) at org.datanucleus.ObjectManagerImpl.persistObject (ObjectManagerImpl.java:1175) at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent (JDOPersistenceManager.java:669) at org.datanucleus.jdo.JDOPersistenceManager.makePersistent (JDOPersistenceManager.java:694) at lotr.server.SessionListener.sessionDestroyed(SessionListener.java: 26) at org.mortbay.jetty.servlet.AbstractSessionManager.removeSession (AbstractSessionManager.java:661)
[appengine-java] Re: Session destruction events, API availability therein
Yes, this seems reasonable. You can run this job, hitting the cleanup servlet, once a day or any interval you see fit. For more info: http://groups.google.com/group/google-appengine-java/browse_thread/thread/4f0d9af1c633d39a - Jason On Fri, Sep 11, 2009 at 6:45 PM, Erem ehb...@gmail.com wrote: Hey Jason, Thanks for the clarification. Unfortunately this leaves me at a loss for how to elegantly clean up dead sessions and manage logged-in status. Is the only remaining option to put cleanup scripts into a cronjob? On Sep 11, 6:04 pm, Jason (Google) apija...@google.com wrote: Hi Erum. App Engine doesn't support this callback, so when sessionDestroyed is triggered by the development server, it's not within an active request and hence the exception that you're seeing. In the production environment, you would see a similar result if the callback is even triggered at all. The fact that the development server does trigger sessionDestroyed is a bug in the SDK. Please file a new report in our public tracker, and I'm sorry for the bad news. http://code.google.com/p/googleappengine/issues/list - Jason On Fri, Sep 11, 2009 at 3:54 PM, Erem ehb...@gmail.com wrote: Hi Jason, Thanks for the response. I'm seeing it in the development environment. I can't even get ahold of a stack trace in production because the logged events I try to throw just aren't reaching the Logs manager. I do know that it's not working, however, because the object doesn't get inserted in the following code. Here's some sample code to show what's happening, and a stack trace of the error it throws public class SessionListener implements HttpSessionListener { private static final Logger log = Logger .getLogger(DataNucleus.JDO); @Override public void sessionCreated(HttpSessionEvent ev) { System.out.println(Session starting); ev.getSession().setMaxInactiveInterval(2); } @Override public void sessionDestroyed(HttpSessionEvent ev) { try { System.out.println(Session ending); PersistenceManager pm = PMF.get().getPersistenceManager(); System.out.println(pm); PersistMe me = new PersistMe(); me.setName(Erem); pm.makePersistent(me); pm.close(); System.out.println(Session ended); } catch (Exception e) { log.log(Level.SEVERE, Failed in session cleanup, e); } } } This code, when run from the dev server makes this error Sep 11, 2009 3:50:53 PM lotr.server.SessionListener sessionDestroyed SEVERE: Failed in session cleanup java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId (DatastoreApiHelper.java:63) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace (DatastoreApiHelper.java:73) at com.google.appengine.api.datastore.Key.init(Key.java:100) at com.google.appengine.api.datastore.Key.init(Key.java:85) at com.google.appengine.api.datastore.Key.init(Key.java:81) at com.google.appengine.api.datastore.Entity.init(Entity.java:103) at com.google.appengine.api.datastore.Entity.init(Entity.java:84) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:167) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject (DatastorePersistenceHandler.java:178) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent (JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.makePersistent (JDOStateManagerImpl.java:3161) at org.datanucleus.ObjectManagerImpl.persistObjectInternal (ObjectManagerImpl.java:1298) at org.datanucleus.ObjectManagerImpl.persistObject (ObjectManagerImpl.java:1175) at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent (JDOPersistenceManager.java:669) at org.datanucleus.jdo.JDOPersistenceManager.makePersistent (JDOPersistenceManager.java:694) at lotr.server.SessionListener.sessionDestroyed(SessionListener.java: 26) at org.mortbay.jetty.servlet.AbstractSessionManager.removeSession (AbstractSessionManager.java:661) at org.mortbay.jetty.servlet.AbstractSessionManager$Session.timeout (AbstractSessionManager.java:918) at org.mortbay.jetty.servlet.HashSessionManager.scavenge (HashSessionManager.java:200) at org.mortbay.jetty.servlet.HashSessionManager.access$000
[appengine-java] Re: Server error 500
Your data is not lost -- I can see that you have several entities stored in your datastore. It looks like your jdo.jsp file is not in the right location. Have you placed it in the war directory? Sharing your web.xml file would be helpful. - Jason On Sat, Sep 12, 2009 at 1:22 PM, Anton Ananich anton.anan...@gmail.comwrote: Hi! My application became completely broken and now I can not eve backup data!!! Datastore does not work any longer, all the data is lost. Here is page: http://herewetest.appspot.com/jdo.jsp Here is source code: % Query q = PMF.getInstance().newQuery(Website.class); ListWebsite o = (ListWebsite)q.execute(); for (Website w : o){ % . % PMF.getInstance().deletePersistent(w); } % --~--~-~--~~~---~--~~ 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: Bulk update throws exception
From the error message, it sounds like the parent isn't getting set correctly. You'll need to share some of your code in order for me to help you further -- what does your Release class look like and how are you persisting it? - Jason On Sat, Sep 12, 2009 at 4:36 AM, Anita an...@ensarm.com wrote: Hi Jason, Our schema looks as follows: ProductType 1-M Product 1M Release Data is inserting into Release table. But while fetching data from release table i am getting following exception: Field com.ensarm.server.domain.Release.products should be able to provide a reference to its parent but the entity does not have a parent. Did you perhaps try to establish an instance of com.ensarm.server.domain.Release as the child of an instance of com.ensarm.server.domain.Products after the child had already been persisted? org.datanucleus.exceptions.NucleusUserException: Field com.ensarm.server.domain.Release.products should be able to provide a reference to its parent but the entity does not have a parent. Did you perhaps try to establish an instance of com.ensarm.server.domain.Release as the child of an instance of com.ensarm.server.domain.Products after the child had already been persisted? at org.datanucleus.store.appengine.DatastoreRelationFieldManager.lookupParent (DatastoreRelationFieldManager.java:302) at org.datanucleus.store.appengine.DatastoreRelationFieldManager.fetchRelationField (DatastoreRelationFieldManager.java:289) at org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField (DatastoreFieldManager.java:271) at org.datanucleus.state.AbstractStateManager.replacingObjectField (AbstractStateManager.java:1197) at com.ensarm.server.domain.Release.jdoReplaceField(Release.java) at com.ensarm.server.domain.Release.jdoReplaceFields(Release.java) at org.datanucleus.state.JDOStateManagerImpl.replaceFields (JDOStateManagerImpl.java:2772) at org.datanucleus.state.JDOStateManagerImpl.replaceFields (JDOStateManagerImpl.java:2791) at org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject (DatastorePersistenceHandler.java:349) at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo (DatastoreQuery.java:384) at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo (DatastoreQuery.java:345) at org.datanucleus.store.appengine.query.DatastoreQuery.access$700 (DatastoreQuery.java:96) at org.datanucleus.store.appengine.query.DatastoreQuery$5.apply (DatastoreQuery.java:454) at org.datanucleus.store.appengine.query.DatastoreQuery$5.apply (DatastoreQuery.java:453) at org.datanucleus.store.appengine.query.StreamingQueryResult.resolveNext (StreamingQueryResult.java:137) at org.datanucleus.store.appengine.query.StreamingQueryResult $1.computeNext(StreamingQueryResult.java:163) at org.datanucleus.store.appengine.query.AbstractIterator.tryToComputeNext (AbstractIterator.java:132) at org.datanucleus.store.appengine.query.AbstractIterator.hasNext (AbstractIterator.java:127) at org.datanucleus.store.appengine.query.StreamingQueryResult $AbstractListIterator.hasNext(StreamingQueryResult.java:229) at com.ensarm.server.servlet.GetData.getRelease(GetData.java:87) at com.ensarm.server.servlet.GetData.doGet(GetData.java:32) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 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.utils.servlet.TransactionCleanupFilter.doFilter (TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1084) at com.google.appengine.tools.development.StaticFileFilter.doFilter (StaticFileFilter.java:124) 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.utils.jetty.DevAppEngineWebAppContext.handle (DevAppEngineWebAppContext.java:54) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139) at com.google.appengine.tools.development.JettyContainerService $ApiProxyHandler.handle(JettyContainerService.java:313) at
[appengine-java] Re: JDO startsWith for Japanese does not work on production server
You should add a filter that calls request.setCharacterEncoding() and sets the appropriate encoding before handling the request. If you query for the data without startsWith and display it on-screen, do you see what you expect or is it garbled? Also, make sure you add this line after declaring the Query: query.declareParameters(String content); - Jason On Sat, Sep 12, 2009 at 10:32 PM, Yasuo Higa higaya...@gmail.com wrote: Hi all, JDO startsWith for Japanese works fine on development server, but it does not work on production server. The following url is my test application. http://2.latest.higayasuo.appspot.com/blog/ Test code: Query query = pm.newQuery(Blog.class, content.startsWith(:content)); ListBlog blogList = (ListBlog) query.execute(request.getParameter(content)); request.setAttribute(blogList, blogList); Blog.java: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Blog { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = true) private String key; @Persistent private String title; @Persistent private String content; ... } My jsp's encoding is UTF-8. Is there a workaround? 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: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.io)
It looks like you're trying to make a direct connection to your IBM DB2 database, which App Engine's sandbox doesn't permit: http://code.google.com/appengine/docs/java/runtime.html#The_Sandbox If you want to use an external database, you will have to place a web service in front of it and use App Engine's URL Fetch library. Or you can use App Engine's datastore directly which is preferred. There are JDO and JPA interfaces for code portability: http://code.google.com/appengine/docs/java/datastore/ - Jason On Sat, Sep 12, 2009 at 9:08 AM, Ravi Mandliya funkyr...@gmail.com wrote: Hello everyone I just uploaded my first application, its running, and seems to be working fine, but there is a problem, I get the following error when onblur() on the textbox is activated, I have applied ajax which fetches the data from Database(IBM DB2). It generates the following error: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.io) Full error code is following: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.google.appengine.tools.development.DevAppServerFactory $CustomSecurityManager.checkPermission(DevAppServerFactory.java:139) at java.lang.SecurityManager.checkPackageAccess(Unknown Source) at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java: 117) at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java: 69) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at java.sql.DriverManager.getCallerClass(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.apache.jsp.validate_jsp._jspService(validate_jsp.java:65) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at com.google.appengine.tools.development.PrivilegedJspServlet.access $101(PrivilegedJspServlet.java:23) at com.google.appengine.tools.development.PrivilegedJspServlet$2.run (PrivilegedJspServlet.java:59) at java.security.AccessController.doPrivileged(Native Method) at com.google.appengine.tools.development.PrivilegedJspServlet.service (PrivilegedJspServlet.java:57) 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.utils.servlet.TransactionCleanupFilter.doFilter (TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1084) at com.google.appengine.tools.development.StaticFileFilter.doFilter (StaticFileFilter.java:121) 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.utils.jetty.DevAppEngineWebAppContext.handle (DevAppEngineWebAppContext.java:54) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139) at com.google.appengine.tools.development.JettyContainerService $ApiProxyHandler.handle(JettyContainerService.java:313) 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 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at
[appengine-java] Re: Announcing JDO/JPA Snippets That Work
I'd also encourage you as part of this to focus on the mapping of JPA/JDO RDBMS like concepts onto the DS, as this I have found to be most problematic ... (or at least include pointers from the example back to the online docs) which is funny because I confess that you could write down all I know about RDBMS on the head of a pin ... Also I think coping strategies to deal with DS and GAE quotas would be helpful too! Thanks for doing this - Larry On Sep 14, 4:00 pm, Max Ross maxr+appeng...@google.com wrote: Greetings everyone! For those of you who don't know me, my name is Max Ross and I'm an engineer on the Google App Engine team who works on persistence stuff: the datastore, the low-level datastore api, and the JDO/JPA implementation. I'll be your host. GAE for Java has been available since early April, and since launch we've fixed a lot of bugs and added a lot of featureshttp://code.google.com/p/datanucleus-appengine/issues/list?can=1q=st...related to JDO and JPA. However, I read this group regularly and I see the persistence questions being asked, and it's clear to me that we're not giving you, our customers, enough guidance. JDO/JPA Snippets That Work is my attempt to provide that guidance. Each week I'm going to post a complete example demonstrating how to accomplish a specific persistence-related task. We don't play favorites here on the App Engine team so I'll construct the example in both JDO and JPA, and I'll try to cover a wide range of topics to keep everyone interested. My hope is that, over time, this will come to serve as a valuable resource to all App Engine Java developers whether you're new to JDO/JPA or not. The subject line of all these posts will begin with JDO/JPA Snippets That Work so you can recognize the new ones and find the old ones easily. I will not use the word 'simply' to describe anything. The first real post is already queued up so keep an eye out for it, and if you have feedback on the usefulness of these snippets, good or bad, please don't hesitate to let us know. 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: Bulk update throws exception
nope you are right ... it's not useless ... apologies I *think* the problem is in mapping (conceptually) from a mental RDBMS model to a GAE DS model ... where entity group might be mistaken for table ... :) On Aug 26, 3:02 pm, Jason (Google) apija...@google.com wrote: Why do you indicate that the documentation is useless? The links I included above state this quite clearly: two entities will be in separate entity groups by default, even if they're the same kind. Entity groups DO NOT collect entities of the same kind. If you need transaction support, you'll need to explicitly set one entity as the parent of the other, which basically creates a hierarchy (tree) of entities -- this is an entity group. In JDO/JPA, you do this using owned relationships which is covered in my second link above. - Jason On Tue, Aug 25, 2009 at 2:33 PM, Larry Cable larry.ca...@gmail.com wrote: I have exactly the same problem, I instantiate a number of @Entity objects (all of the same type) persist them, and flush them in the context of the same transaction. Since they are all of the same type, and their are no relationships (although there is an @Embedded class/field) I would imagine that they are all modelled as being in the same entity group .. but apparently not. The documentation is basically useless at this point ... On Aug 15, 1:09 pm, Foreigner foreigne...@gmail.com wrote: While trying to do a bulk update on my entities using JPA I get the exception bellow. I understand that you can't do a bulk update on different entity groups in the same transaction but I guess I don't quite understand what an entity group is and how I go about making all entities part of the same group I want. Thanks for the help. fbr Illegal argument org.datanucleus.exceptions.NucleusUserException: Illegal argument at org.datanucleus.store.appengine.DatastoreExceptionTranslator.wrapIllegalArgumentException(DatastoreExceptionTranslator.java:42) at org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.put(RuntimeExceptionWrappingDatastoreService.java:106) at org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:125) at org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:94) at org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(DatastorePersistenceHandler.java:398) at org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4458) at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2807) at org.datanucleus.ObjectManagerImpl.markDirty(ObjectManagerImpl.java:2617) at org.datanucleus.state.JDOStateManagerImpl.postWriteField(JDOStateManagerImpl.java:4241) at org.datanucleus.state.JDOStateManagerImpl.setObjectField(JDOStateManagerImpl.java:2287) at com.yicook.entities.TwitterDailyTip.jdoSetlastSet(TwitterDailyTip.java) at com.yicook.entities.TwitterDailyTip.setLastSet(TwitterDailyTip.java:36) at com.yicook.control.bco.TwitterStatusSetterBCO.resetTDT(TwitterStatusSetterBCO.java:60) at com.yicook.control.bco.TwitterStatusSetterBCO.execute(TwitterStatusSetterBCO.java:40) at com.yicook.control.ApplicationController.executeControllers(ApplicationController.java:61) at com.yicook.control.ApplicationController.dispatch(ApplicationController.java:41) at com.yicook.servlets.FrontController.doPost(FrontController.java:31) at com.yicook.servlets.FrontController.doGet(FrontController.java:25) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) 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.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.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54) at
[appengine-java] Re: JDO/JPA Snippets That Work - Creating a bidirectional, owned, one-to-many relationship
you might want to extend this example to use the ISBN as the book's PrimaryKey, which might be a natural choice for the entities id, ensuring uniqueness in the DS ... Thanks - larry On Sep 14, 4:07 pm, Max Ross maxr+appeng...@google.com wrote: Hello hello and welcome to the very first installment of JDO/JPA Snippets That Work! Creating A Bidrectional Owned One-To-Many Suppose you're building a book catalog application and you want to model books and chapters. Books contain chapters. A chapter cannot exist without a book, so if you delete a book you want its chapters automatically deleted along with it. You also want to each chapter to have a reference to the book that owns it. Sounds like a bidrectional, owned, one-to-many relationship is just the thing. First we'll set up our model objects and then we'll add some code to create a Book with 2 Chapters. JPA: @Entity public class Book { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Key id; private String title; @OneToMany(mappedBy = book, cascade = CascadeType.ALL) private ListChapter chapters = new ArrayListChapter(); // getters and setters } @Entity public class Chapter { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Key id; private String title; private int numPages; @ManyToOne(fetch = FetchType.LAZY) private Book book; // getters and setters } Now let's create a book with two chapters (we'll assume someone else is creating and closing an EntityManager named 'em' for us): Book b = new Book(); b.setTitle(JPA 4eva); Chapter c1 = new Chapter(); c1.setTitle(Intro); c1.setNumPages(10); b.getChapters().add(c1); Chapter c2 = new Chapter(); c2.setTitle(Configuration); c2.setNumPages(9); b.getChapters().add(c2); em.getTransaction().begin(); try { em.persist(b); em.getTransaction().commit();} finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } } JDO: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class Book { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; private String title; @Persistent(mappedBy = book) @Element(dependent = true) private ListChapter chapters = new ArrayListChapter(); // getters and setters } @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class Chapter { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; private String title; private int numPages; @Persistent private Book book; // getters and setters } Now let's create a book with two chapters (we'll assume someone else is creating and closing a PersistenceManager named 'pm' for us): Book b = new Book(); b.setTitle(JDO 4eva); Chapter c1 = new Chapter(); c1.setTitle(Intro); c1.setNumPages(10); b.getChapters().add(c1); Chapter c2 = new Chapter(); c2.setTitle(Configuration); c2.setNumPages(9); b.getChapters().add(c2); pm.currentTransaction().begin(); try { pm.makePersistent(b); pm.currentTransaction().commit();} finally { if (pm.currentTransaction().isActive()) { pm.currentTransaction().rollback(); } }- 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: SDK-1.2.5 for various GWT modules
I find out the issue. It is the cache in my browser of previous error. Please ignore the question. BaTien On Mon, 2009-09-14 at 10:18 -0600, Duong BaTien wrote: Hi: I use GAE SDK and GWT for different applications. For GAE SDK, i take out 3 libs related to jpa since i use jdo (datanucleus-jpa-1.1.5, geronima-jpa_3.0_spec-1.1.1, geronimo-jta_1.1_spec-1.1.1). For GWT modules, i do not use eclipse but use ant build: ant-1.7.0, jdk1.6, gwt- linux-1.7.0 All GWT modules, one built on top others through inherits , run as expeted for hosted, jar, javadoc. All GWT modules point to the same sdk- dir of appengine. After testing with runserver and update that module (dbgroups) to GAE, the runserver for other modules got the sticky of the previous successfully runserver (No file found for: /dbgroups/dbgroups.nocache.js) How can i change so one copy of SDK can be used for all GWT modules? Thanks Duong BaTien DBGROUPS and BudhNet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: How can I use GAE for Java?
Thanks for your reply. There is not any more questions. The credit card is a problem ,but I think I can find the U.S. credit card payments service in C2C community. --~--~-~--~~~---~--~~ 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 startsWith for Japanese does not work on production server
Hi Jason, Thanks for your reply. On Tue, Sep 15, 2009 at 8:21 AM, Jason (Google) apija...@google.com wrote: You should add a filter that calls request.setCharacterEncoding() and sets the appropriate encoding before handling the request. If you query for the data without startsWith and display it on-screen, do you see what you expect or is it garbled? I call request.setCharacterEncoding(UTF-8), and my JSP is not garbled. I think the cause is DatastoreQuery#getUpperLimitForStartsWithStr(). In the method, val.getBytes() is called. String#getBytes() depends on default charset encoding. Shift_JIS is used on my local server, but an another charset encoding may be used on production server. The following code may work fine: private Literal getUpperLimitForStartsWithStr(String val) { return new Literal(val + \ufffd); } Also, make sure you add this line after declaring the Query: query.declareParameters(String content); I use implicit parameter as :content. Thanks, Yasuo Higa - Jason On Sat, Sep 12, 2009 at 10:32 PM, Yasuo Higa higaya...@gmail.com wrote: Hi all, JDO startsWith for Japanese works fine on development server, but it does not work on production server. The following url is my test application. http://2.latest.higayasuo.appspot.com/blog/ Test code: Query query = pm.newQuery(Blog.class, content.startsWith(:content)); ListBlog blogList = (ListBlog) query.execute(request.getParameter(content)); request.setAttribute(blogList, blogList); Blog.java: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Blog { �...@primarykey �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) �...@extension(vendorName = datanucleus, key = gae.encoded-pk, value = true) private String key; �...@persistent private String title; �...@persistent private String content; ... } My jsp's encoding is UTF-8. Is there a workaround? 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: Can I avoid Data Nucleus and still use JPA?
On Sep 14, 7:57 pm, jeremy rose jeremy.rosenb...@gmail.com wrote: On Sep 14, 6:06 am, leszek leszek.ptokar...@gmail.com wrote: Hibernate is not JPA implementation, it exposes its own API. Hibernate Entity Manager is a product build on standard Hibernate and offering full JPA interface. Google App Engine does not support Hibernate:http://groups.google.com/group/google-appengine-java/web/will-it-play... - Hibernate Versions: All Status: INCOMPATIBLE * You cannot currently use Hibernate directly. The differences between the App Engine datastore and SQL were too great to get the standard Hibernate up and running under App Engine. App Engine does support JDO and JPA, so you may be able to convert your Hibernate code to use one of these ORM interfaces. - I'm using JPA with Hibernate Entity Manager. So, how can I configure App Engine to use my existing JPA backend on a Postgresql database? I'm even willing to change the JPA persistence provider from Hibernate Entity Manager implementation to the Data Nucleus JPA implementation but I'm struggling to get the this configured properly. Are there any example of folks configuring alternative databases with JPA? The documentation I've read so far seems to assume (or perhaps dictate) that I'm going to use JDO with Data Nucleus. I just want to get this data storage situation resolved as quickly as possible so I can get back to working on a AJAX front end. Currently, I don't even plan on marshaling any of my POJOs the client. My AJAX client will just use XML to communicate with my servlets.- Hide quoted text - - Show quoted text - Additional reading and fumbling around has got me believing my persistence.xml should more like this (note I changed the provider classname based on documentation you referred me to --- thanks). persistence-unit name=huntingMap providerorg.datanucleus.store.appengine.jpa.DatastorePersistenceProvider/ provider properties property name=datanucleus.storeManagerType value=rdbms/ property name=datanucleus.ConnectionDriverName value=org.postgresql.Driver/ property name=datanucleus.ConnectionURL value=jdbc:postgresql://localhost:5432/mydatabasename/ property name=datanucleus.ConnectionUserName value=myusername/ property name=datanucleus.ConnectionPassword value=myuserpassword/ /properties /persistence-unit but now I think I need to round-up a datanucleus-rdbms jar but I'm not sure which release is most compatible with the app-engine pieces I've already downloaded via the gwt appengine eclipse plugin. I using postgresql 8.3 if that at all matters. Am I on the right track here? Any suggestions regarding datanucleus-rdbms versions? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---