2

I am a beginner with developing for Google App Engine, so I am trying to follow the basic Java tutorial. Currently I have followed all the steps up to step 3 of Building and testing the app for the "Guestbook" application.

I perform mvn appengine:devserver in a terminal, but when I go to localhost:8080 in my browser, I see the following message.

HTTP ERROR: 503

Problem accessing /. Reason:

SERVICE_UNAVAILABLE

In the terminal where I started the server I don't see any output due to this error. Can anyone provide any insight into this problem?

Edit - localhost:8080/guestbook also produces this same HTTP 503 error

Here is my web.xml file (copied from the GAE tutorial page):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
 "-//Oracle Corporation//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
    <servlet>
        <servlet-name>guestbook</servlet-name>
        <servlet-class>com.google.appengine.demos.guestbook.GuestbookServlet</servlet-class>
    </servlet>
        <servlet-mapping>
        <servlet-name>guestbook</servlet-name>
        <url-pattern>/guestbook</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>guestbook.jsp</welcome-file>
    </welcome-file-list>
</web-app>

And here is the guestbook.jsp they provided (in case this helps):

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="java.util.List" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
<head>
    <link type="text/css" rel="stylesheet" href="/stylesheets/main.css"/>
</head>

<body>

<%
    String guestbookName = request.getParameter("guestbookName");
    if (guestbookName == null) {
        guestbookName = "default";
    }
    pageContext.setAttribute("guestbookName", guestbookName);
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
        pageContext.setAttribute("user", user);
%>

<p>Hello, ${fn:escapeXml(user.nickname)}! (You can
    <a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">sign out</a>.)</p>
<%
} else {
%>
<p>Hello!
    <a href="<%= userService.createLoginURL(request.getRequestURI()) %>">Sign in</a>
    to include your name with greetings you post.</p>
<%
    }
%>


<form action="/guestbook.jsp" method="get">
    <div><input type="text" name="guestbookName" value="${fn:escapeXml(guestbookName)}"/></div>
    <div><input type="submit" value="Switch Guestbook"/></div>
</form>

</body>
</html>
KJ50
  • 765
  • 1
  • 10
  • 27
  • you have enterd `http://localhost:8080/guestbook` in your browser? – Jens May 30 '14 at 06:53
  • Duplicate of [this](http://stackoverflow.com/questions/10251518/jetty-http-error-503-service-unavailable) or [this](http://stackoverflow.com/questions/9565273/google-app-engine-service-unavailable) – Nidheesh May 30 '14 at 06:57
  • @Jens, thanks for the suggestion, but that URL produces the same exact error – KJ50 May 30 '14 at 06:59
  • Maybe [this](http://stackoverflow.com/questions/9347725/google-app-engine-error-503-service-unavailable) helps? – Jens May 30 '14 at 07:11
  • @Jens, I saw that question, but I think my web.xml is ok. I added it to my post, do you see any problems? – KJ50 May 30 '14 at 07:22
  • @tailorBird I saw those links too. Many of the suggestions are related to Eclipse configurations. I am not using Eclipse for this, and I have checked that my JDK and JRE are both updated to Java 7. What else should I check? – KJ50 May 30 '14 at 07:24
  • @KJ50 If you remove the the application and start your tomcat is the url (http://localhost:8080/) reachable? – Jens May 30 '14 at 07:33
  • @Jens, I don't believe I have Tomcat installed. Is that necessary in this case? When I see the error message that I described, at the bottom of the page it says `Powered by Jetty://`, is that relevant at all? – KJ50 Jun 01 '14 at 05:42

0 Answers0