GAE : how to output log messages to a file

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

Google App Engine Tutorial

Google App Engine, a cloud computing platform for hosting web application in existing Google infrastructure, it’s easy to scale, manage and free to use up to a predefined consumed resources, and it supports Java. For additional charged, please refer to this GAE billing . In this series of tutorials, we will show you a list …

Read more

Google App Engine + JDO + Spring MVC, CRUD example

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 + Spring MVC, CRUD example with datastore low level api

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

Download / export Google App Engine Logs, Java App

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

Configure logging in Google App Engine

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

Google App Engine + JSF 2 example

In this tutorial, we will show you how to develop and deploy a JSF 2.0 web application in Google App Engine (GAE) environment. Tools and technologies used : JDK 1.6 Eclipse 3.7 + Google Plugin for Eclipse Google App Engine Java SDK 1.6.3.1 JSF 2.1.7 Note This example is going to reuse this JSF 2.0 …

Read more

Google App Engine + Struts 1 example

Long live classic Struts 1 framework, in this tutorial, we will show you how to develop a Struts 1.x web application in Google App Engine (GAE) environment. Tools and technologies used : JDK 1.6 Eclipse 3.7 + Google Plugin for Eclipse Google App Engine Java SDK 1.6.3.1 Struts 1.3.10 Note You may also interest at …

Read more

Google App Engine + Struts 2 example

In this tutorial, we will show you how to develop Struts 2 web application in Google App Engine (GAE) environment. Tools and technologies used : JDK 1.6 Eclipse 3.7 + Google Plugin for Eclipse Google App Engine Java SDK 1.6.3.1 Struts 2.3.1.2 Note Before proceed on this tutorial, make sure you read this – GAE …

Read more

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

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

javax.swing.tree.TreeNode is a restricted class

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

GAE + JSF : javax.naming.InitialContext 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

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

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

Download uploaded application from Google App Engine (GAE)

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

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

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

How to install Google Plugin for Eclipse

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

Google Plugin for Eclipse – jar has been tampered!

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