SlideShare a Scribd company logo
1 of 44
Download to read offline
Durchgestartet?
Eine Einführung in Google App Engine / Java – Reloaded!


    Dr. Halil-Cem Gürsoy
                      adesso AG
Der Referent

• Insgesamt über 10 Jahre Beratung und Entwicklung
  rund um Java, davor Entwicklung im
  Forschungsumfeld
• Senior Software Engineer bei adesso AG, Dortmund
• Schwerpunkt EAI und SOA-Projekte im JEE
  Umfeld, aber auch klassische JEE-Projekte
• Autor und Referent auf Konferenzen




Herbstcampus 2011 – GAE Reloaded                     2
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    3
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    4
Cloud? Was ist eine Cloud?




  Quelle: http://geekandpoke.typepad.com/geekandpoke/2008/07/the-cloud-thing.html
Herbstcampus 2011 – GAE Reloaded                                                    5
Die „Cloud“

• „Cloud Computing“ …

…bezeichnet primär den Ansatz, abstrahierte IT-
 Infrastrukturen (z. B. Rechenkapazität,
 Datenspeicher), fertige Programmpakete und
 Programmierumgebungen dynamisch an den Bedarf
 angepasst über Netzwerk zur Verfügung zu stellen.

(Quelle: Wikipedia.de)



Herbstcampus 2011 – GAE Reloaded                     6
IaaS

• IaaS = „Infrastructure as a Service“
• Rechnerinfrastruktur wird zur Verfügung
  dynamisch gestellt
• Die Infrastruktur steht „irgendwo“ virtuell in der
  Cloud
• Weiterentwicklung von klassischen virtuellen
  Maschinen (wie VirtualBox, VMWare usw.)
• Bekanntester Anbieter: Amazon mit EC2
  • Zahlen nur bei Nutzung
  • Verschiedene Images verfügbar


Herbstcampus 2011 – GAE Reloaded                       7
SaaS

• „Software as a Service“
• Software wird über Cloud, meist Webbasiert
• Keine lokale Installation
• Beispiele:
  • Google Docs
  • CloudBees DEV@Cloud




Herbstcampus 2011 – GAE Reloaded               8
PaaS

• „Platform as a Service“
• Es wird eine Plattform (Laufzeitumgebung) in einer
  Cloud angeboten
• Keine Berührung mit dem darunterliegenden
  Betriebssystem
• Beispiele
  • Windows Azure
  • Cloud Foundry
  • Google App Engine




Herbstcampus 2011 – GAE Reloaded                       9
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    10
Google App Engine

• Klassische PaaS-Cloud
• Die Plattform ist eine Runtime-Umgebung für
  Webapplikationen
• Initial wurde „nur“ Python unterstützt
• Seit 2009 (in Beta) auch die Unterstützung von Java
  (Java 5 & 6)
  • Eingeschränkt!
  • Details später…
• Go



Herbstcampus 2011 – GAE Reloaded                        11
GAE/J

• GAE/J ist eine JRE 6
  • Läuft in einer Sandbox mit Restriktionen
• Unterstützt out of the box
  • Servlet API 2.4 (*)
  • JSF 1.1, 2.0 (*)
  • JSP (*)
  • JDO 2.3 (?!)
  • JPA 1(*)
• Support für diverse Google Services
  (*): Eingeschränkt…




Herbstcampus 2011 – GAE Reloaded               12
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    13
Getting started…

• Ein Google-Account
  • Ohne Useraccount keine GAE
• Eine Handynummer
  • Aktivierungs-SMS
• Eclipse (ab Europa / 3.3 unterstützt)
  • Indigo ist OK
  • Alternativ NetBeans oder CLI
• App Engine SDK oder Eclipse Plugin
  • Aktuelle Version der SDK ist 1.3.7 1.5.3 (!)




Herbstcampus 2011 – GAE Reloaded                   14
Anmelden, Installation

• https://appengine.google.com/
• Google Account eingeben
• Handynummer eingeben
  • muss angegeben werden, um GAE freizuschalten
• Installation Eclipse Plugin:
  http://code.google.com/intl/de-DE/eclipse/docs/download.html
  • Eclipse Update Sites dort




Herbstcampus 2011 – GAE Reloaded                             15
„Hallo Welt!“

• Neues Projekt anlegen




Herbstcampus 2011 – GAE Reloaded   16
„HalloWelt“

• GWT sollte (vorerst)
  nicht ausgewählt sein
• Hier Auswahl der
  GAE API 1.5.0




Herbstcampus 2011 – GAE Reloaded   17
Und das fertige Projekt…

• Default-Pakete und
  Libs werden
  eingefügt
• JDO ist Persistenz-
  Default
• Voreinstellungen für
  Konfigurationen




Herbstcampus 2011 – GAE Reloaded   18
Servlet sagt „Hello, World“
package de.adesso.hgu.hc2010.hallowelt;

import java.io.IOException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class HalloWeltServlet extends HttpServlet {
     public void doGet(HttpServletRequest req,
                       HttpServletResponse resp) throws IOException {
          resp.setContentType("text/plain");
          resp.getWriter().println("Hello, world");
     }
}

