GAE Datastore is impossible to use with help of Objectify

I’m new to GAE and is developing my Datastore application based on example https://cloud.google.com/appengine/docs/java/gettingstarted/usingdatastore
My pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0   
 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
 <groupId>DecisionTree</groupId>
 <artifactId>DecisionTree</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<resources>
  <resource>
    <directory>src</directory>
    <excludes>
      <exclude>**/*.java</exclude>
    </excludes>
  </resource>
</resources>
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
      <source>1.7</source>
      <target>1.7</target>
    </configuration>
    </plugin>
  </plugins>
 </build>
 <dependencies>
<dependency>
    <groupId>com.googlecode.objectify</groupId>
    <artifactId>objectify</artifactId>
    <version>4.0.1</version>
</dependency>  
<dependency>
<groupId>jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
    </dependency>
  </dependencies>
</project>

My web.xml is

<?xml version="1.0" encoding="UTF-8"?>
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
     version="2.5"
     xmlns="http://java.sun.com/xml/ns/javaee">
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet- 
class>com.google.gwt.decisiontree.server.GreetingServiceImpl</servlet- 
class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/decisiontree/greet</url-pattern>
 </servlet-mapping>

<servlet>
<servlet-name>jsonDecisionTreeData</servlet-name>
<servlet-  
class>com.google.gwt.decisiontree.server.JsonDecisionTreeData</servlet-
class>
</servlet>
  <servlet-mapping>
<servlet-name>jsonDecisionTreeData</servlet-name>
<url-pattern>/decisiontree/jsonData</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>constructDecisionTree</servlet-name>
<servlet-
 class>com.google.gwt.decisiontree.server.ConstructDecisionTree</servlet-
 class>
</servlet> 
<servlet>
  <servlet-name>insert_attribute_value</servlet-name>
  <servlet-class>com.google.gwt.decisiontree.server.
               InsertAttributeValueServlet</servlet-class>
  </servlet>
  <servlet-mapping>
  <servlet-name>constructDecisionTree</servlet-name>
      <url-pattern>/decisiontree/construct</url-pattern>
   </servlet-mapping>    
  <servlet-mapping>
  <servlet-name>insert_attribute_value</servlet-name>
  <url-pattern>/insert_attribute</url-pattern>
  </servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>DecisionTree.html</welcome-file>
</welcome-file-list>
<!--  for Objectify support, for Google Datastore -->

<filter>
<filter-name>ObjectifyFilter</filter-name>
<filter-class>com.googlecode.objectify.ObjectifyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ObjectifyFilter</filter-name>
<url-pattern>/*</url-pattern>
 </filter-mapping>
 <listener>
<listener-class>com.example.guestbook.OfyHelper</listener-class>
 </listener>
 </web-app>

DecisionTree.html has the following calls of servlets

<a href="decisiontree/construct?action=construct_decision_tree">Construct decision tree</a>
<br/>
<a href="decisiontree/construct?action=construct_svg_decision_tree">Construct SVG decision tree</a>
<br/>
<a href="decisiontree/construct?action=construct_svg_decision_tree_2">Construct SVG decision tree 2</a>
<br/>
<a href="decisiontree/insert_attribute">Insert attribute value</a>

As a result of compiling I have warnings

WARNING: EXCEPTION 
java.lang.ClassNotFoundException:   
 com.googlecode.objectify.ObjectifyFilter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ....

And when I run http://127.0.0.1:8888/DecisionTree.html I get

HTTP ERROR: 503

Problem accessing /DecisionTree.html. Reason:

SERVICE_UNAVAILABLE
Powered by Jetty://

I think that something wrong with Objectify. Please help me!


Source: eclipse

Leave a Reply