Hi all, i'm trying to use google app engine to build my first apps using java. i'm new to java but i would like to use app engine to train myself for web app developing.
i've got some issues using the users services. these are my servlets: /* * TestingUsers.java */ package mytrainingapp; import java.io.IOException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.appengine.api.users.UserService; import com.google.appengine.api.users.UserServiceFactory; public class TestingUsers extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { UserService userService = UserServiceFactory.getUserService(); String newline = System.getProperty("line.separator"); String data = req.getParameter("date"); String nick = req.getUserPrincipal().getName(); resp.setContentType("text/plain"); resp.getWriter().println("I parametri da te inviati sono:" + newline + " data: " + data + newline + " nick: " + nick); } } /* * CatchParameter.java */ package mytrainingapp; import java.io.IOException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class CatchParameter extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String newline = System.getProperty("line.separator"); String data = req.getParameter("date"); resp.setContentType("text/plain"); resp.getWriter().println("I parametri da te inviati sono:" + newline + " data: " + data); } } /* * CalendarServlet.java */ package mytrainingapp; import java.io.IOException; import javax.servlet.http.*; import java.util.*; import java.text.DateFormat; import java.text.SimpleDateFormat; public class CalendarServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String newline = System.getProperty("line.separator"); resp.setContentType("text/calendar"); String startVCard = "BEGIN:VCALENDAR" + newline + "VERSION:2.0" + newline + "CALSCALE:GREGORIAN" + newline + "METHOD:PUBLISH" + newline + "X-WR-CALNAME:Time Tracker" + newline + "X-WR-TIMEZONE:UTC" + newline + "X-WR-CALDESC:Time tracking utility - Vidiemme.it" + newline; String endVCard = "END:VCALENDAR"; String events = ""; for(int i = 1; i <= 31; i++){ String day; if(i < 10){ day = "0" + i; } else { day = "" + i; } String dayAfter; int z; if(i < 9){ z = i + 1; dayAfter = "0" + z; }else{ z = i + 1; dayAfter = "" + z; } events = events + "BEGIN:VEVENT" + newline + "DTSTART;VALUE=DATE:201001" + day + newline + "DTEND;VALUE=DATE:201001" + dayAfter + newline + "SUMMARY:Time Tracking giorno 201001" + day + newline + "ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ- PARTICIPANT;PARTSTAT=ACCEPTED;CN=Time tracking utility - Vidiemme.it;X- NUM-GUEST=0" + newline + "X-GOOGLE-CALENDAR-CONTENT-ICON:http://vidiemmeit.appspot.com/ favicon.ico" + newline + "X-GOOGLE-CALENDAR-CONTENT-URL:http://vidiemmeit.appspot.com/ catchparameter?date=" + "201002" + day + newline + "X-GOOGLE-CALENDAR-CONTENT-TYPE:text/html" + newline + "X-GOOGLE-CALENDAR-CONTENT-WIDTH:330" + newline + "X-GOOGLE-CALENDAR-CONTENT-HEIGHT:100" + newline + "CLASS:PUBLIC" + newline + "CREATED:20100101T000000Z" + newline + "LAST-MODIFIED:20100101T000000Z" + newline + "RRULE:FREQ=YEARLY" + newline + "SEQUENCE:1" + newline + "STATUS:CONFIRMED" + newline + "END:VEVENT" + newline; } resp.getWriter().println(startVCard + events + endVCard); } } /* * web.xml */ <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"> <servlet> <servlet-name>calendar</servlet-name> <servlet-class>mytrainingapp.CalendarServlet</servlet-class> </servlet> <servlet> <servlet-name>catchparameter</servlet-name> <servlet-class>mytrainingapp.CatchParameter</servlet-class> </servlet> <servlet> <servlet-name>testingusers</servlet-name> <servlet-class>mytrainingapp.TestingUsers</servlet-class> </servlet> <servlet-mapping> <servlet-name>calendar</servlet-name> <url-pattern>/calendar</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>catchparameter</servlet-name> <url-pattern>/catchparameter</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>testingusers</servlet-name> <url-pattern>/testingusers</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app> <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"> <servlet> <servlet-name>calendar</servlet-name> <servlet-class>vidiemmeit.CalendarServlet</servlet-class> </servlet> <servlet> <servlet-name>catchparameter</servlet-name> <servlet-class>vidiemmeit.CatchParameter</servlet-class> </servlet> <servlet> <servlet-name>testingusers</servlet-name> <servlet-class>vidiemmeit.TestingUsers</servlet-class> </servlet> <servlet-mapping> <servlet-name>calendar</servlet-name> <url-pattern>/calendar</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>catchparameter</servlet-name> <url-pattern>/catchparameter</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>testingusers</servlet-name> <url-pattern>/testingusers</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app> And this is the stacktrace i receive requesting any page: 01-22 04:55AM 35.504 /testingusers 500 159ms 194cpu_ms 0kb Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.49 Safari/532.5,gzip(gfe) 93.62.0.133 - - [22/Jan/2010:04:55:35 -0800] "GET /testingusers HTTP/ 1.1" 500 0 - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.49 Safari/ 532.5,gzip(gfe)" "mytrainingapp.appspot.com" W 01-22 04:55AM 35.648 EXCEPTION java.lang.ClassNotFoundException: mytrainingapp.TestingUsers at com.google.appengine.runtime.Request.process-8622395adffc5319 (Request.java) at java.lang.ClassLoader.loadClass(Unknown Source) at org.mortbay.util.Loader.loadClass(Loader.java:91) at org.mortbay.util.Loader.loadClass(Loader.java:71) at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java: 233) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:612) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 448) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:40) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler (AppVersionHandlerMap.java:191) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler (AppVersionHandlerMap.java:168) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest (JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime.handleRequest (JavaRuntime.java:235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5233) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest (BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java: 363) at com.google.net.rpc.impl.Server$2.run(Server.java:838) at com.google.tracing.LocalTraceSpanRunnable.run (LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan (LocalTraceSpanBuilder.java:536) at com.google.net.rpc.impl.Server.startRpc(Server.java:793) at com.google.net.rpc.impl.Server.processRequest(Server.java:368) at com.google.net.rpc.impl.ServerConnection.messageReceived (ServerConnection.java:448) at com.google.net.rpc.impl.RpcConnection.parseMessages (RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived (RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java: 466) at com.google.net.async.EventDispatcher.processNetworkEvents (EventDispatcher.java:759) at com.google.net.async.EventDispatcher.internalLoop (EventDispatcher.java:205) at com.google.net.async.EventDispatcher.loop(EventDispatcher.java: 101) at com.google.net.rpc.RpcService.runUntilServerShutdown (RpcService.java:251) at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run (JavaRuntime.java:394) at java.lang.Thread.run(Unknown Source) W 01-22 04:55AM 35.649 failed testingusers javax.servlet.UnavailableException: mytrainingapp.TestingUsers at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java: 233) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:612) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 448) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:40) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler (AppVersionHandlerMap.java:191) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler (AppVersionHandlerMap.java:168) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest (JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime.handleRequest (JavaRuntime.java:235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5233) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest (BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java: 363) at com.google.net.rpc.impl.Server$2.run(Server.java:838) at com.google.tracing.LocalTraceSpanRunnable.run (LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan (LocalTraceSpanBuilder.java:536) at com.google.net.rpc.impl.Server.startRpc(Server.java:793) at com.google.net.rpc.impl.Server.processRequest(Server.java:368) at com.google.net.rpc.impl.ServerConnection.messageReceived (ServerConnection.java:448) at com.google.net.rpc.impl.RpcConnection.parseMessages (RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived (RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java: 466) at com.google.net.async.EventDispatcher.processNetworkEvents (EventDispatcher.java:759) at com.google.net.async.EventDispatcher.internalLoop (EventDispatcher.java:205) at com.google.net.async.EventDispatcher.loop(EventDispatcher.java: 101) at com.google.net.rpc.RpcService.runUntilServerShutdown (RpcService.java:251) at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run (JavaRuntime.java:394) at java.lang.Thread.run(Unknown Source) W 01-22 04:55AM 35.650 Failed startup of context com.google.apphosting.utils.jetty.runtimeappenginewebappcont...@1603522 {/,/base/data/home/apps/mytrainingapp/1.339346529244527288} javax.servlet.UnavailableException: mytrainingapp.TestingUsers at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java: 233) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:612) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 448) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:40) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler (AppVersionHandlerMap.java:191) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler (AppVersionHandlerMap.java:168) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest (JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime.handleRequest (JavaRuntime.java:235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5233) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest (BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java: 363) at com.google.net.rpc.impl.Server$2.run(Server.java:838) at com.google.tracing.LocalTraceSpanRunnable.run (LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan (LocalTraceSpanBuilder.java:536) at com.google.net.rpc.impl.Server.startRpc(Server.java:793) at com.google.net.rpc.impl.Server.processRequest(Server.java:368) at com.google.net.rpc.impl.ServerConnection.messageReceived (ServerConnection.java:448) at com.google.net.rpc.impl.RpcConnection.parseMessages (RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived (RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java: 466) at com.google.net.async.EventDispatcher.processNetworkEvents (EventDispatcher.java:759) at com.google.net.async.EventDispatcher.internalLoop (EventDispatcher.java:205) at com.google.net.async.EventDispatcher.loop(EventDispatcher.java: 101) at com.google.net.rpc.RpcService.runUntilServerShutdown (RpcService.java:251) at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run (JavaRuntime.java:394) at java.lang.Thread.run(Unknown Source) C 01-22 04:55AM 35.656 Uncaught exception from servlet javax.servlet.UnavailableException: Initialization failed. at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler (AppVersionHandlerMap.java:200) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler (AppVersionHandlerMap.java:168) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest (JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime.handleRequest (JavaRuntime.java:235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5233) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest (BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java: 363) at com.google.net.rpc.impl.Server$2.run(Server.java:838) at com.google.tracing.LocalTraceSpanRunnable.run (LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan (LocalTraceSpanBuilder.java:536) at com.google.net.rpc.impl.Server.startRpc(Server.java:793) at com.google.net.rpc.impl.Server.processRequest(Server.java:368) at com.google.net.rpc.impl.ServerConnection.messageReceived (ServerConnection.java:448) at com.google.net.rpc.impl.RpcConnection.parseMessages (RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived (RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java: 466) at com.google.net.async.EventDispatcher.processNetworkEvents (EventDispatcher.java:759) at com.google.net.async.EventDispatcher.internalLoop (EventDispatcher.java:205) at com.google.net.async.EventDispatcher.loop(EventDispatcher.java: 101) at com.google.net.rpc.RpcService.runUntilServerShutdown (RpcService.java:251) at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run (JavaRuntime.java:394) at java.lang.Thread.run(Unknown Source) any help would be very appreciated!! thanks in advance, valerio -- 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.