• Starten der Applikation innerhalb von Eclipse
 (RunAs -> Web Application
• http://localhost:8888 ist Standard



Herbstcampus 2011 – GAE Reloaded                                        19
Applikation bei GAE registrieren

• https://appengine.google.com/start/createapp




Herbstcampus 2011 – GAE Reloaded                 20
DD anpassen

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
      <application>hc2011hallowelt</application>
      <version>1</version>


      <!-- Configure java.util.logging -->
      <system-properties>
             <property name="java.util.logging.config.file“
                                   value="WEB-INF/logging.properties"/>
      </system-properties>


</appengine-web-app>




Herbstcampus 2011 – GAE Reloaded                                          21
GAE Deployment




Herbstcampus 2011 – GAE Reloaded   22
GAE Postdeployment

• GAE DashBoard gibt Infos über Zugriffe,
  verbrauchte Quota, Logs usw.
• Verwaltung von Versionen einer Applikation
  • Fallback auf alte Version möglich
• Aufruf der Applikation über
  http://halloherbstcampus.appspot.com/helloherbstcampus




Herbstcampus 2011 – GAE Reloaded                       23
GAE Dashboard




Herbstcampus 2011 – GAE Reloaded   24
Google API's

• Es stehen viele Google API's zur Verfügung
  •   Analytics Data Export
  •   Apps for your Domain
  •   Books
  •   Calendar
  •   Contacts
  •   Spreadsheet
  •   Webmaster Tools
  •   ...und einigemehr




Herbstcampus 2011 – GAE Reloaded               25
Google Services

• Blobstore
  • Um sehr große Datenblöcke zu speichern
• Mail
  • Mails senden und empfangen
• Memcache
  • Verteiltes in-memory cache
  • Implementiert JSR 107 (JCache)
• User
  • Authentifizierung gegen Google und OpenID Accounts
• XMPP
  • Versenden / Empfangen von XMPP-Messages (GTalk,
    Jabber)

Herbstcampus 2011 – GAE Reloaded                         26
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    27
GAE - Persitenz

• Persistenz über JDO und JPA möglich
  • Als ORM kommt DataNucleus in der Version 1.1 (aktuell ist
     2.x) zum Einsatz (http://www.datanucleus.org)
• In GAE/DN JDO besser dokumentiert als JPA
  (immer noch!)
• Alternativ gibt es eine Lowlevel-API
• Im Hintergrund keine SQL-Datenbank sondern
  Google BigTable
• In memory SQL-DB‘s sind möglich
• Enhancement der Entity-Klassen wegen
  DataNucleus (JDO / JPA)
Herbstcampus 2011 – GAE Reloaded                                28
GAE - JPA

• In persistence.xml Konfiguration des transaktionalen Verhaltens.
• Default:
<persistence-unit name="transactions-optional">


  <provider>org.datanucleus.store.appengine.jpa.DatastorePersistencePro
  vider</provider>
  <properties>
  <property name="datanucleus.NontransactionalRead"
  value="true" />
  <property name="datanucleus.NontransactionalWrite”
  value="true" />
  <property name="datanucleus.ConnectionURL”
  value="appengine" />
  </properties>
</persistence-unit>


Herbstcampus 2011 – GAE Reloaded                                      29
GAE – JPA-Einschränkungen

• Keine @ManyToMany
• Keine Join-Queries
• Bei Vererbung keine Unterstützung für
  • InheritanceType.SINGLE_TABLE
  • InheritanceType.JOINED
• Keine Aggregate queries (group by, having, sum,
  avg, min, max)
• Keine Polymorphe Queries




Herbstcampus 2011 – GAE Reloaded                    30
GAE – Und paar Punkte mehr

• Resultsets sind nicht gefüllt, daher:
      resultSet.size();
• Id-Felder:
   Unsupported primary key type: long

• GenerationType.TABLE:
  javax.persistence.PersistenceException: Transaction
  is still active.

• Klappt besser:
 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 private Key key;



Herbstcampus 2011 – GAE Reloaded                        31
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    32
'JRE Class White List'

• Die ‚JRE Class White List‘ definiert die Klassen,
  die von der GAE Sandbox unterstützt werden
     http://code.google.com/intl/de-DE/appengine/docs/java/jrewhitelist.html
• Die Applikation darf nicht
  • Eigene Threads starten
  • Keine Dateien schreiben
  • Keine „willkürlichen“ Netzwerkverbindungen aufbauen




Herbstcampus 2011 – GAE Reloaded                                               33
"Will it play?"

• Übersicht über gängige Frameworks und Sprache
    http://code.google.com/p/googleappengine/wiki/WillItPlayInJava
• Keine Unterstützung für
  • JAX-RPC
  • JDBC, JMS, JNDI, RMI
• Hibernate – Inkompatibel
• Groovy, Scala usw: Supported (kein Akka!)

• JAX-WS inzwischen teilweise vorhanden
    http://code.google.com/p/googleappengine/issues/detail?id=1270
             http://code.google.com/appengine/articles/soap.html



Herbstcampus 2011 – GAE Reloaded                                     34
Workaround...

• Umgehung Whitelist / erzwungene Kompatibilität
  • JARJAR (http://code.google.com/p/jarjar/)
  • Erstellt eine JAR, Umbenennung von Paketen
  • Bytecode-Transformation für nicht mehr gültige Referenzen
    auf umbenannte Pakete




Herbstcampus 2011 – GAE Reloaded                                35
Spring…

• Spring = Semi-Kompatibel (nicht alle JARs)
• Spring MVC-Applikation mit Spring Beans
• Setup: Spring JARs in WAR/WEB-INF/lib kopieren und in CP
  aufnehmen
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/springgae/*</url-pattern>
    </servlet-mapping>



• Beispiel im Cook Book:            http://peterbacklund.blogspot.com/2009/04/running-spring-on-google-app-engine.html




Herbstcampus 2011 – GAE Reloaded                                                                         36
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    37
Quota

• GAE ist kostenlos innerhalb der Quota-Grenzen
• Stärkere Ausnutzung der Infrastruktur gegen
  Bezahlung möglich, muss explizit eingeschaltet
  werden
• Quota verbraucht = HTTP 403 FORBIDDEN oder
  Exception
• „Per minute quota“ – ca. 500 Req. / min.




Herbstcampus 2011 – GAE Reloaded                   38
Quota – weitere Details

Ressource                          Quota
Request size                       10 mb
Response size                      10 mb
Request max. Dauer                 30 sec.
Maximale Anzahl Files              3000
Maximale Dateigröße                10 mb




Herbstcampus 2011 – GAE Reloaded             39
Performance

• Max. 500 req. / sec. (Quota)
• Simpler Test (schreiben und lesen eines Datensatzes)




Herbstcampus 2011 – GAE Reloaded                         40
Agenda

• Was ist überhaupt eine „Cloud“
• Die Google App Engine
• Getting started: „Hallo Welt“
• Persistenz in Google App Engine
• Limitierungen in GAE/J
• Quota und Performance
• Build-Tools




Herbstcampus 2011 – GAE Reloaded    41
Build…

• Ant wird unterstützt
  • Entity-Klassen müssen „manuell“ Enhanced werden, Ant-
     Task wird von DataNucleus angeboten
• Maven
  • Maven2 Plugin verfügbar
     • (http://code.google.com/p/maven-gae-plugin/)
    • Archtypes für JSP, GWT und Wicket-Projekte
  • Enhancement über Maven-Plugins von DataNucleus




Herbstcampus 2011 – GAE Reloaded                            42
Vielen Dank!

Dr. Halil-Cem Gürsoy
            adesso AG
    halil-cem.guersoy [at] adesso.de
               @hgutwit
           http://goo.gl/hljRS
Wir suchen Sie als
  Software Architekt (m/w)
  Projektleiter (m/w)
  Senior Software Engineer (m/w)


jobs@adesso.de
www.AAAjobs.de
     Herbstcampus 2011 – GAE Reloaded   44

More Related Content

Viewers also liked

DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...
DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...
DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...JRibbeck
 
Nuxeo WebEngine : Etude de cas
Nuxeo WebEngine : Etude de casNuxeo WebEngine : Etude de cas
Nuxeo WebEngine : Etude de casDamien Metzler
 
An introduction to Google's App Engine
An introduction to Google's App EngineAn introduction to Google's App Engine
An introduction to Google's App EngineStefan Sperber
 
Google Cloud Platform. Google App Engine
Google Cloud Platform. Google App Engine Google Cloud Platform. Google App Engine
Google Cloud Platform. Google App Engine Kwaye Kant
 
Search Engine Friendly Design (SEFD) - SMX München 2014
Search Engine Friendly Design (SEFD) - SMX München 2014Search Engine Friendly Design (SEFD) - SMX München 2014
Search Engine Friendly Design (SEFD) - SMX München 2014Daniel Herndler
 
Google App Engine. Zwei Jahre im Produktiveinsatz
Google App Engine. Zwei Jahre im ProduktiveinsatzGoogle App Engine. Zwei Jahre im Produktiveinsatz
Google App Engine. Zwei Jahre im ProduktiveinsatzPer Fragemann
 
Google App Engine For Java
Google App Engine For JavaGoogle App Engine For Java
Google App Engine For Javatcouery
 
WordPress State of the Word 2012
WordPress State of the Word 2012WordPress State of the Word 2012
WordPress State of the Word 2012photomatt
 
Introduction à Google App Engine - WAQ 2011
Introduction à Google App Engine - WAQ 2011Introduction à Google App Engine - WAQ 2011
Introduction à Google App Engine - WAQ 2011jimmybourassa
 
Cours Search Marketing - 1 Introduction - IAE Lille
Cours Search Marketing -  1 Introduction - IAE LilleCours Search Marketing -  1 Introduction - IAE Lille
Cours Search Marketing - 1 Introduction - IAE LilleRenaud JOLY
 
Cloud & Google app engine Presentation by Ngiambus Marcus
 Cloud & Google app engine Presentation  by Ngiambus Marcus Cloud & Google app engine Presentation  by Ngiambus Marcus
Cloud & Google app engine Presentation by Ngiambus MarcusMarc NGIAMBA
 
Web meets Location - Mobile Social Media Relations
Web meets Location - Mobile Social Media RelationsWeb meets Location - Mobile Social Media Relations
Web meets Location - Mobile Social Media RelationsSympra GmbH (GPRA)
 
Intellectual Property Rights
Intellectual Property RightsIntellectual Property Rights
Intellectual Property Rightsharshhanu
 
SEFD - Search Engine Friendly Design - SMX München 2015 Kai Spriestersbach
SEFD - Search Engine Friendly Design - SMX München 2015 Kai SpriestersbachSEFD - Search Engine Friendly Design - SMX München 2015 Kai Spriestersbach
SEFD - Search Engine Friendly Design - SMX München 2015 Kai SpriestersbachSEARCH ONE
 
Codathlon Google App Engine
Codathlon Google App EngineCodathlon Google App Engine
Codathlon Google App EngineVincentBostoen
 
Internal Combustion Engines - Construction and Working (All you need to know,...
Internal Combustion Engines - Construction and Working (All you need to know,...Internal Combustion Engines - Construction and Working (All you need to know,...
Internal Combustion Engines - Construction and Working (All you need to know,...Mihir Pai
 

Viewers also liked (20)

DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...
DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...
DNUG2015 Frühjahrskonferenz: Brücken bauen, Grenzen überwinden: Domino im Dia...
 
Google App Engine - INTRO
Google App Engine - INTROGoogle App Engine - INTRO
Google App Engine - INTRO
 
Nuxeo WebEngine : Etude de cas
Nuxeo WebEngine : Etude de casNuxeo WebEngine : Etude de cas
Nuxeo WebEngine : Etude de cas
 
An introduction to Google's App Engine
An introduction to Google's App EngineAn introduction to Google's App Engine
An introduction to Google's App Engine
 
Google Cloud Platform. Google App Engine
Google Cloud Platform. Google App Engine Google Cloud Platform. Google App Engine
Google Cloud Platform. Google App Engine
 
Search Engine Friendly Design (SEFD) - SMX München 2014
Search Engine Friendly Design (SEFD) - SMX München 2014Search Engine Friendly Design (SEFD) - SMX München 2014
Search Engine Friendly Design (SEFD) - SMX München 2014
 
Google App Engine. Zwei Jahre im Produktiveinsatz
Google App Engine. Zwei Jahre im ProduktiveinsatzGoogle App Engine. Zwei Jahre im Produktiveinsatz
Google App Engine. Zwei Jahre im Produktiveinsatz
 
Google App Engine For Java
Google App Engine For JavaGoogle App Engine For Java
Google App Engine For Java
 
WordPress State of the Word 2012
WordPress State of the Word 2012WordPress State of the Word 2012
WordPress State of the Word 2012
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Introduction à Google App Engine - WAQ 2011
Introduction à Google App Engine - WAQ 2011Introduction à Google App Engine - WAQ 2011
Introduction à Google App Engine - WAQ 2011
 
Cours Search Marketing - 1 Introduction - IAE Lille
Cours Search Marketing -  1 Introduction - IAE LilleCours Search Marketing -  1 Introduction - IAE Lille
Cours Search Marketing - 1 Introduction - IAE Lille
 
Cloud & Google app engine Presentation by Ngiambus Marcus
 Cloud & Google app engine Presentation  by Ngiambus Marcus Cloud & Google app engine Presentation  by Ngiambus Marcus
Cloud & Google app engine Presentation by Ngiambus Marcus
 
Web meets Location - Mobile Social Media Relations
Web meets Location - Mobile Social Media RelationsWeb meets Location - Mobile Social Media Relations
Web meets Location - Mobile Social Media Relations
 
Intellectual Property Rights
Intellectual Property RightsIntellectual Property Rights
Intellectual Property Rights
 
RoomCloud Booking Engine
RoomCloud Booking EngineRoomCloud Booking Engine
RoomCloud Booking Engine
 
SEFD - Search Engine Friendly Design - SMX München 2015 Kai Spriestersbach
SEFD - Search Engine Friendly Design - SMX München 2015 Kai SpriestersbachSEFD - Search Engine Friendly Design - SMX München 2015 Kai Spriestersbach
SEFD - Search Engine Friendly Design - SMX München 2015 Kai Spriestersbach
 
Codathlon Google App Engine
Codathlon Google App EngineCodathlon Google App Engine
Codathlon Google App Engine
 
Internal Combustion Engines - Construction and Working (All you need to know,...
Internal Combustion Engines - Construction and Working (All you need to know,...Internal Combustion Engines - Construction and Working (All you need to know,...
Internal Combustion Engines - Construction and Working (All you need to know,...
 
Zk Framework
Zk FrameworkZk Framework
Zk Framework
 

Similar to Durchgestartet? Eine Einführung in die Google App Engine / Java - Reloaded!

Java magazin9 2012_wls 12c_das_dutzend_ist_voll
Java magazin9 2012_wls 12c_das_dutzend_ist_vollJava magazin9 2012_wls 12c_das_dutzend_ist_voll
Java magazin9 2012_wls 12c_das_dutzend_ist_vollWolfgang Weigend
 
Grails im Überblick und in der Praxis
Grails im Überblick und in der PraxisGrails im Überblick und in der Praxis
Grails im Überblick und in der PraxisTobias Kraft
 
Gradle - Beginner's Workshop (german)
Gradle - Beginner's Workshop (german)Gradle - Beginner's Workshop (german)
Gradle - Beginner's Workshop (german)Joachim Baumann
 
DevOps der Triple-E Klasse - Eclipse DemoCamp
DevOps der Triple-E Klasse - Eclipse DemoCampDevOps der Triple-E Klasse - Eclipse DemoCamp
DevOps der Triple-E Klasse - Eclipse DemoCampWerner Keil
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipseThomas Koch
 
Java in the Cloud - am Beispiel der Google App Engineg
Java in the Cloud - am Beispiel der Google App EnginegJava in the Cloud - am Beispiel der Google App Engineg
Java in the Cloud - am Beispiel der Google App Engineggedoplan
 
Icinga 2009 at Nagios Workshop
Icinga 2009 at Nagios WorkshopIcinga 2009 at Nagios Workshop
Icinga 2009 at Nagios WorkshopIcinga
 
Webinar - ABAP Development Tools
Webinar - ABAP Development ToolsWebinar - ABAP Development Tools
Webinar - ABAP Development ToolsCadaxo GmbH
 
Creasoft-Akademie - Mobile Multiplattform Apps
Creasoft-Akademie - Mobile Multiplattform AppsCreasoft-Akademie - Mobile Multiplattform Apps
Creasoft-Akademie - Mobile Multiplattform AppsCreasoft AG
 
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...gedoplan
 
Server Revolutions- Der Spring Source DM Server
Server Revolutions- Der Spring Source DM ServerServer Revolutions- Der Spring Source DM Server
Server Revolutions- Der Spring Source DM ServerSandro Sonntag
 
Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.
Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.
Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.David Jardin
 
Drupal 8: Neuerungen im Überblick
Drupal 8:  Neuerungen im ÜberblickDrupal 8:  Neuerungen im Überblick
Drupal 8: Neuerungen im Überblickdrubb
 
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...gedoplan
 
Wie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztWie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztEdward Burns
 
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Sebastian Huppmann
 
Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Javaland 2016 - Flyway vs. LiquiBase - Battle der DatenbankmigrationstoolsJavaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Javaland 2016 - Flyway vs. LiquiBase - Battle der DatenbankmigrationstoolsStephan Kaps
 

Similar to Durchgestartet? Eine Einführung in die Google App Engine / Java - Reloaded! (20)

Java magazin9 2012_wls 12c_das_dutzend_ist_voll
Java magazin9 2012_wls 12c_das_dutzend_ist_vollJava magazin9 2012_wls 12c_das_dutzend_ist_voll
Java magazin9 2012_wls 12c_das_dutzend_ist_voll
 
Grails im Überblick und in der Praxis
Grails im Überblick und in der PraxisGrails im Überblick und in der Praxis
Grails im Überblick und in der Praxis
 
Gradle - Beginner's Workshop (german)
Gradle - Beginner's Workshop (german)Gradle - Beginner's Workshop (german)
Gradle - Beginner's Workshop (german)
 
DevOps der Triple-E Klasse - Eclipse DemoCamp
DevOps der Triple-E Klasse - Eclipse DemoCampDevOps der Triple-E Klasse - Eclipse DemoCamp
DevOps der Triple-E Klasse - Eclipse DemoCamp
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und Eclipse
 
Java in the Cloud - am Beispiel der Google App Engineg
Java in the Cloud - am Beispiel der Google App EnginegJava in the Cloud - am Beispiel der Google App Engineg
Java in the Cloud - am Beispiel der Google App Engineg
 
Icinga 2009 at Nagios Workshop
Icinga 2009 at Nagios WorkshopIcinga 2009 at Nagios Workshop
Icinga 2009 at Nagios Workshop
 
AngularJs
AngularJsAngularJs
AngularJs
 
GWT – Google Web Toolkit in der Praxis
GWT – Google Web Toolkit in der PraxisGWT – Google Web Toolkit in der Praxis
GWT – Google Web Toolkit in der Praxis
 
GWT
GWTGWT
GWT
 
Webinar - ABAP Development Tools
Webinar - ABAP Development ToolsWebinar - ABAP Development Tools
Webinar - ABAP Development Tools
 
Creasoft-Akademie - Mobile Multiplattform Apps
Creasoft-Akademie - Mobile Multiplattform AppsCreasoft-Akademie - Mobile Multiplattform Apps
Creasoft-Akademie - Mobile Multiplattform Apps
 
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
 
Server Revolutions- Der Spring Source DM Server
Server Revolutions- Der Spring Source DM ServerServer Revolutions- Der Spring Source DM Server
Server Revolutions- Der Spring Source DM Server
 
Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.
Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.
Nooku, Molajo & Co - Joomla! Distributionen. Oder Forks.
 
Drupal 8: Neuerungen im Überblick
Drupal 8:  Neuerungen im ÜberblickDrupal 8:  Neuerungen im Überblick
Drupal 8: Neuerungen im Überblick
 
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
Das Runde muss in das Eckige - Java-Anwendungen für Kubernetes entwickeln und...
 
Wie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztWie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE Nutzt
 
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
 
Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Javaland 2016 - Flyway vs. LiquiBase - Battle der DatenbankmigrationstoolsJavaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
 

More from adesso AG

SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)adesso AG
 
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMPSNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMPadesso AG
 
Mythos High Performance Teams
Mythos High Performance TeamsMythos High Performance Teams
Mythos High Performance Teamsadesso AG
 
A Business-Critical SharePoint Solution From adesso AG
A Business-CriticalSharePoint SolutionFrom adesso AGA Business-CriticalSharePoint SolutionFrom adesso AG
A Business-Critical SharePoint Solution From adesso AGadesso AG
 
Was Sie über NoSQL Datenbanken wissen sollten!
Was Sie über NoSQL Datenbanken wissen sollten!Was Sie über NoSQL Datenbanken wissen sollten!
Was Sie über NoSQL Datenbanken wissen sollten!adesso AG
 
Continuous Delivery praktisch
Continuous Delivery praktischContinuous Delivery praktisch
Continuous Delivery praktischadesso AG
 
Agilität, Snapshots und Continuous Delivery
Agilität, Snapshots und Continuous DeliveryAgilität, Snapshots und Continuous Delivery
Agilität, Snapshots und Continuous Deliveryadesso AG
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?adesso AG
 
Getriebene Anwendungslandschaften
Getriebene AnwendungslandschaftenGetriebene Anwendungslandschaften
Getriebene Anwendungslandschaftenadesso AG
 
Google App Engine JAX PaaS Parade 2013
Google App Engine JAX PaaS Parade 2013Google App Engine JAX PaaS Parade 2013
Google App Engine JAX PaaS Parade 2013adesso AG
 
Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)
Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)
Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)adesso AG
 
OOP 2013 NoSQL Suche
OOP 2013 NoSQL SucheOOP 2013 NoSQL Suche
OOP 2013 NoSQL Sucheadesso AG
 
NoSQL in der Cloud - Why?
NoSQL in der Cloud -  Why?NoSQL in der Cloud -  Why?
NoSQL in der Cloud - Why?adesso AG
 
Lean web architecture mit jsf 2.0, cdi & co.
Lean web architecture mit jsf 2.0, cdi & co.Lean web architecture mit jsf 2.0, cdi & co.
Lean web architecture mit jsf 2.0, cdi & co.adesso AG
 
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDISchlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDIadesso AG
 
Zehn Hinweise für Architekten
Zehn Hinweise für ArchitektenZehn Hinweise für Architekten
Zehn Hinweise für Architektenadesso AG
 
Agile Praktiken
Agile PraktikenAgile Praktiken
Agile Praktikenadesso AG
 
Java und Cloud - nicht nur mit PaaS
Java und Cloud - nicht nur mit PaaS Java und Cloud - nicht nur mit PaaS
Java und Cloud - nicht nur mit PaaS adesso AG
 
Neue EBusiness Perspektiven durch HTML5
Neue EBusiness Perspektiven durch HTML5Neue EBusiness Perspektiven durch HTML5
Neue EBusiness Perspektiven durch HTML5adesso AG
 
CloudConf2011 Introduction to Google App Engine
CloudConf2011 Introduction to Google App EngineCloudConf2011 Introduction to Google App Engine
CloudConf2011 Introduction to Google App Engineadesso AG
 

More from adesso AG (20)

SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP (Kurzversion)
 
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMPSNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
SNMP Applied - Sicheres Anwendungs-Monitoring mit SNMP
 
Mythos High Performance Teams
Mythos High Performance TeamsMythos High Performance Teams
Mythos High Performance Teams
 
A Business-Critical SharePoint Solution From adesso AG
A Business-CriticalSharePoint SolutionFrom adesso AGA Business-CriticalSharePoint SolutionFrom adesso AG
A Business-Critical SharePoint Solution From adesso AG
 
Was Sie über NoSQL Datenbanken wissen sollten!
Was Sie über NoSQL Datenbanken wissen sollten!Was Sie über NoSQL Datenbanken wissen sollten!
Was Sie über NoSQL Datenbanken wissen sollten!
 
Continuous Delivery praktisch
Continuous Delivery praktischContinuous Delivery praktisch
Continuous Delivery praktisch
 
Agilität, Snapshots und Continuous Delivery
Agilität, Snapshots und Continuous DeliveryAgilität, Snapshots und Continuous Delivery
Agilität, Snapshots und Continuous Delivery
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
 
Getriebene Anwendungslandschaften
Getriebene AnwendungslandschaftenGetriebene Anwendungslandschaften
Getriebene Anwendungslandschaften
 
Google App Engine JAX PaaS Parade 2013
Google App Engine JAX PaaS Parade 2013Google App Engine JAX PaaS Parade 2013
Google App Engine JAX PaaS Parade 2013
 
Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)
Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)
Wartbare Web-Anwendungen mit Knockout.js und Model-View-ViewModel (MVVM)
 
OOP 2013 NoSQL Suche
OOP 2013 NoSQL SucheOOP 2013 NoSQL Suche
OOP 2013 NoSQL Suche
 
NoSQL in der Cloud - Why?
NoSQL in der Cloud -  Why?NoSQL in der Cloud -  Why?
NoSQL in der Cloud - Why?
 
Lean web architecture mit jsf 2.0, cdi & co.
Lean web architecture mit jsf 2.0, cdi & co.Lean web architecture mit jsf 2.0, cdi & co.
Lean web architecture mit jsf 2.0, cdi & co.
 
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDISchlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDI
 
Zehn Hinweise für Architekten
Zehn Hinweise für ArchitektenZehn Hinweise für Architekten
Zehn Hinweise für Architekten
 
Agile Praktiken
Agile PraktikenAgile Praktiken
Agile Praktiken
 
Java und Cloud - nicht nur mit PaaS
Java und Cloud - nicht nur mit PaaS Java und Cloud - nicht nur mit PaaS
Java und Cloud - nicht nur mit PaaS
 
Neue EBusiness Perspektiven durch HTML5
Neue EBusiness Perspektiven durch HTML5Neue EBusiness Perspektiven durch HTML5
Neue EBusiness Perspektiven durch HTML5
 
CloudConf2011 Introduction to Google App Engine
CloudConf2011 Introduction to Google App EngineCloudConf2011 Introduction to Google App Engine
CloudConf2011 Introduction to Google App Engine
 

Durchgestartet? Eine Einführung in die Google App Engine / Java - Reloaded!

  • 1. Durchgestartet? Eine Einführung in Google App Engine / Java – Reloaded! Dr. Halil-Cem Gürsoy adesso AG
  • 2. Der Referent • Insgesamt über 10 Jahre Beratung und Entwicklung rund um Java, davor Entwicklung im Forschungsumfeld • Senior Software Engineer bei adesso AG, Dortmund • Schwerpunkt EAI und SOA-Projekte im JEE Umfeld, aber auch klassische JEE-Projekte • Autor und Referent auf Konferenzen Herbstcampus 2011 – GAE Reloaded 2
  • 3. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 3
  • 4. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 4
  • 5. Cloud? Was ist eine Cloud? Quelle: http://geekandpoke.typepad.com/geekandpoke/2008/07/the-cloud-thing.html Herbstcampus 2011 – GAE Reloaded 5
  • 6. Die „Cloud“ • „Cloud Computing“ … …bezeichnet primär den Ansatz, abstrahierte IT- Infrastrukturen (z. B. Rechenkapazität, Datenspeicher), fertige Programmpakete und Programmierumgebungen dynamisch an den Bedarf angepasst über Netzwerk zur Verfügung zu stellen. (Quelle: Wikipedia.de) Herbstcampus 2011 – GAE Reloaded 6
  • 7. IaaS • IaaS = „Infrastructure as a Service“ • Rechnerinfrastruktur wird zur Verfügung dynamisch gestellt • Die Infrastruktur steht „irgendwo“ virtuell in der Cloud • Weiterentwicklung von klassischen virtuellen Maschinen (wie VirtualBox, VMWare usw.) • Bekanntester Anbieter: Amazon mit EC2 • Zahlen nur bei Nutzung • Verschiedene Images verfügbar Herbstcampus 2011 – GAE Reloaded 7
  • 8. SaaS • „Software as a Service“ • Software wird über Cloud, meist Webbasiert • Keine lokale Installation • Beispiele: • Google Docs • CloudBees DEV@Cloud Herbstcampus 2011 – GAE Reloaded 8
  • 9. PaaS • „Platform as a Service“ • Es wird eine Plattform (Laufzeitumgebung) in einer Cloud angeboten • Keine Berührung mit dem darunterliegenden Betriebssystem • Beispiele • Windows Azure • Cloud Foundry • Google App Engine Herbstcampus 2011 – GAE Reloaded 9
  • 10. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 10
  • 11. Google App Engine • Klassische PaaS-Cloud • Die Plattform ist eine Runtime-Umgebung für Webapplikationen • Initial wurde „nur“ Python unterstützt • Seit 2009 (in Beta) auch die Unterstützung von Java (Java 5 & 6) • Eingeschränkt! • Details später… • Go Herbstcampus 2011 – GAE Reloaded 11
  • 12. GAE/J • GAE/J ist eine JRE 6 • Läuft in einer Sandbox mit Restriktionen • Unterstützt out of the box • Servlet API 2.4 (*) • JSF 1.1, 2.0 (*) • JSP (*) • JDO 2.3 (?!) • JPA 1(*) • Support für diverse Google Services (*): Eingeschränkt… Herbstcampus 2011 – GAE Reloaded 12
  • 13. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 13
  • 14. Getting started… • Ein Google-Account • Ohne Useraccount keine GAE • Eine Handynummer • Aktivierungs-SMS • Eclipse (ab Europa / 3.3 unterstützt) • Indigo ist OK • Alternativ NetBeans oder CLI • App Engine SDK oder Eclipse Plugin • Aktuelle Version der SDK ist 1.3.7 1.5.3 (!) Herbstcampus 2011 – GAE Reloaded 14
  • 15. Anmelden, Installation • https://appengine.google.com/ • Google Account eingeben • Handynummer eingeben • muss angegeben werden, um GAE freizuschalten • Installation Eclipse Plugin: http://code.google.com/intl/de-DE/eclipse/docs/download.html • Eclipse Update Sites dort Herbstcampus 2011 – GAE Reloaded 15
  • 16. „Hallo Welt!“ • Neues Projekt anlegen Herbstcampus 2011 – GAE Reloaded 16
  • 17. „HalloWelt“ • GWT sollte (vorerst) nicht ausgewählt sein • Hier Auswahl der GAE API 1.5.0 Herbstcampus 2011 – GAE Reloaded 17
  • 18. Und das fertige Projekt… • Default-Pakete und Libs werden eingefügt • JDO ist Persistenz- Default • Voreinstellungen für Konfigurationen Herbstcampus 2011 – GAE Reloaded 18
  • 19. Servlet sagt „Hello, World“ package de.adesso.hgu.hc2010.hallowelt; import java.io.IOException; import javax.servlet.http.*; @SuppressWarnings("serial") public class HalloWeltServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.getWriter().println("Hello, world"); } } • Starten der Applikation innerhalb von Eclipse (RunAs -> Web Application • http://localhost:8888 ist Standard Herbstcampus 2011 – GAE Reloaded 19
  • 20. Applikation bei GAE registrieren • https://appengine.google.com/start/createapp Herbstcampus 2011 – GAE Reloaded 20
  • 21. DD anpassen <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>hc2011hallowelt</application> <version>1</version> <!-- Configure java.util.logging --> <system-properties> <property name="java.util.logging.config.file“ value="WEB-INF/logging.properties"/> </system-properties> </appengine-web-app> Herbstcampus 2011 – GAE Reloaded 21
  • 22. GAE Deployment Herbstcampus 2011 – GAE Reloaded 22
  • 23. GAE Postdeployment • GAE DashBoard gibt Infos über Zugriffe, verbrauchte Quota, Logs usw. • Verwaltung von Versionen einer Applikation • Fallback auf alte Version möglich • Aufruf der Applikation über http://halloherbstcampus.appspot.com/helloherbstcampus Herbstcampus 2011 – GAE Reloaded 23
  • 24. GAE Dashboard Herbstcampus 2011 – GAE Reloaded 24
  • 25. Google API's • Es stehen viele Google API's zur Verfügung • Analytics Data Export • Apps for your Domain • Books • Calendar • Contacts • Spreadsheet • Webmaster Tools • ...und einigemehr Herbstcampus 2011 – GAE Reloaded 25
  • 26. Google Services • Blobstore • Um sehr große Datenblöcke zu speichern • Mail • Mails senden und empfangen • Memcache • Verteiltes in-memory cache • Implementiert JSR 107 (JCache) • User • Authentifizierung gegen Google und OpenID Accounts • XMPP • Versenden / Empfangen von XMPP-Messages (GTalk, Jabber) Herbstcampus 2011 – GAE Reloaded 26
  • 27. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 27
  • 28. GAE - Persitenz • Persistenz über JDO und JPA möglich • Als ORM kommt DataNucleus in der Version 1.1 (aktuell ist 2.x) zum Einsatz (http://www.datanucleus.org) • In GAE/DN JDO besser dokumentiert als JPA (immer noch!) • Alternativ gibt es eine Lowlevel-API • Im Hintergrund keine SQL-Datenbank sondern Google BigTable • In memory SQL-DB‘s sind möglich • Enhancement der Entity-Klassen wegen DataNucleus (JDO / JPA) Herbstcampus 2011 – GAE Reloaded 28
  • 29. GAE - JPA • In persistence.xml Konfiguration des transaktionalen Verhaltens. • Default: <persistence-unit name="transactions-optional"> <provider>org.datanucleus.store.appengine.jpa.DatastorePersistencePro vider</provider> <properties> <property name="datanucleus.NontransactionalRead" value="true" /> <property name="datanucleus.NontransactionalWrite” value="true" /> <property name="datanucleus.ConnectionURL” value="appengine" /> </properties> </persistence-unit> Herbstcampus 2011 – GAE Reloaded 29
  • 30. GAE – JPA-Einschränkungen • Keine @ManyToMany • Keine Join-Queries • Bei Vererbung keine Unterstützung für • InheritanceType.SINGLE_TABLE • InheritanceType.JOINED • Keine Aggregate queries (group by, having, sum, avg, min, max) • Keine Polymorphe Queries Herbstcampus 2011 – GAE Reloaded 30
  • 31. GAE – Und paar Punkte mehr • Resultsets sind nicht gefüllt, daher: resultSet.size(); • Id-Felder: Unsupported primary key type: long • GenerationType.TABLE: javax.persistence.PersistenceException: Transaction is still active. • Klappt besser: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key key; Herbstcampus 2011 – GAE Reloaded 31
  • 32. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 32
  • 33. 'JRE Class White List' • Die ‚JRE Class White List‘ definiert die Klassen, die von der GAE Sandbox unterstützt werden http://code.google.com/intl/de-DE/appengine/docs/java/jrewhitelist.html • Die Applikation darf nicht • Eigene Threads starten • Keine Dateien schreiben • Keine „willkürlichen“ Netzwerkverbindungen aufbauen Herbstcampus 2011 – GAE Reloaded 33
  • 34. "Will it play?" • Übersicht über gängige Frameworks und Sprache http://code.google.com/p/googleappengine/wiki/WillItPlayInJava • Keine Unterstützung für • JAX-RPC • JDBC, JMS, JNDI, RMI • Hibernate – Inkompatibel • Groovy, Scala usw: Supported (kein Akka!) • JAX-WS inzwischen teilweise vorhanden http://code.google.com/p/googleappengine/issues/detail?id=1270 http://code.google.com/appengine/articles/soap.html Herbstcampus 2011 – GAE Reloaded 34
  • 35. Workaround... • Umgehung Whitelist / erzwungene Kompatibilität • JARJAR (http://code.google.com/p/jarjar/) • Erstellt eine JAR, Umbenennung von Paketen • Bytecode-Transformation für nicht mehr gültige Referenzen auf umbenannte Pakete Herbstcampus 2011 – GAE Reloaded 35
  • 36. Spring… • Spring = Semi-Kompatibel (nicht alle JARs) • Spring MVC-Applikation mit Spring Beans • Setup: Spring JARs in WAR/WEB-INF/lib kopieren und in CP aufnehmen <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/springgae/*</url-pattern> </servlet-mapping> • Beispiel im Cook Book: http://peterbacklund.blogspot.com/2009/04/running-spring-on-google-app-engine.html Herbstcampus 2011 – GAE Reloaded 36
  • 37. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 37
  • 38. Quota • GAE ist kostenlos innerhalb der Quota-Grenzen • Stärkere Ausnutzung der Infrastruktur gegen Bezahlung möglich, muss explizit eingeschaltet werden • Quota verbraucht = HTTP 403 FORBIDDEN oder Exception • „Per minute quota“ – ca. 500 Req. / min. Herbstcampus 2011 – GAE Reloaded 38
  • 39. Quota – weitere Details Ressource Quota Request size 10 mb Response size 10 mb Request max. Dauer 30 sec. Maximale Anzahl Files 3000 Maximale Dateigröße 10 mb Herbstcampus 2011 – GAE Reloaded 39
  • 40. Performance • Max. 500 req. / sec. (Quota) • Simpler Test (schreiben und lesen eines Datensatzes) Herbstcampus 2011 – GAE Reloaded 40
  • 41. Agenda • Was ist überhaupt eine „Cloud“ • Die Google App Engine • Getting started: „Hallo Welt“ • Persistenz in Google App Engine • Limitierungen in GAE/J • Quota und Performance • Build-Tools Herbstcampus 2011 – GAE Reloaded 41
  • 42. Build… • Ant wird unterstützt • Entity-Klassen müssen „manuell“ Enhanced werden, Ant- Task wird von DataNucleus angeboten • Maven • Maven2 Plugin verfügbar • (http://code.google.com/p/maven-gae-plugin/) • Archtypes für JSP, GWT und Wicket-Projekte • Enhancement über Maven-Plugins von DataNucleus Herbstcampus 2011 – GAE Reloaded 42
  • 43. Vielen Dank! Dr. Halil-Cem Gürsoy adesso AG halil-cem.guersoy [at] adesso.de @hgutwit http://goo.gl/hljRS
  • 44. Wir suchen Sie als Software Architekt (m/w) Projektleiter (m/w) Senior Software Engineer (m/w) jobs@adesso.de www.AAAjobs.de Herbstcampus 2011 – GAE Reloaded 44