Vaadin includes support to run Vaadin applications in the Google App Engine
(GAE). The most essential requirement for GAE is the ability to serialize the
application state. Vaadin applications are serializable through the
java.io.Serializable
interface.
To run as a GAE application, an application must use
GAEApplicationServlet
instead of
ApplicationServlet
in web.xml
, and
of course implement the java.io.Serializable
interface
for all persistent classes. You also need to enable session support in
appengine-web.xml
with:
<sessions-enabled>true</sessions-enabled>
The Vaadin Project wizard can create the configuration files needed for GAE deployment. See Section 2.3.1, “Creating the Project”. When the Google App Engine deployment configuration is selected, the wizard will create the project structure following the GAE Servlet convention instead of the regular Servlet convention. The main differences are:
src/main/java
war/WEB-INF/classes
war
Running Vaadin applications in Google App Engine has the following rules and limitations:
Avoid using the session for storage, usual App Engine limitations apply (no synchronization, that is, it is unreliable).
Vaadin uses memcache for mutex, the key is of the form
_vmutex<sessionid>
.
The Vaadin WebApplicationContext
class is serialized separately into memcache and datastore; the memcache
key is _vac<sessionid>
and the datastore
entity kind is _vac
with identifiers of the type
_vac<sessionid>
.
Do not update the application state when serving an
ApplicationResource
(such as
ClassResource
.getStream()
).
Avoid (or be very careful when)
updating application state in a TransactionListener
- it is called even when the application is not locked and won't be
serialized (such as with ApplicationResource
), and
changes can therefore be lost (it should be safe to update things that can
be safely discarded later, that is, valid only for the current
request).
The application remains locked during uploads - a progress bar is not possible.