SlideShare a Scribd company logo
1 of 15
Download to read offline
2016.6.1
Kenji Kazumura
Fujitsu Limited
Challenge for
GlassFish Buildpack
Copyright 2016 FUJITSU LIMITED
Cloud Foundry Tokyo Meetup #2
About me
Copyright 2016 FUJITSU LIMITED
Java VM developer
Working for Fujitsu
Interstage Application Server
JSR 204 Expert Group
Board Member of Executive Committee
Author of On-line Java Learning Courses
https://directshop.fom.fujitsu.com/shop/commodity_param/ctc/el_middleit/shc/0/cmc/ASP03737
JCP (Java Community Process)
https://directshop.fom.fujitsu.com/shop/commodity_param/ctc/el_middleit/shc/0/cmc/ASP03738
1
Agenda
Copyright 2016 FUJITSU LIMITED
Motivation
GlassFish Buildpack
RDS
Context Root
Summary
Logging
2
Motivation
Copyright 2016 FUJITSU LIMITED
Why we need GlassFish ?
Based on Tomcat
Java Buildpack already exists
Standardized framework on which
WebSocket, JAX-RS, JPA, etc is available
Play and Spring also available
Enterprise system like this
Help migrating from on-premise to cloud
3
GlassFish Buildpack
Copyright 2016 FUJITSU LIMITED
Based on GlassFish 4.1 WebProfile
Servlet 3.1
JavaServer Pages(JSP) 2.3
Unified Expression Language(EL) 3
Debugging Support for Other Languages (JSR-45) 1
JavaServer Pages Standard Tag Library(JSTL) 1.2
JavaServer Faces(JSF) 2.2
Java API for RESTful Web Services(JAX-RS) 2
Java API for WebSocket(WebSocket) 1
Java API for JSON Processing(JSON-P) 1
Common Annotations for the Java Platform (JSR-250) 1.2
Enterprise JavaBeans(EJB) 3.2 Lite
Java Transaction API(JTA) 1.2
Java Persistence API(JPA) 2.1
Bean Validation 1.1
Managed Beans 1
Interceptors 1.2
Contexts and Dependency Injection for the Java EE Platform 1.1
Dependency Injection for Java
APIs
4
Challenge
Copyright 2016 FUJITSU LIMITED
20 engineers
5 months
No one had experience to use
Cloud Foundry before
All are application server developers
Start project without Cloud Foundry
5
Context Root
Copyright 2016 FUJITSU LIMITED
Context root is different between
GlassFish and Cloud Foundry standard
You can use old way by setting
FJBP_CONTEXT_ROOT to ‘app’
URL
Cloud Foundry app.paas.fujitsu.com
GlassFish app.paas.fujitsu.com/app
‘app’ is a name of your application
Change GlassFish default URL to
the same as Cloud Foundry standard
6
Logging
Copyright 2016 FUJITSU LIMITED
Local storage should not be used
on Cloud Foundry
GlassFish supposes local storage
http access logs
logs of GlassFish itself
Change all output to standard out
7
Relational Database Service
Copyright 2016 FUJITSU LIMITED
On-Premise
Tightly coupled with JDBC
Describe JDBC information at config file
Cloud
Should couple loosely with JDBC
How do you do that ?
Usually get info from environment vars
8
Example1
Copyright 2016 FUJITSU LIMITED
public class DBAccess extends HttpServlet {
Connection getConnection() {
String env = System.getenv("VCAP_SERVICES");
if ( env != null ) {
try {
JsonReader reader = Json.createReader(new StringReader(env));
JsonObject servicesObject = jsonReader.readObject();
reader.close();
JsonObject rdsObject = servicesObject.getJsonObject("fujitsurds");
String uri = rdsObject.getString("uri");
Connection connection = DriverManager.getConnection(uri);
return connection;
} catch ( Exception e ) {
return null;
……
9
Example2
Copyright 2016 FUJITSU LIMITED
public class DBAccess extends HttpServlet {
@Resource (name = “jdbc/porstresqlService”)
private DataSource ds;
…
GlassFish Buildpack provides
auto binding feature
‘postgresqlService’ is the name of the service bound to your app
i.e.
% cf bind-service myApp postgresqlService
10
Summary
Copyright 2016 FUJITSU LIMITED
Give it a try !
Any feedbacks are appreciated
11
Q/A
Copyright 2016 FUJITSU LIMITED12
Copyright 2016 FUJITSU LIMITED
Trademarks of other companies are used in this documentation only to
identify particular products or systems.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other company and product names in this documentation are trademarks or
registered trademarks of their respective owners.
13
Copyright 2010 FUJITSU LIMITED

More Related Content

What's hot

What's hot (20)

Java EE 6
Java EE 6Java EE 6
Java EE 6
 
Java EE 6 Aquarium Paris
Java EE 6 Aquarium ParisJava EE 6 Aquarium Paris
Java EE 6 Aquarium Paris
 
Pyramid Security
Pyramid SecurityPyramid Security
Pyramid Security
 
Glass Fishv3 March2010
Glass Fishv3 March2010Glass Fishv3 March2010
Glass Fishv3 March2010
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
GlassFish v3 at JavaZone 09
GlassFish v3 at JavaZone 09GlassFish v3 at JavaZone 09
GlassFish v3 at JavaZone 09
 
Java EE 7 for Real Enterprise Systems
Java EE 7 for Real Enterprise SystemsJava EE 7 for Real Enterprise Systems
Java EE 7 for Real Enterprise Systems
 
OSGi in 5 minutes
OSGi in 5 minutesOSGi in 5 minutes
OSGi in 5 minutes
 
Escape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud ServiceEscape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud Service
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
 
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
 
Oval Internetworking Devices
Oval Internetworking DevicesOval Internetworking Devices
Oval Internetworking Devices
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
 
GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
 
インフラ野郎Azureチーム Night
インフラ野郎Azureチーム Nightインフラ野郎Azureチーム Night
インフラ野郎Azureチーム Night
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
GlassFish v2.1
GlassFish v2.1GlassFish v2.1
GlassFish v2.1
 
Let's reconsider about collecting logs. Plus, visiting elastic@Moutain View!
Let's reconsider about collecting logs. Plus, visiting elastic@Moutain View!Let's reconsider about collecting logs. Plus, visiting elastic@Moutain View!
Let's reconsider about collecting logs. Plus, visiting elastic@Moutain View!
 

Viewers also liked (6)

Versatil Javaチューニング
Versatil JavaチューニングVersatil Javaチューニング
Versatil Javaチューニング
 
CPUから見たG1GC
CPUから見たG1GCCPUから見たG1GC
CPUから見たG1GC
 
microprofile
microprofilemicroprofile
microprofile
 
JavaDayTokyo2015 [3-1]
JavaDayTokyo2015 [3-1]JavaDayTokyo2015 [3-1]
JavaDayTokyo2015 [3-1]
 
Soft layer users_community_20140523_bitisle_narisako_subset
Soft layer users_community_20140523_bitisle_narisako_subsetSoft layer users_community_20140523_bitisle_narisako_subset
Soft layer users_community_20140523_bitisle_narisako_subset
 
Javaでトランザクショナルメモリを使う
Javaでトランザクショナルメモリを使うJavaでトランザクショナルメモリを使う
Javaでトランザクショナルメモリを使う
 

Similar to Challenge for GlassFish Builpack

Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
Abhishek Gupta
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
Abhishek Gupta
 

Similar to Challenge for GlassFish Builpack (20)

Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
 
EmbbededGF@JavaOneHyd
EmbbededGF@JavaOneHydEmbbededGF@JavaOneHyd
EmbbededGF@JavaOneHyd
 
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
 
Java EE7
Java EE7Java EE7
Java EE7
 
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache AriesOSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
 
Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
GlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and FutureGlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and Future
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
 
GlassFish REST Administration Backend
GlassFish REST Administration BackendGlassFish REST Administration Backend
GlassFish REST Administration Backend
 
Microsoft, java and you!
Microsoft, java and you!Microsoft, java and you!
Microsoft, java and you!
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOF
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013
 
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
 
Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010
Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010
Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010
 
CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara CloudStack Meetup Santa Clara
CloudStack Meetup Santa Clara
 
From Zero to Cloud in 12 Easy Factors
From Zero to Cloud in 12 Easy FactorsFrom Zero to Cloud in 12 Easy Factors
From Zero to Cloud in 12 Easy Factors
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011
 

Recently uploaded

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 

Recently uploaded (20)

Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 

Challenge for GlassFish Builpack

  • 1. 2016.6.1 Kenji Kazumura Fujitsu Limited Challenge for GlassFish Buildpack Copyright 2016 FUJITSU LIMITED Cloud Foundry Tokyo Meetup #2
  • 2. About me Copyright 2016 FUJITSU LIMITED Java VM developer Working for Fujitsu Interstage Application Server JSR 204 Expert Group Board Member of Executive Committee Author of On-line Java Learning Courses https://directshop.fom.fujitsu.com/shop/commodity_param/ctc/el_middleit/shc/0/cmc/ASP03737 JCP (Java Community Process) https://directshop.fom.fujitsu.com/shop/commodity_param/ctc/el_middleit/shc/0/cmc/ASP03738 1
  • 3. Agenda Copyright 2016 FUJITSU LIMITED Motivation GlassFish Buildpack RDS Context Root Summary Logging 2
  • 4. Motivation Copyright 2016 FUJITSU LIMITED Why we need GlassFish ? Based on Tomcat Java Buildpack already exists Standardized framework on which WebSocket, JAX-RS, JPA, etc is available Play and Spring also available Enterprise system like this Help migrating from on-premise to cloud 3
  • 5. GlassFish Buildpack Copyright 2016 FUJITSU LIMITED Based on GlassFish 4.1 WebProfile Servlet 3.1 JavaServer Pages(JSP) 2.3 Unified Expression Language(EL) 3 Debugging Support for Other Languages (JSR-45) 1 JavaServer Pages Standard Tag Library(JSTL) 1.2 JavaServer Faces(JSF) 2.2 Java API for RESTful Web Services(JAX-RS) 2 Java API for WebSocket(WebSocket) 1 Java API for JSON Processing(JSON-P) 1 Common Annotations for the Java Platform (JSR-250) 1.2 Enterprise JavaBeans(EJB) 3.2 Lite Java Transaction API(JTA) 1.2 Java Persistence API(JPA) 2.1 Bean Validation 1.1 Managed Beans 1 Interceptors 1.2 Contexts and Dependency Injection for the Java EE Platform 1.1 Dependency Injection for Java APIs 4
  • 6. Challenge Copyright 2016 FUJITSU LIMITED 20 engineers 5 months No one had experience to use Cloud Foundry before All are application server developers Start project without Cloud Foundry 5
  • 7. Context Root Copyright 2016 FUJITSU LIMITED Context root is different between GlassFish and Cloud Foundry standard You can use old way by setting FJBP_CONTEXT_ROOT to ‘app’ URL Cloud Foundry app.paas.fujitsu.com GlassFish app.paas.fujitsu.com/app ‘app’ is a name of your application Change GlassFish default URL to the same as Cloud Foundry standard 6
  • 8. Logging Copyright 2016 FUJITSU LIMITED Local storage should not be used on Cloud Foundry GlassFish supposes local storage http access logs logs of GlassFish itself Change all output to standard out 7
  • 9. Relational Database Service Copyright 2016 FUJITSU LIMITED On-Premise Tightly coupled with JDBC Describe JDBC information at config file Cloud Should couple loosely with JDBC How do you do that ? Usually get info from environment vars 8
  • 10. Example1 Copyright 2016 FUJITSU LIMITED public class DBAccess extends HttpServlet { Connection getConnection() { String env = System.getenv("VCAP_SERVICES"); if ( env != null ) { try { JsonReader reader = Json.createReader(new StringReader(env)); JsonObject servicesObject = jsonReader.readObject(); reader.close(); JsonObject rdsObject = servicesObject.getJsonObject("fujitsurds"); String uri = rdsObject.getString("uri"); Connection connection = DriverManager.getConnection(uri); return connection; } catch ( Exception e ) { return null; …… 9
  • 11. Example2 Copyright 2016 FUJITSU LIMITED public class DBAccess extends HttpServlet { @Resource (name = “jdbc/porstresqlService”) private DataSource ds; … GlassFish Buildpack provides auto binding feature ‘postgresqlService’ is the name of the service bound to your app i.e. % cf bind-service myApp postgresqlService 10
  • 12. Summary Copyright 2016 FUJITSU LIMITED Give it a try ! Any feedbacks are appreciated 11
  • 14. Copyright 2016 FUJITSU LIMITED Trademarks of other companies are used in this documentation only to identify particular products or systems. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other company and product names in this documentation are trademarks or registered trademarks of their respective owners. 13