Re: [appengine-java] Re: Xalan
It seems that the classes of the JSTL are loaded by a different classloader than the webapp classloader. Because this class loader does not have xalan in place, it fails. Could you please add xalan to the classpath of this classloder? (If i do this in the eclipse plugin, it works, but only in the local dev environment of course). I added this as a comment on issue 2180. Regards, Stephan metamesh schrieb: Hi, I have the same problem when using the xml tags of jstl with appengine 1.2.6. I also tried to put the missing class into the WEB-INF/classes/... folder but still no success. Note that http://code.google.com/p/googleappengine/issues/detail?id=2180 has not a fix but only verifies that the class org.apache.xpath.VariableStack is available at compile time but not at run time. Regards, Stephan On Oct 5, 7:18 pm, Jason (Google) apija...@google.com wrote: Can you confirm that the tip inhttp://code.google.com/p/googleappengine/issues/detail?id=2180(see the second comment) works for you? - Jason On Wed, Sep 30, 2009 at 9:17 AM, Maniacs sony.trico...@gmail.com wrote: I tried to use JSTL xml tags and I got the following exception :java.lang.NoClassDefFoundError: org/apache/xpath/ VariableStack However, I put in WEB-INF/lib the file xalan.jar. Is xalan incompatible with app-engine ? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@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=.
Re: [appengine-java] Problem in uploading jsp file
You are using a Java Runtime Environment (JRE) which does not include a compiler. You have to use a JDK instead. Regards, Stephan sahil mahajan schrieb: Hello I am working on java google app engine. When I try to upload my application, I receive following error Error Details: Nov 24, 2009 10:18:11 PM org.apache.jasper.JspC processFile INFO: Built File: \addressbook.jsp java.lang.IllegalStateException: cannot find javac executable based on java.home , tried C:\Program Files\Java\jre1.6.0_04\bin\javac.exe and C:\Program Files\ Java\bin\javac.exe Unable to upload app: cannot find javac executable based on java.home, tried C: \Program Files\Java\jre1.6.0_04\bin\javac.exe and C:\Program Files\Java\bin\ja vac.exe If I remove addressbook.jsp file, error does not occur What could be the reason? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: App instance recycling and response times - is there solution?
Jeff, in one point i disagree. In a high available einvironment you would have a cluster of load balanced application servers and you would deploy new versions of your app in turn, one at a time. So if one instance is down the other(s) will continue serving your users (though it might require sticky sessions). Of course, this is a must for enterprise applications. Regards, Stephan 2010/1/13 Jeff Schnitzer j...@infohazard.org I've been thinking about this issue a little. It's not quite as straightforward as just keeping an instance warm. Even if you have an app that gets multiple hits per second, there will still be cold starts: * When a new instance comes online to serve more demand. * When you redeploy a version of your app. Is appengine smart about letting new instances added to the pool warm up before serving requests? It's hard to tell from my logs but it doesn't look like it. I know appengine is *not* smart about warming up an instance before redeploying. When I redeploy, some large number of users must wait while the appserver(s) startup. One thing to keep in mind during these discussions is how other Java EE environments solve this problem: They *don't*. For a long time it's been assumed in the EE development that server initialization time is irrelevant, and we grew fat libraries that take tens of seconds to minutes to start up. The problem is, this time has *never* been irrelevant - even in a production environment you must deploy new versions of your app, and none of the appservers I'm familiar with are smart enough to keep serving off the old version while the new one loads. Users with unlucky timing always got screwed. We just didn't care because we only deployed code once a week and we added/removed server instances far less often than that. Well guess what, now it's easy - you can deploy up to 1,000 times per day just by clicking a button in eclipse, and server provisioning is now not only trivial but 100% transparent to you. Just try that with WebSphere! You aren't going to like this, but here's the only answer that isn't going to piss off your customers: Stop using Spring. Stop performing eager initialization. Stop assuming that users don't see startup time. Yes, change the way you write code. Jeff On Tue, Jan 12, 2010 at 1:11 PM, Don Schwarz schwa...@google.com wrote: Make sure you are using offline precompilation. We are always working on optimizations to decrease the latency of loading requests, but here are some other tips: http://googleappengine.blogspot.com/2009/12/request-performance-in-java.html On Tue, Jan 12, 2010 at 3:01 PM, Locke locke2...@gmail.com wrote: I agree that making users wait 20 seconds for your app to load is not adequate for the vast majority of apps. I also agree that reengineering everything to try and hide load times from users is a poor solution in most cases. Using cron to keep your app loaded will not consume your quota; it will actually conserve your quota. Every time your app loads you will be billed for 20s of CPU time. If you keep it loaded, you will only be billed for a few milliseconds per 'keep-alive' cron execution. However, the Google engineers who post here have recommended against doing this. If everyone did it, appengine might run out of resources (RAM, I assume). I imagine that Google will need to either find a way to load apps in 1/10th the time (the ideal solution), raise prices significantly, or ration resources in some other way. If I may make a suggestion to the Google engineers: offer a keep my app loaded option and make it available ONLY for billing-enabled apps. Disable cron for apps which are not billing-enabled, so that people who just want free hosting or are merely toying with appengine won't be using up resources all the time. This way, the people who have shown that they are serious about appengine (by laying their cash down) won't be driven away by the people who are just fooling with it. Yes, we are seriously considering something like this. Please star this issue for updates: http://code.google.com/p/googleappengine/issues/detail?id=2456 On Jan 12, 1:43 pm, Konrad konradpaw...@gmail.com wrote: I asked same question on Stack Overflow (http://stackoverflow.com/ questions/2051036/google-app-engine-application-instance-recycling-and- response-times). So far proposed solutions (in SO thread and found on other websites) do not satisfy me. Creating cron or any other kind of periodic HTTP requests to keep instance up and running make no sense. First - there is no evidence that this instance will serve next coming request (eg. from different network location etc.), second - it will consume Quota (which is less a problem). Other solution - refactoring app - replacing critical functionality with lightweight servlet - sounds better, but is GAE forcing to go
Re: [appengine-java] Content caching and Compression
AFAIK gzip compression is turned on by default. You can verify this by looking at the content-encoding response header (i use the Live HTTP headers plugin for firebug/firefox). Regards, Stephan 2010/2/15 zainul franciscus zainul.francis...@gmail.com I was browsing through Google App Engine feature documentation. In certain page I found that Google App Engine does not support gzip compression nor content caching but on other page Google said that they have incorporated gzip compression feature in app engine. Does any body know whether google app engine support gzip compression and content caching ? If yes how can we do it. Cheers, Zainul Franciscus -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Mail API / Sender Email Address
You could try to login to app-engine with your google apps account under https://appengine.google.com/a/YOURDOMAIN.COM/ Of course you have to create and deploy a new app instance in this account. I guess it is related to the fact that real google accounts (like google mail) and google apps accounts use different authentication infrastructures. Regards, Stephan 2010/2/14 Henning henning2...@hotmail.de Hello, I have set up my own .com domain on Google apps, set the CNAME entries and I can now access my google app engine project through my own .com address rather than appspot. I set up google mail as a google app on my domain too. If I have now a google mail account like m...@mydomain.com and my app runs on www.mydomain.com how can I send with my application emails with sender address m...@mydomain.com ? In the doc there it is said that only addresses of admins or developers are valid. I tried to create a new developer m...@mydomain.com but that does not work (no invitation email ever arrives). If I send an email from hotmail to m...@mydomain.com it arrives. What can I do ? I have a registration form and the password should be sent to the user by email. I don't want to provide the user my fancy hotmail address I used to register on app engine / google accounts originally. Thank you, Henning. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Null Pointer Exception at the time of transaction commit.
Could you please provide the source of your Employee and Department classes? And AFAIK you must not use full qualified class names in queries but the simple class name (Department only). Regards, Stephan 2010/2/16 Sushama Khadilkar sush.khadil...@gmail.com package com.wissen.enterprisebysush.server; import java.util.List; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; import com.google.gwt.user.client.Window; import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.wissen.enterprisebysush.client.GreetingService; import com.wissen.enterprisebysush.server.domainobject.Department; import com.wissen.enterprisebysush.server.domainobject.Employee; /** * The server side implementation of the RPC service. */ @SuppressWarnings(serial) public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { EntityManagerFactory emf = Persistence.createEntityManagerFactory(transactions-optional); public String greetServer(String input) { String serverInfo = getServletContext().getServerInfo(); String userAgent = getThreadLocalRequest().getHeader(User-Agent); return Hello, + input + !brbrI am running + serverInfo + .brbrIt looks like you are using:br + userAgent; } @SuppressWarnings(unchecked) public void addDept(String dept_name, String dept_head) { EntityManager em = null; try { em = emf.createEntityManager(); em.getTransaction().begin(); Department d = new Department(); d.setDept_name(dept_name); d.setHead(dept_head); Query q = em.createQuery(select from com.wissen.enterprisebysush.server.domainobject.Department d); ListDepartment deptList = q.getResultList(); for (Department dept : deptList) { System.out.println(Department name: + dept.getDept_name()); } em.persist(d); } finally { em.getTransaction().commit(); em.close(); } } public void addEmp(String emp_name, String emp_sal, String did) { EntityManager em = emf.createEntityManager(); try { String s = did; EntityTransaction transaction = em.getTransaction(); transaction.begin(); System.out.println(value of Department_name is:: + s); System.out.println(Transaction is active and is::+transaction); //Query q = em.createQuery(select dept_id from com.wissen.enterprisebysush.server.domainobject.Department d where d.dept_name = ?1); //q.setParameter(1, s); //System.out.println(Name of Department is:: + s); //Department dept = (Department) q.getSingleResult(); Query q = em.createQuery(select from com.wissen.enterprisebysush.server.domainobject.Department d); Department dept = (Department) q.getResultList().get(0); System.out.println(Name of Department is:: + dept.getDept_name()); //System.out.println(Query executed Successfully!! + q.getSingleResult()); Employee e = new Employee(); e.setEmp_name(Abcdh); e.setEmp_sal(5000); e.setDepartment(dept); em.persist(e); System.out.println(Transaction: + transaction); transaction.commit(); em.close(); } catch (NullPointerException e) { e.printStackTrace(); System.out.println(Exception:: + e.getCause()); } finally { } } } Output is:: The server is running at http://localhost:8090/ value of Department_name is::Production Transaction is active and is::org.datanucleus.jpa.entitytransactioni...@1a21c7d Name of Department is::Accounts Transaction: org.datanucleus.jpa.entitytransactioni...@1a21c7d java.lang.NullPointerException Exception::nullat com.google.appengine.api.datastore.KeyFactory.stringToKey(KeyFactory.java:181) at org.datanucleus.store.appengine.DatastoreElementContainerStoreSpecialization.extractElementKey(DatastoreElementContainerStoreSpecialization.java:170) at org.datanucleus.store.appengine.DatastoreAbstractCollectionStoreSpecialization.contains(DatastoreAbstractCollectionStoreSpecialization.java:57) at org.datanucleus.store.mapped.scostore.AbstractCollectionStore.contains(AbstractCollectionStore.java:116) at org.datanucleus.sco.backed.List.contains(List.java:455) at
Re: [appengine-java] how to do initialization at startup?
Your app becomes shut down if it does not receive any requests for some time. After that, the next request will initiate a new startup sequence, so the implementation of the servlet spec is correct. You should also implement ServletContextListener.contextDestroyed() to perform cleanup of your data, if needed. Regards, Stephan 2010/2/17 AJ Chen ajc...@web2express.org For standard web app, I use a context listener servlet to do initialization at startup. This also works in eclipse with GAE plugin, i.e. the context listener is called only once at startup. But, it does not work in production because the context listener servlet is called frequently. It seems GAE restarts the context or something that triggers the call to the listener servlet. SO, the question is: what's the right way to do one-time initialization (e.g. pre-load data) in GAE? Maybe GAE does not have the concept of initialization. Any suggestion is appreciated. -aj -- AJ Chen, PhD Chair, Semantic Web SIG, sdforum.org http://web2express.org @web2express on twitter Palo Alto, CA, USA 650-283-4091 *Monitoring social media in real time* -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Null Pointer Exception at the time of transaction commit.
In your addEmp method i would add dept.getEmployee().add(e) after you instantiate your new employee object. If i remember correctly, according to the JPA spec, managing relationships is up to you. BTW i would refactor the name of the list field employee to employees (and its get and set method). Regards, Stephan 2010/2/17 Sushama Khadilkar sush.khadil...@gmail.com Thanks Stephan Hartmann, But there is another problem now . Does the DataStore will have a Foreign Key of Department in Employee? And , is it visible in the Employee table? Following are my POJO's :: /Department/// import java.io.Serializable; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import com.google.appengine.api.datastore.Key; /** * @author Sushama Khadilkar. * * Create Date : 17-Feb-2010 */ @SuppressWarnings(serial) @Entity public class Department implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Key dept_id; private String dept_name; private String head; @OneToMany(mappedBy=department) public ListEmployeeemployee; public Key getDept_id() { return dept_id; } public void setDept_id(Key dept_id) { this.dept_id = dept_id; } public String getDept_name() { return dept_name; } public void setDept_name(String dept_name) { this.dept_name = dept_name; } public String getHead() { return head; } public void setHead(String head) { this.head = head; } public ListEmployee getEmployee() { return employee; } public void setEmployee(ListEmployee employee) { this.employee = employee; } } //Employee/ import java.io.Serializable; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import com.google.appengine.api.datastore.Key; /** * @author Sushama Khadilkar. * * Create Date : 17-Feb-2010 */ @SuppressWarnings(serial) @Entity public class Employee implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Key emp_id; private String emp_name; private String emp_sal; @ManyToOne(cascade = CascadeType.ALL) private Department department; public Key getEmp_id() { return emp_id; } public void setEmp_id(Key emp_id) { this.emp_id = emp_id; } public String getEmp_name() { return emp_name; } public void setEmp_name(String emp_name) { this.emp_name = emp_name; } public String getEmp_sal() { return emp_sal; } public void setEmp_sal(String emp_sal) { this.emp_sal = emp_sal; } public Department getDepartment() { return department; } public void setDepartment(Department department) { this.department = department; } } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Caching pages.
You may consider using OSCache (http://www.opensymphony.com/oscache/) for caching parts of JSPs with its JSP tags or whole responses (don't know if it works with GAE). Cheers, Stephan 2010/2/13 abhi abhishek9...@gmail.com @ bimbo jones - Thanx , thats a good idea, i guess i found out how to use memcache for jsps , jsp has a buffer , so i can save it to memcache :) @Brain - The server should cache JSP's for you- what do you mean by that? Do you mean browser cache? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Suggested migration path for Web app using realm auth and offering web service.
For authentication you could use Securityfilter ( http://securityfilter.sourceforge.net/) or Acegi (Spring Security, http://www.acegisecurity.org/) Don't know if either of them works with GAE. About Acegi there has been little discussion here on the list i think. Regards, Stephan 2010/2/17 AlexC alexcurti...@gmail.com Hi all, I have an app which is running on Glassfish and serves data via web services and BlazeDS. Authentication is handled via realm authentication on the app server. My client side is a flex app which launches from a secure folder once the user has authenticated. Persistence is currently in mysql but all via JPA. Until now, I've thought it's too much hassle to try and get it working on GAE but being someone who doesn't know when to quit, I'd like to try again. Does this kind of app sound doable on GAE without too much re-work ? I think GAE support WS now (via Hessian ?) but what about realm authentication ? (My clients don't have google accounts so I can't use that). Is there any substitute for realm authentication in GAE land ? Thought I'd ask you all here before I try again in case I'm about to run headlong into a world-of-hurt! Any pointers would be great. Tks Alex -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] filereading error
i think the correct pattern is **/*.csv 2010/2/17 cscsaba strongfr...@gmail.com Hello, What is the right way to reading files on GAE I made this preparation below in appengine-web.xml ... resource-files include path=/**.csv / /resource-files ... but I got this error: exception :access denied (java.io.FilePermission \\csv\countries.csv read) / java.securit nied (java.io.FilePermission \\csv\countries.csv read) Thanks ahead. cscsaba -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: filereading error
How do you access your file? I use ServletContext.getResourceAsStream(/csv/countries.csv); If you use java.io.File, AFAIK you have to use a path relative to your webapp folder without leading slash, e.g. new File(csv/countries.csv); regards, Stephan 2010/2/17 cscsaba strongfr...@gmail.com Hello Stephan, I have tried several combination of include path without result. http://imagebin.org/85235 It seems to me something other factor prevent reading this csv. Have you tried to read resource file on GAE ? On Feb 17, 7:22 pm, Stephan Hartmann hartm...@metamesh.de wrote: i think the correct pattern is **/*.csv 2010/2/17 cscsaba strongfr...@gmail.com Hello, What is the right way to reading files on GAE I made this preparation below in appengine-web.xml ... resource-files include path=/**.csv / /resource-files ... but I got this error: exception :access denied (java.io.FilePermission \\csv\countries.csv read) / java.securit nied (java.io.FilePermission \\csv\countries.csv read) Thanks ahead. cscsaba -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: App Engine and Spring slow start up
The problem is that the initialization of your app takes longer than 30 seconds. Pinging your app doesn't help when the app is restarted due to redeployment or maintenance, or when high traffic demands a second instance. You should try to reduce your startup time. regards, Stephan 2010/2/17 luijar luis.j.aten...@gmail.com Great, all of our projects are Spring enabled lol. But I guess it's good that we are not the only ones seeing this, hopefully it gets a little more visibility. We have a cron job (1 min) that tries to keep our application alive by hitting a URL, but it does not do a very good job. It's frustrating and we don't even have access to the 500 page to tell the user to retry or go somewhere else. On Feb 17, 11:21 am, oth other...@gmail.com wrote: Yes we have seen this problem a lot. Per our tests, an application becomes idle after a minute of non activity. So, the unfortunate reality is that you need to keep your app alive by simulating activity on it. Or go the non Spring route. Thanks On Feb 16, 4:14 pm, luijar luis.j.aten...@gmail.com wrote: Hello Google App Engine forum, We have been seeing ever since we deployed our applications (currently 3 of them) that when our application instances become idle (they have not been hit for x amount of seconds) subsequent requests return with a 500 response. Logs show a hard deadline exceeded error com.google.apphosting.runtime.HardDeadlineExceededError: This request (32306ebe63b71ab0) started at 2010/02/12 20:39:11.984 UTC and was still executing at 2010/02/12 20:39:41.225 UTC. at com.google.appengine.runtime.Request.process-32306ebe63b71ab0(Request.java) And the first line of the log message has the following : 02-12 12:39PM 14.088 javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext Question: Has anyone else seen this behavior? How long does it take for an application instance to become idle? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: how to do initialization at startup?
Hi AJ, Your consideration is not specific to GAE. You always have the potential risk that a server could crash and then all your unstored data changes will get lost. So for critical data you should use a write-through cache. However, in a distributed environment like GAE (but not specific to GAE, every standard conform servlet container will support this) you have to take special care to keep the caches of all nodes in sync, or just use a distributed cache like Memcache in GAE. Regards, Stephan 2010/2/17 AJ Chen ajc...@web2express.org yes, the new console is a good addition. however, because the app can be shutdown/restarted by GAE at any time, you would still need to put the initialization code in context listener (or similar place) so that it will be called automatically when the app is restarted. I just realize a potential major issue in GAE environment, which may require some paradigm shift in server programming (at least to me). Usually, one the server side, you may have a singleton class to keep some data objects closeby as well as updating the data at run time. The data may change so fast that they are conveniently kept in memory for some time before put into permanent storage. This is safe because the web server does not kill the app at will. Now that GAE may kill the app and restart it at any time, keeping data in memory becomes a big potential problem because the data will be gone after the app starting. This means you would have to save the new data into datastore immediately. If you have lots of intermediate data or temporary data, you have to save them to datastore immediately as well. This always-using-datastore situation created by GAE may slow down some applications in addition to a lot more coding for storage. Without knowing what exactly happens when GAE automatically shutdowns the app, my worry may be wrong. Does anyone see the similar issue? Any suggestion for safely keeping data in memory? -aj On Wed, Feb 17, 2010 at 10:00 AM, Vlad Skarzhevskyy skarzhevs...@gmail.com wrote: There is an Custom Admin Console pages in new SDK 1.3.1. I think the best place to preload the data to your application is using servlet/page exposed in this Console. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- AJ Chen, PhD Chair, Semantic Web SIG, sdforum.org http://web2express.org @web2express on twitter Palo Alto, CA, USA 650-283-4091 *Monitoring social media in real time* -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: how to do initialization at startup?
A reliable, high available, scalable and failover tolerant application requires a distributed environment where various application server instances run in different Java VMs on different machines with some kind of loadbalancing in front. So many things that you have to rethink arise from this change from a single server / single Java VM approach to a distributed environment with different Java VMs that do not share the same memory - no matter if it is GAE, JBoss, Tomcat or whatever application server that supports clustering and distributed webapps. 2010/2/18 tsp...@green20now.com tsp...@green20now.com AJ, With GAE, many fundamental assumptions should be questioned. For example, why do you need a counter? Most developers use a counter for the key, jusst because they always have. With GAE you need to often challange the fundamental requirements and rethink the approach. Overall all I think it is good for many developers since thy get in a rut and aply the same solution to all problems (over using a design pattern cause it always worked before) Sent from my Verizon Wireless Phone - Reply message - From: AJ Chen ajc...@web2express.org Date: Wed, Feb 17, 2010 10:52 PM Subject: [appengine-java] Re: how to do initialization at startup? To: google-appengine-java@googlegroups.com There is significant difference between dealing with infrequent crash event and dealing with frequent shutdown by GAE. The difference is huge when you want to have some intermediate data in memory for performance reason. When there is a system crash, you just start over, which is tolerable in most cases. Restarting app by GAE is a total different story because it makes storing data in memory no longer a valid approach. For my google app, I see it is restarted by GAE even after a few minutes. My usual singleton object become useless because the data objects it holds are recreated every few minutes. This is why I think GAE's frequent restart behavior is a constraint forcing me (probably other developers) to change design pattern, which may be good or bad. In this case, the change is not good, I'm afraid. Let's look at the counter example. Normally it's trivial to keep a counter of some sort on the server. But in GAE, it's non-trivial. You can't get a total count from datastore easily and storing a counter in memory is not reliable. SO, you have to do some creative work-around as proposed in GAE documentation. Am I making sense? In any case, I'm hoping someone has an easy/reliable way to keep tracking a counter in memory within GAE. I'll appreciate any suggestion. -aj On Wed, Feb 17, 2010 at 1:56 PM, Stephan Hartmann hartm...@metamesh.dewrote: Hi AJ, Your consideration is not specific to GAE. You always have the potential risk that a server could crash and then all your unstored data changes will get lost. So for critical data you should use a write-through cache. However, in a distributed environment like GAE (but not specific to GAE, every standard conform servlet container will support this) you have to take special care to keep the caches of all nodes in sync, or just use a distributed cache like Memcache in GAE. Regards, Stephan 2010/2/17 AJ Chen ajc...@web2express.org yes, the new console is a good addition. however, because the app can be shutdown/restarted by GAE at any time, you would still need to put the initialization code in context listener (or similar place) so that it will be called automatically when the app is restarted. I just realize a potential major issue in GAE environment, which may require some paradigm shift in server programming (at least to me). Usually, one the server side, you may have a singleton class to keep some data objects closeby as well as updating the data at run time. The data may change so fast that they are conveniently kept in memory for some time before put into permanent storage. This is safe because the web server does not kill the app at will. Now that GAE may kill the app and restart it at any time, keeping data in memory becomes a big potential problem because the data will be gone after the app starting. This means you would have to save the new data into datastore immediately. If you have lots of intermediate data or temporary data, you have to save them to datastore immediately as well. This always-using-datastore situation created by GAE may slow down some applications in addition to a lot more coding for storage. Without knowing what exactly happens when GAE automatically shutdowns the app, my worry may be wrong. Does anyone see the similar issue? Any suggestion for safely keeping data in memory? -aj On Wed, Feb 17, 2010 at 10:00 AM, Vlad Skarzhevskyy skarzhevs...@gmail.com wrote: There is an Custom Admin Console pages in new SDK 1.3.1. I think the best place to preload the data to your application is using servlet/page exposed in this Console. -- You received
Re: [appengine-java] How to pass paramters to servlet deployed on GAE?
You say http://appid.appspot.com/test1/ hits the servlet. What happens without a trailing slash? Is it redirected? How does your servlet mappings look like? 2010/2/18 barak barak.ya...@gmail.com Hello all, I've a test servlet to deploy on gae platform, which just read paramters from the request and and sysout them. While deploying on the development server (via Eclipse plugin) everything works as expected, i.e. http://localhost:/test1?p1=v1 causes the servlet to display the parameter and its value to the log file. When deployed to GAE, however, the results are different. Bringing the browser to http://appid.appspot.com/test1?p1=v1 causes the browser show link-is-broken screen. In the log files there messages like GET / test1?p1=v1/ HTTP/1.1 404. Accessing http://appid.appspot.com/test1/ do hit the servlet, but the parameters map in the request is empty. So, what is the right way to pass parameters to servlets? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: How to pass paramters to servlet deployed on GAE?
As url-patter i would use url-pattern/test1/url-pattern or, if you need a path info in your servlet, at least url-pattern/test1*/url-pattern 2010/2/18 barak barak.ya...@gmail.com servlet servlet-nametest1/servlet-name servlet-classcom.TestServlet/servlet-class /servlet servlet-mapping servlet-nametest1/servlet-name url-pattern/test1/*/url-pattern /servlet-mapping On Feb 18, 6:41 pm, Stephan Hartmann hartm...@metamesh.de wrote: You sayhttp://appid.appspot.com/test1/hits the servlet. What happens without a trailing slash? Is it redirected? How does your servlet mappings look like? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Problem with persistance
I think in your Offer class you should use getter/setter for mOfferDetail (not a constructor to set the field). 2010/2/25 Anton Klotz dipl.ing.akl...@googlemail.com Hi Jake, thanks a lot for your answer. After changing the mappedBy statement to child like this: @Persistent(mappedBy = mOfferDetails) private Offer mOffer; and removing mappedBy from parent, Offer object seems to be persisted. But when I get this object from the database with: public Offer getOfferWithId (long id) { return pm.getObjectById(Offer.class, id); } and try to access child with System.out.printf(String.format (Title %s, mOffer.getOfferDetails().getOfferDescription() )); I get following error: java.lang.NullPointerException at com.sparradar.server.action.actioncommands.ShowOfferDetailsActionCommand.execute(ShowOfferDetailsActionCommand.java: 41) at info.rk.vaadinapp.manager.urldispatching.URLActionDispatcher.handleURI(URLActionDispatcher.java: 90) at com.vaadin.ui.Window.handleURI(Window.java:358) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleURI(AbstractCommunicationManager.java: 1830) at com.vaadin.terminal.gwt.server.CommunicationManager.handleURI(CommunicationManager.java: 311) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleURI(AbstractApplicationServlet.java: 912) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java: 471) at com.vaadin.terminal.gwt.server.GAEApplicationServlet.service(GAEApplicationServlet.java: 231) 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.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java: 51) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1084) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java: 43) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1084) at 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: 70) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 139) at com.google.appengine.tools.development.JettyContainerService $ApiProxyHandler.handle(JettyContainerService.java:352) 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) I don't get the error if I try to access eg mOffer.getId(). So my interpretation of this error is that either the child object was not saved in the database, or it was not fetched from the database. I don't know how to verify this. Thanks, Anton On 24 Feb., 20:17, Jake jbrooko...@cast.org wrote: http://code.google.com/appengine/docs/java/datastore/relationships.ht... You create a bidirectional one-to-one relationship using fields on both classes, with an annotation on the child class's field to declare that the fields represent a bidirectional relationship. The field of the child class must have a @Persistent annotation with the argument mappedBy = ..., where the value is the name of the field on the parent class. From what I see, you have it backwards, with the annotation in the parent class. Jake On Feb 24, 4:26 am, Anton Klotz
Re: [appengine-java] Re: Problem with persistance
2010/2/25 datanucleus andy_jeffer...@yahoo.com I think in your Offer class you should use getter/setter for mOfferDetail (not a constructor to set the field). Can't see why that would make the slightest difference. What does appear iffy is that if you have a bidirectional relation then the user is responsible for setting both sides. I only see Offer.mOfferDetails being set and not the other side. isn't setting Offer.mOfferDetails enough for making Offer.getOfferDetails() returning not null, even if it is a bidirectional relation? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] getting host headers in Java
It is part of the servlet spec: javax.servlet.ServletRequest.getServerName() 2010/3/3 deuce4 lynx...@gmail.com Hi, I would like to use the subdomains of my appspot.com domain to set initial user parameters. I'm not really sure how to do this in Java. Google provides the Python example self.request.headers[Host]. Can anyone help with the Java code to parsing and processing subdomains in the appspot.com url? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Sporadic problems with very high response times
Hi Ikai, i wonder what exactly happens in a loading request before the first component (piece of code) of an app is hit? In my case it is a ServletContextListener and the time between the first log entry of the container for the request and the the log entry from my contextInitialized method takes more than 5 seconds, e.g.: 03-04 *10:23AM 27.831* /about.html 200 8958ms 6483cpu_ms 8api_cpu_ms 1kb Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) - - [04/Mar/2010:10:23:36 -0800] GET /about.html HTTP/1.1 200 1606 Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) W 03-04 *10:23AM 33.142* StartupListener contextInitialized: context initialization starting at: Thu Mar 04 18:23:33 UTC 2010 Is this to be expected as normal? My app is also cycled out after 1 minute or so of inactivity. Regards, Stephan 2010/3/4 Ikai L (Google) ika...@google.com Michael, (Molson from the IRC office hours?) Some small percentage of your application's requests will always be loading requests, as this is us spinning up a new instance of your application to either grow for capacity or tearing down your instance and putting it back up as resource allocation demands. We can't predict when this will happen. You may want to star this issue: http://code.google.com/p/googleappengine/issues/detail?id=2456 Startup time is generally a function of several different things: - Spinning up the JVM (Relatively cheap, but on the order of magnitude of 500ms - 1s) - How many dependencies are you loading? (Relatively cheap compared to JVM spinup) - Framework init (Can be VERY expensive - loading up a dynamic language runtime will always take a few seconds. Some frameworks will also scan every class in your classpath. Spring, for instance, does this to look for annotations eagerly on init time) Strategies to counteract these factors include optimizing for lazy loading, which spreads the total load time across acess to several different resources. Not many existing frameworks do this. As your application grows, loading requests should account for a smaller and smaller percentage of your total requests. I've seen solutions with rich applications that show a static page loading dynamic resources as a general landing page. This doesn't solve the load time solution, but it meets the user halfway by making a web app appear to load faster as opposed to causing a user's brower window to be blank while waiting for a request to be handled. On Tue, Mar 2, 2010 at 4:32 PM, Michael michael.ol...@gmail.com wrote: Looking at my App Engine logs, I see troubling results when viewing the response times for requests. In my current log set, the first 80 requests all complete in under 100 ms with less than 100 ms of cpu or api time. Then, oddly, the 83rd request, from the exact same client with the exact same request parameters, takes 7,192 ms to respond with 10,123 cpu ms (and 12 api ms). These kinds of spikes are dotted throughout my logs. They occur in less than 1% of cases, as far as I can tell, but the spikes are not just large; they're enormous. I know for a fact that the request parameters and returned data were identical to the requests several seconds before and after from the same client, but the request took about 20 times longer to serve. Does anyone know what causes these large spikes in response time, and can anyone share tricks to help alleviate these spikes? I know that it is somehow related to instantiating the JVM, but I don't know: - how to reduce the startup time of the JVM - how to predict when GAE will try to start a new JVM Thanks in advance for any advice, - Michael -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Ikai Lan Developer Programs Engineer, Google App Engine http://googleappengine.blogspot.com | http://twitter.com/app_engine -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To
Re: [appengine-java] what if I hit memory limit ?
You should use memcache instead of your servlet env. The memcache service will evict values if you run out of memory. 2010/3/10 Prashant Gupta nextprash...@gmail.com Hi, I have designed my app to keep data (within servlet env.) for all previous requests. For each request it will first search the data in servlet env. store, if it doesn't find the data here it will fetch data from datastore and append the same to servlet env. store. So, if the same servlet lives for longer duration it might accumulate lots of data. What's the risk here? What's the upper limit of memory use? What will happen if my app hit this upper limit? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
Your JSP file should be not a relative path but absolute, i.e. jsp-file*/absoulute/path/to/*mountain.jsp/jsp-file 2010/3/16 Chris christoph.wor...@gmail.com Hi, I've got a strange problem with (I believe) my servlet mapping. I'm trying to map all requests for /mountain/* to a JSP file called mountain.jsp. It works fine when I run it on my localhost, but when I upload the project to AppEngine, I get errors like the following: /mountain/5429370/index.html/index.html/index.html/index.html/ index.html/index.html/index.html/index.html/...etc The /index.html is repeated over and over until Chrome gives me the following error: Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects. Chrome suggests clearing the cookies for the site, but I there are no cookies to clear. Here is my web.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-namemountain/servlet-name jsp-filemountain.jsp/jsp-file /servlet servlet-mapping servlet-namemountain/servlet-name url-pattern/mountain/*/url-pattern /servlet-mapping !-- Default page to serve -- welcome-file-list welcome-filePeakPeekSite.html/welcome-file /welcome-file-list /web-app Has anyone seen this problem or understand what is going on? Thanks much, Chris -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Servlet request parameters empty
if you want to get your data as request parameter, you should use GET instead of POST and /or let the default contentType application/x-www-form-urlencoded and create your json object as either var json = {name: test}; // and let jquery convert it to a query string or var json = name=test; // the desired query string regards, Stephan 2010/5/4 Rob robertastanfi...@gmail.com I'm running Google App Engine through IntelliJ Idea and am posting data to a Servlet using jQuery.ajax. I'm hitting the Servlet without issue and can return data in the response, however, the request parameters are always null; I cant seem to POST data. Where am I going wrong? var json = JSON2.stringify({name: test}); $.ajax({ type: POST, url: service, data: json, contentType: application/json; charset=utf-8, dataType: json, async: async, success: function(o) { o = $.serviceHelper.jsonSerialize(o); callback(o); }, error: this.dataServiceError }); protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException { PrintWriter out = response.getWriter(); response.setContentType(text/json); String json = gson.toJson(request.getParameter(name)); out.println(json); } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Servlet request parameters empty
2010/5/4 Rob robertastanfi...@gmail.com That did the trick, I love you man! :O) :-) Now, how would I perform the same with a POST if I needed to? If you want to POST your data as key/value pairs like with GET, and jQuery puts it into the body of the request instead of the query string (i don't know the implementation details, request parameters as query string are just fine even if it is a POST request) you have to make sure that the contentType is the default application/x-www-form-urlencoded. Just give it a try. However, if you want to post the data as JSON fragment (as i would assume from your original post from the contentType of application/json), i think setting processData to false could do it. But in your servlet you won't get the values as request parameters anymore. Instead you have to parse the input stream of the request, e.g. with Gson to a Java object. regards, Stephan On May 4, 2:07 am, Stephan Hartmann hartm...@metamesh.de wrote: if you want to get your data as request parameter, you should use GET instead of POST and /or let the default contentType application/x-www-form-urlencoded and create your json object as either var json = {name: test}; // and let jquery convert it to a query string or var json = name=test; // the desired query string regards, Stephan 2010/5/4 Rob robertastanfi...@gmail.com I'm running Google App Engine through IntelliJ Idea and am posting data to a Servlet using jQuery.ajax. I'm hitting the Servlet without issue and can return data in the response, however, the request parameters are always null; I cant seem to POST data. Where am I going wrong? var json = JSON2.stringify({name: test}); $.ajax({ type: POST, url: service, data: json, contentType: application/json; charset=utf-8, dataType: json, async: async, success: function(o) { o = $.serviceHelper.jsonSerialize(o); callback(o); }, error: this.dataServiceError }); protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException { PrintWriter out = response.getWriter(); response.setContentType(text/json); String json = gson.toJson(request.getParameter(name)); out.println(json); } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Session and AppEngine
What is your logic that initiates a session? The container does not create a session if there is no need for it. In a servlet you can initiate a session by calling HttpServletRequest.getSession(true) and in a JSP by adding the attribute session=true to a page directive. Regards, Stephan 2010/5/5 Christian Goudreau goudreau.christ...@gmail.com Hummm I got a weird issue I added to my appengine-web.xml this line : sessions-enabledtrue/sessions-enabled But no JSESSIONID cookie is created. Anyway Idea why ? Christian -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: session management
Keep in mind that sessions managed by the servlet container expire after a specific time of inactivity on the server side, so if a user comes back after a while with his old session cookie, he will still get a new session. According to the servlet spec, you can obtain this value with HttpSession.getMaxInactiveInterval() and change it with HttpSession.setMaxInactiveInterval(int), with a value of -1 meaning never to expire. Regards, Stephan 2010/5/27 lembas keremo...@gmail.com thanks romesh. I was on vacation did not see your message. sorry for a late answer. I do not use cookies for managing session. Google does. JESSIONID cookies is created on server by App Engine anyway. I just extend its expiration date. Is it possible to implement remember me functionality without cookies? On May 3, 11:22 am, romesh soni soni.rom...@gmail.com wrote: Hey Ikai, sorry I referred you by mistake.. My msg was for lembas On Mon, May 3, 2010 at 1:23 PM, romesh soni soni.rom...@gmail.com wrote: Hi Ikai, the way you are managing session is not good. actually you are using cookies for managing session, which is not a good thing. instead session management is done at server side, not client side. On Mon, May 3, 2010 at 1:18 PM, Ikai L (Google) ika...@google.com wrote: I'm not sure how this mitigates use of the _ah_session records that are created. Anytime you set an attribute, it will use this. If you're worried about _ah_session getting out of control, a better way would be to use Memcache for session data and associate it with a cookie. Stale, unused session data will be automatically expired. The advantage of using the built in sessions is that since they are backed by both Memcache and the datastore, they're going to be less volatile. On Sun, May 2, 2010 at 8:46 AM, lembas keremo...@gmail.com wrote: I have couple of questions about session management. I use GWT+GAE. I do not want my _ah_sessions table to be out of control. I do not want to generate unnecessary sessions. I have sessions-enabledtrue/sessions-enabled in my appengine- web.xml. 1.I have the following code at the beginning of my onModuleLoad() method, is it ok? String sessionid = Cookies.getCookie(JSESSIONID); if (sessionid != null) { Date now = new Date(); Date expires = new Date(now.getTime() + (long) 1000 * 60 * 60 * 24 * 365); Cookies.setCookie(JSESSIONID, sessionid, expires); } 2.After the user sends his/her usernamepassword to the server for the first time (i.e. with a new JSESSIONID cookie), I get that user object from database and if I have it, I save it using: getThreadLocalRequest().getSession().setAttribute(user, user); and send it to the client as a sign of a succesful login. So next time client visits the site with the same JSESSIONID I can get the user object directly by: getThreadLocalRequest().getSession().getAttribute(user); --- Is it ok how I use the sesssion management? Is it true that every request comes with the same JSESSIONID (unless client deleted it deliberately), no new session is created on server and server do not need to access database to get the user object? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Ikai Lan Developer Relations, Google App Engine Twitter:http://twitter.com/ikai Delicious:http://delicious.com/ikailan Google App Engine links: Blog:http://googleappengine.blogspot.com Twitter:http://twitter.com/app_engine Reddit:http://www.reddit.com/r/appengine -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send
Re: [appengine-java] Re: session management
Normally, session cookies are created non-persistent on the browser side, but you could try to re-set the session cookie in a filter and use Cookie.setMaxAge(int) to make it persistent, like lembas did with GWT in his initial post. For plain Servlet API it could look like: String sessionId = req.getSession().getId(); Cookie persistentSessionCookie = new Cookie(SESSIONID, sessionId); persistentSessionCookie.setMaxAge(Integer.MAX_VALUE); resp.addCookie(persistentSessionCookie); 2010/5/28 romesh soni soni.rom...@gmail.com Hi Stephan, Is that possible that a client had closed the browser and opens a new browser and we can still identify the client using session cookies? Thanks Romesh On Thu, May 27, 2010 at 10:42 PM, Stephan Hartmann hartm...@metamesh.dewrote: Keep in mind that sessions managed by the servlet container expire after a specific time of inactivity on the server side, so if a user comes back after a while with his old session cookie, he will still get a new session. According to the servlet spec, you can obtain this value with HttpSession.getMaxInactiveInterval() and change it with HttpSession.setMaxInactiveInterval(int), with a value of -1 meaning never to expire. Regards, Stephan 2010/5/27 lembas keremo...@gmail.com thanks romesh. I was on vacation did not see your message. sorry for a late answer. I do not use cookies for managing session. Google does. JESSIONID cookies is created on server by App Engine anyway. I just extend its expiration date. Is it possible to implement remember me functionality without cookies? On May 3, 11:22 am, romesh soni soni.rom...@gmail.com wrote: Hey Ikai, sorry I referred you by mistake.. My msg was for lembas On Mon, May 3, 2010 at 1:23 PM, romesh soni soni.rom...@gmail.com wrote: Hi Ikai, the way you are managing session is not good. actually you are using cookies for managing session, which is not a good thing. instead session management is done at server side, not client side. On Mon, May 3, 2010 at 1:18 PM, Ikai L (Google) ika...@google.com wrote: I'm not sure how this mitigates use of the _ah_session records that are created. Anytime you set an attribute, it will use this. If you're worried about _ah_session getting out of control, a better way would be to use Memcache for session data and associate it with a cookie. Stale, unused session data will be automatically expired. The advantage of using the built in sessions is that since they are backed by both Memcache and the datastore, they're going to be less volatile. On Sun, May 2, 2010 at 8:46 AM, lembas keremo...@gmail.com wrote: I have couple of questions about session management. I use GWT+GAE. I do not want my _ah_sessions table to be out of control. I do not want to generate unnecessary sessions. I have sessions-enabledtrue/sessions-enabled in my appengine- web.xml. 1.I have the following code at the beginning of my onModuleLoad() method, is it ok? String sessionid = Cookies.getCookie(JSESSIONID); if (sessionid != null) { Date now = new Date(); Date expires = new Date(now.getTime() + (long) 1000 * 60 * 60 * 24 * 365); Cookies.setCookie(JSESSIONID, sessionid, expires); } 2.After the user sends his/her usernamepassword to the server for the first time (i.e. with a new JSESSIONID cookie), I get that user object from database and if I have it, I save it using: getThreadLocalRequest().getSession().setAttribute(user, user); and send it to the client as a sign of a succesful login. So next time client visits the site with the same JSESSIONID I can get the user object directly by: getThreadLocalRequest().getSession().getAttribute(user); --- Is it ok how I use the sesssion management? Is it true that every request comes with the same JSESSIONID (unless client deleted it deliberately), no new session is created on server and server do not need to access database to get the user object? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Ikai Lan Developer Relations, Google App Engine Twitter:http://twitter.com/ikai Delicious:http://delicious.com/ikailan Google App Engine links: Blog:http://googleappengine.blogspot.com Twitter:http://twitter.com/app_engine Reddit:http://www.reddit.com/r/appengine -- You