By default, all logging messages will output to log console. To change the logging settings, find this file – {Google App Engine SDK directory}\google\appengine\tools\dev_appserver_main.py. File : dev_appserver_main.py – Find following pattern #… import getopt import logging import os import signal import sys import tempfile import traceback logging.basicConfig( level=logging.INFO, format=’%(levelname)-8s %(asctime)s %(filename)s:%(lineno)s] %(message)s’) #… Output to […]

Read more GAE : how to output log messages to a file

Note This tutorial is more on practice guide, please refer to this official Using JDO in datastore for detail explanation. See following code snippets to perform CRUD on GAE datastore, using Java Data Objects(JDO). Just annotate the Customer with JDO annotation and perform the CRUD via PersistenceManager. Add Customer c = new Customer(); c.setName(name); PersistenceManager […]

Read more Google App Engine + JDO + Spring MVC, CRUD example

GAE datastore Refer to this official “Using datstore guide” to understand what is GAE datastore. See following code snippets to perform CRUD for Google App Engine datastore, Java, using low-level API. Add Store a customer into datastore, with “name” as the key. Key customerKey = KeyFactory.createKey("Customer", "your name"); Entity customer = new Entity("Customer", customerKey); customer.setProperty("name", […]

Read more Google App Engine + Spring MVC, CRUD example with datastore low level api

In GAE, Java App, you can use command “appcfg request_logs” to download or export the logs from GAE to your computer, see signature below : AppCfg [options] request_logs <app-dir> <output-file> You can type “appcfg request_logs” to view all available options. 1. What is <app-dir> ? This is NOT your app_id nor any deployed web path […]

Read more Download / export Google App Engine Logs, Java App

Google App Engine for Java is using java.util.logging.Logger to perform the logging. In this tutorial, we show you how to do logging in GAE environment. 1. Logging Example Example to define a logger in MovieController, and log the messages in different logging levels (info, warning and error) import java.util.logging.Logger; //… @Controller @RequestMapping("/movie") public class MovieController […]

Read more Configure logging in Google App Engine

Problem Deployed on GAE production environment, when navigate from one page/view to another page/view, GAE shows error message “View xxx could not be restored“? JSF 2.1.7 Google App Engine SDK 1.6.3 P.S No problem at local GAE development. Solution By default, JSF 2 is using server for session management, and it’s not supported in GAE […]

Read more GAE + JSF : View /hello.xhtml could not be restored

Problem JSF application is able to deploy on local GAE environment, with following development environment : JSF 2.1.7 Google App Engine SDK 1.6.3 But hit error message while deployed on GAE production environment. Below is the logged error messages from GAE. com.sun.faces.config.ConfigureListener installExpressionFactory: Unable to instantiate ExpressionFactory ‘com.sun.el.ExpressionFactoryImpl’ E 2012-04-24 03:37:37.989 com.sun.faces.config.ConfigureListener contextInitialized: Critical error […]

Read more GAE + JSF : Unable to instantiate ExpressionFactory ‘com.sun.el.ExpressionFactoryImpl’

Problem Using Eclipse 3.7 + Google Plugin for Eclipse to develop GAE project, when created a .jsp file in “war” directory, Eclipse shows a cross error icon on top of the JSP file. In Eclipse problem view, it show “Your project must be configured to use a JDK in order to use JSPs.“. Solution To […]

Read more Your project must be configured to use a JDK in order to use JSPs

Problem Developing Struts2 on Google App Engine, in following environment. Struts 2.3.1.2 freemaker 2.3.18 JDK 1.6 Eclipse 3.7 + Google Plugin for Eclipse Google App Engine Java SDK 1.6.3.1 GAE complaints that javax.swing.tree.TreeNode is a restricted class in local development, if deployed on real GAE production environment, error message is gone. Caused by: java.lang.NoClassDefFoundError: javax.swing.tree.TreeNode […]

Read more javax.swing.tree.TreeNode is a restricted class

Problem Developing JSF (2.1.7) web application with Google App Engine (1.6.3), hits following error message : java.lang.NoClassDefFoundError: javax.naming.InitialContext is a restricted class. Please see the Google App Engine developer’s guide for more details. at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51) at com.sun.faces.config.WebConfiguration.processJndiEntries(WebConfiguration.java:687) at com.sun.faces.config.WebConfiguration.<init>(WebConfiguration.java:134) at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:194) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:163) //… Solution Java clsss – javax.naming.InitialContext, is not supported in Google App […]

Read more GAE + JSF : javax.naming.InitialContext is a restricted class

Problem Developing Struts2 on Google App Engine, in following environment. Struts 2.3.1.2 JDK 1.6 Eclipse 3.7 + Google Plugin for Eclipse Google App Engine Java SDK 1.6.3.1 Just started a simple Struts2 hello world example, when access the action class, hit error “Error: result ‘null’ not found”, in both local development and real production GAE […]

Read more Struts 2 on GAE – Error: result ‘null’ not found

You can use command “appcfg download_app” to download uploaded application from GAE, see signature below : AppCfg [options] -A app_id [ -V version ] download_app <out-dir> AppCfg download example Assume you have uploaded an application with app_id “mkyong-springmvc” to GAE, to download it back on your computer, use following command : D:\appengine-java-sdk-1.6.3.1\bin>appcfg -A mkyong-springmvc download_app […]

Read more Download uploaded application from Google App Engine (GAE)

Problem Developing Struts2 (v 2.3.1.2) on Google App Engine (SDK v1.6.3.1), local development, hit “java.security.AccessControlException: access denied” error? Solution Normally, this is because you turn the “devMode on” in struts.xml file. File : struts.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> //… </struts> […]

Read more Struts 2 on GAE – java.security.AccessControlException: access denied

In this tutorials, we will show you how to install “Google Plugin for Eclipse“, in Eclipse 3.7 (Indigo). 1. Installation In Eclipse 3.7, click “Help” –> “Install New Software…“, copy and paste following URL : http://dl.google.com/eclipse/plugin/3.7 Note For other Eclipse version like 3.3, 3.4, 3.5, 3.6, please refer to this GAE Eclipse documentation. Figure : […]

Read more How to install Google Plugin for Eclipse

Problem While installing Google Plugin for Eclipse 3.7, via http://dl.google.com/eclipse/plugin/3.7 , it took almost half and hour and download and stopped at the end. A long list of error messages “.jar has been tampered!” are prompted in Eclipse. An error occurred while collecting items to be installed session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository […]

Read more Google Plugin for Eclipse – jar has been tampered!