Spring Cloud Configuration

Why 12 Factor Application Patterns, Microservices and CloudFoundry Matter? Part 2 – What to change and how.

I first described a difficult scenario that I faced a few years ago.   This article is my recommendations to the current custodians of that project on what to change and how.

With the help of open source frameworks like Spring Cloud and open source platforms like Cloudfoundry, you aren’t forced into having a fragile, manual SDLC.   The first step is to embrace change and join a vibrant community that is succeeding in software development.

 

Overview

  • Increase agility through process, tools and culture
  • Examine the code and depedencies, determine modules based on business domain.
  • Refactor the monolithic EAR into microservices living in JARs guided by the 12 Factor Application patterns and microservices recommendations.
  • 12FA – III – Store configuration in the environment (or even better use a configuration server)
  • Change the Development Process, Frameworks, Libraries and Tools.
  • Change the Build Process and Tools.  Embrace Gradle, Maven, JDK 8.
  • Change the Delivery Process.   Enact Continuous delivery.
  • Change the Database modifications and migration Process and Tools.
  • Change the run-time platform from legacy application server to a PaaS.
  • Centralize the logging.    Using PCF Loggregator and tools like ELK and PaperTrail.
  • Embrace industry standard open source tools, libraries and frameworks
  • Good code fails when you don’t have good process and a platform to help you.
  • Good teams fail when you don’t have a good culture that embraces DevOps, microservices and not giant monoliths.

 

So how could we have improved our process?   The first step is to admin you have a problem and seek help.   By looking to the community, open source and successful startups that have faced similar struggles with monolithic J2EE code bases (Ebay, Netflix), we can determine some functional patterns.

 

Patterns and Principles for Change

  • Use Jenkins to deploy your app with no downtime to CloudFoundry.
  • Use CloudFoundry deployments to do A/B testing with no downtime or difficulty.
  • Bind to database, using the same process in development, test, Q/A and production.   No manual configuration or configuration changes.   Operators make available the correct database settings through the marketplace.  Same manifest and bindings will point to different databases in different spaces.
  • To migrate database changes use flywaydb or liquibase.   These are very well integrated into Spring Boot.
  • Look at NoSQL for part of your database workload, polyglot persistence makes sense in many cases.   For MongoDB development, you handle change management with Mongeez, which is automatically done with JHipster.
  • Smoke tests and automated tests tied to Jenkins.
  • Test against CloudFoundry development for local development, fast deployments, run unit and integration tests locally.
  • Use Maven or Gradle for builds, not ANT.
  • Use Circuit breakers in your web calls to avoid breaking systems and fail safely.
  • Use APM and JMX for deep checks using Pivotal Ops Metrics for CloudFoundry.
  • Have automated scripts check one log stream.  Use tools like ELK (ElasticSearch+Logstash+Kibana) to examine logs.
  • Use CloudFoundry containers that don’t make you SSH to many machines, removing a big manual step that could be a security issue.
  • Move to using smaller, lighterweight Spring Boot Jars and Wars; not giant EAR files.
  • Use lightweight web containers like Jetty, Tomcat, tcServer, or Undertow.
  • Use lightweight frameworks, remember YAGNI and KISS.
  • Read and embrace:  Release It!
  • Break up the apps into smaller, logical components that model real business functionality.
  • Refactor existing code guided by tests, enhancing and adding more tests as the code evolves.  Remembering to use code coverage tools like Jacoco.
  • Design clean RESTful APIs guided by SRP (Single Responsibility Principle).
  • Use smart, modern opinionated frameworks for development like Spring Boot, DropWizard and RatPack.
  • Install GVM and use it to install SpringBoot, Gradle, Groovy, LazyBones and other great tools.  example:   gvm install springboot
  • Use Spring Cloud Connectors, Spring Cloud Netflix projects for Service Discovery and other useful services to enable microservices orchestration and development.
  • Use a very helpful application generator like JHipster.
  • Use Domain Driven Design.
  • Keep to the basics of OOD for existing code and Functional Reactive Programming for new code.
  • Document your API with Spring REST Docs or Swagger.  There is a great presentation on that here.
  • Start your green field projects with one button click or use the Spring CLI (spring init -d=web,data-jpa,actuator,data-rest –build=maven newappdir/).

 

References

Service Discovery

Migrating to Spring 4

Spring 4 is now stable enough to forget about Spring 3.2 and move on.  With support for all the current and newest SE and EE Java technologies,

it is now time to embrace this upgrade.

For personal projects I have started and the excellent Spring Boot as a help.  For commercial work, we are replacing are maven dependencies now.

References

 

picture-297029

Java REST Options

REST with or without a Web Container

http://programmers.stackexchange.com/questions/155467/selecting-a-jax-rs-implementation-for-a-new-project

CXF2 or RESTLet or RESTEasy or JAX-RS (Jersey) or DropWizard or Spring Boot or …  There have been an number of options for a while.   Spring Boot and Drop Wizards

are very cool because of the simple deploy and lack of need for a cumbersome EAR or WAR deploy to a JEE server.  DropWizard also

has a ton of features and built-in metrics.  Resthub is very cool too, but not well supported.  JAX-RS works nice if you use Glassfish +

NetBeans 7.4 + JEE 7.  Since that lets you create REST client and server and the client can be HTML5 and is mostly generated for you.  It

will also build REST services for you from existing entities or relational tables.  I wish it had a wizard to do that easily from NoSQL

entities.   NodeJS has a nice REST client.   Also you can try your hand at developing REST in NodeJS or Cujo REST.   A REST client from JavaScript is easy, here is

a nice article on RestJS with Spring.

http://www.slideshare.net/mraible/comparing-jvm-web-frameworks-devoxx-france-2013

Dropwizard

https://github.com/jacek99/dropwizard-spring-di-security-onejar-example

http://www.slideshare.net/JacekFurmankiewicz/dropwizard-spring

http://www.slideshare.net/sullis/production-ready-web-services-with-dropwizard

https://www.openshift.com/blogs/day-13-dropwizard-the-awesome-java-rest-server-stack

https://github.com/shekhargulati/day13-dropwizard-mongodb-demo-app

http://dropwizard.codahale.com/manual/auth/

http://kielczewski.eu/2013/04/developing-restful-web-services-using-dropwizard/

http://www.slideshare.net/savu.andrei/simple-rest-with-dropwizard

http://gary-rowe.com/agilestack/2012/06/06/multibit-merchant-deployment-driven-design/

Spring Boot

http://projects.spring.io/spring-boot/

RESTHub

http://resthub.org/

mvn archetype:generate -DarchetypeGroupId=org.resthub -DarchetypeArtifactId=resthub-jpa-backbonejs-archetype -DarchetypeVersion=2.1.4

mvn jetty:run

https://github.com/englishtown/vertx-mod-jersey/ http://www.jamesward.com/2012/08/13/containerless-spring-mvc

 

Other Links

JQuery.REST

 

Java and Oracle Links

Advanced Java Programming Techniques with Oracle Database 11g

adv-java-prog-techqs-with-odb-400715-en-in.pdf

http://www.oracle.com/technetwork/database/enterprise-edition/appdev-java-developers-perspective–132536.pdf

http://www.oracle.com/technetwork/database/enterprise-edition/mensah-ch1-129492.pdf

Oracle® Universal Connection Pool for JDBC

http://docs.oracle.com/cd/E11882_01/java.112/e12265.pdf

Oracle® Database JDBC Developer’s Guide 11g Release 2 (11.2)

http://docs.oracle.com/cd/E11882_01/java.112/e16548.pdf

Java Stored Procedures

http://www.oracle.com/technetwork/database/enterprise-edition/ow-30820-java-stored-proc-paper.pdf

Oracle Data Source

http://stackoverflow.com/questions/1427890/oracledatasource-vs-oracle-ucp-pooldatasource

http://stackoverflow.com/questions/2423490/how-good-is-oracle-universal-connection-pool-ucp/4444922#4444922

JMX For Spring

http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/jmx.html

for monitoring through visual jvm and many other tools

Hibernate and Log4j via JMX

http://architects.dzone.com/articles/watch-your-spring-webapp

http://www.javacodegeeks.com/2012/01/enabling-jmx-in-hibernate-ehcache-qurtz.html

Creating an Asynchronous, Event-Driven Application with Reactor

sprint boot cli
http://dsyer.com/presos/decks/spring-boot-intro.html#slide6
http://spring.io/guides/gs/spring-boot/
spring –help

What’s New for Java Performance, Scalability, and Security with Oracle Database 12c [CON8597]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8597

A JDBC Datasource for Failing Over and Replaying In-Flight Transactions [CON9234]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=9234

Java SE and Oracle Java Embedded: What’s New and What’s Coming [CON8936]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8936&tclass=popup

Experiences with Evangelizing Java Within the Database [UGF8861]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8861&tclass=popup

Hitchhiker’s Guide to XQuery with Oracle Database 11g Release 2 and Oracle SQL Developer 3.2.2 [CON7615]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=7615&tclass=popup

RESTful Web Services [CON8852]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8852&tclass=popup

Implementing Oracle Commerce: Best Practices for Experience and Commerce [CON9198] Oracle ATG and Oracle Endeca
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=9198

JVM Diagnostics: Java Profiling in Production Environments [CON9571]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=9571

JPA Tracing

https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide

Testing

JPA / Data Tools

Spring MVC + Modern HTML5

Tobacco tries it’s best to always include the latest release versions of most popular client libraries.

Latest Tobacco 1.0.12 charges you with Spring 3.2.2, Twitter Bootstrap 2.3.1, jQuery 1.9.1 and Backbone.js 1.0.0

Tobacco Maven Architype for building a project

 

 

https://github.com/priyatam/springmvc-twitterbootstrap-showcase

http://bthurley.wordpress.com/2012/07/25/initialising-datatables-with-twitter-bootstrap-and-spring-mvc-ajax/

http://duckranger.com/2012/07/spring-mvc-and-twitter-bootstrap-customizing-the-input-fields/

http://bthurley.wordpress.com/2012/07/18/spring-mvc-with-restful-datatables/

http://duckranger.com/2012/12/capturing-property-changes-with-spring-jpa-and-hibernate/

https://github.com/eugenp/REST#readme

 

HP Anywhere (Java + JavaScript)

HP Anywhere

Review by Timothy Spann

Basic Usage

1.1           IDE

Eclipse

eclipse

 

1.2           NOTE

  • Fix required:  HP Anywhere added to maven.bat

SET MAVEN_OPTS=-Djava.net.preferIPv4Stack=true

  • Only runs on Windows.  Windows Only Server
  • Only for developing single page applications (SPA) with Java back-end and JS/HTML5/CSS front-end.

 

1.3           Technology List

  • Eclipse juno
  • jdk 1.7
  • maven
  • tomcat
  • H2
  • jersey
  • enyo js
  • slf4j
  • apache commons
  • xerces
  • json
  • sencha
  • jax-ws
  • ant
  • curl
  • spring 3.0.5
  • jersey
  • junit 4.8
  • JEE
  • JAXB
  • DOM4J
  • Lucene
  • JSTL
  • PhoneGap
  • POI
  • Velocity
  • STAX
  • Xalan
  • Joda Time
  • Hibernate
  • GraniteDS
  • Jackson
  • JTDS
  • JQuery
  • JDOM
  • Sencha Touch
  • Cassandra
  • MS SQL Server

1.4           Links

HP Anywhere: Mobile Apps for the Enterprise

 

1.5           HP Anywhere Architecture for Developers

(see: http://developer.hpanywhere.com/wp-content/uploads/2013/03/HP_Anywhere_Architecture_for_Developers.pdf)

 

 

 

container

overview

 

Spring Tutorials – Links

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-customized-user-login-logout.html

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-service-dao-persistence.html

http://tshikatshikaaa.blogspot.com/2012/08/jpa-tutorial-with-examples-using-hibernate-standalone.html

http://tshikatshikaaa.blogspot.com/2012/10/spring-mvc-form-validation-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/09/junit-testing-spring-service-and-dao.html

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-controller-junit-testing.html

http://tshikatshikaaa.blogspot.nl/2012/09/spring-web-jpa-hibernate-in-memory.html

http://tshikatshikaaa.blogspot.com/2012/11/serving-static-resources-with-spring-mvc.html

http://tshikatshikaaa.blogspot.nl/2012/09/junit-testing-spring-service-and-dao.html

http://tshikatshikaaa.blogspot.com/2013/01/anatomy-of-default-openshift-spring-web.html

http://tshikatshikaaa.blogspot.nl/2013/01/spring-selenium-tests-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-with-http-only.html

http://www.infoq.com/presentations/Introduction-WebSocket

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-from-java.html

http://tshikatshikaaa.blogspot.com/2012/10/setting-logging-dependencies-in-spring.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-with-ajax.html

http://tshikatshikaaa.blogspot.com/2012/10/returning-json-in-spring-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/11/fetching-json-with-ajax-in-spring-mvc-context.html

http://tshikatshikaaa.blogspot.com/2012/11/introduction-to-spring-jpa-data-features.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-error-handling.html

http://www.dzone.com/links/r/caching_with_spring_data_redis.html

http://www.dzone.com/links/r/spring_mvc_how_to_use_sessionattributes_annotation.html

http://www.dzone.com/links/r/cloud_stack_of_your_dreams_bootstrap_and_spring_r.html

http://www.dzone.com/links/r/spring_roo_and_twitter_bootstrap_roostrap_for_spr.html

http://www.dzone.com/links/r/spring_transaction_propagation_tutorial.html

http://www.dzone.com/links/r/rest_services_with_jaxrs_and_spring_handling_lost.html

 

 

 

 

 

Spring Resources



















http://www.springsource.com/files/uploads/all/Spring-Web-Developer-Certification-Study-Guide.pdf







Long Classpaths in Windows

There’s many options to fix this:

Other options

Windows Symbolic Links Utility (Junction v1.06)

 

http://www.java-forums.org/advanced-java/57496-classpath-max-length.html

 

http://unserializableone.blogspot.com/2007/10/solution-to-classpath-too-long-aka.html

 

IBM JDK Limitations (2,031 characters use java.ext.dirs)

 

Try ext dir for Oracle JDK.

 

Try Jawful, an interesting utility.

 

Try classpath wildcards or a Stackoverflow discussion on Long Java Classpaths.

 

Some general information on Classpath.

 

 

Spring / HTML5 / Flex

Spring Remoting
FLEX for Spring
Spring BlazeDS Integration
HTML5
Mobile First Responsive Web Design
Application Cache

Nodejitsu

Nodejitsu is another Node.js PAAS that offers a free plan.  The free plan is shared hosting through Joyent.  The performance of NodeJitsu’s free plan is very good, especially considering it’s free.  To start sign up on NodeJitsu’s site with the free plan and then follow the Getting Started instructions.  It was a very quick process on Windows.  You can use either their command line, Node.JS based jitsu tool, use the admin web site or use the HTTP API.

Executing the basic jitsu command will show you the following information:

G:>jitsu
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command
help: ___ __
help: / / / /_ / /
help: __/ / / __/ /__/
help:
help: Flawless deployment of Node.js apps to the cloud
help: open-source and fully customizable.
help: https://github.com/nodejitsu/jitsu
help:
help: Usage:
help:
help: jitsu <resource> <action> <param1> <param2> ...
help:
help: Common Commands:
help:
help: To sign up for Nodejitsu
help: jitsu signup
help:
help: To log into Nodejitsu
help: jitsu login
help:
help: To install a pre-built application
help: jitsu install
help:
help: Deploys current path to Nodejitsu
help: jitsu deploy
help:
help: Lists all applications for the current user
help: jitsu list
help:
help: Additional Commands
help: jitsu apps
help: jitsu logs
help: jitsu env
help: jitsu conf
help: jitsu users
help: jitsu databases
help: jitsu snapshots
help: jitsu logout
help:
help: Options:
help: --version, -v print jitsu version and exit
[string]
help: --localconf search for .jitsuconf file in ./ and then parent dir
ectories [string]
help: --jitsuconf, -j specify file to load configuration from
[string]
help: --noanalyze skip require-analyzer: do not attempt to dynamically
detect dependencies [boolean]
help: --colors --no-colors will disable output coloring
[boolean] [default: true]
help: --release, -r specify release version number or semantic increment
(build, patch, minor, major) [string]
help: --raw jitsu will only output line-delimited raw JSON ( use
ful for piping ) [boolean]
info: Nodejitsu ok

To add a MongoDB NoSQL Database is really simple!

jitsu databases create mongo myMongo
info: Welcome to Nodejitsu tspannnodejs
info: It worked if it ends with Nodejitsu ok
info: Executing command databases create mongo myMongo
info: A new mongo has been created
data: Database Type: mongo
data: Database Name: myMongo
data: Connection url: mongodb://nodejitsu:c23948239348239482934@st
aff.mongohq.com:10064/nodejitsudb684248241564
info: Nodejitsu ok

To create your first test app, you can install their demo Hello World application as follows:

jitsu install helloworld
Directory of paasnodejitsuhelloworld
07/20/2012 12:41 PM <DIR> node_modules
07/20/2012 12:41 PM 1,015 package.json
07/20/2012 12:41 PM <DIR> bin
07/20/2012 12:41 PM 1,534 ReadMe.md
2 File(s) 2,549 bytes
4 Dir(s) 2,900,639,744 bytes free
cd helloworld
jitsu deploy
info: Welcome to Nodejitsu tspannnodejs
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn:
warn: Your package.json file is missing required fields:
warn:
warn: subdomain
warn:
warn: Prompting user for required fields.
warn: Press ^C at any time to quit.
warn:
prompt: subdomain: (tspannnodejs.helloworld)
warn: About to write G:paasnodejitsuhelloworldpackage.json
data:
data: {
data: contributors: [
data: { name: 'Marak Squires', email: 'marak.squires@gmail.com' },
data: { name: 'Joshua Holbrook', email: 'josh.holbrook@gmail.com' }
data: ],
data: dependencies: {},
data: repository: { type: 'git', url: 'git://github.com/nodeapps/hellowor
ld.git' },
data: bugs: { url: 'https://github.com/nodeapps/helloworld/issues' },
data: subdomain: 'tspannnodejs.helloworld',
data: engines: { node: '>=0.4' },
data: optionalDependencies: {},
data: analyze: false,
data: name: 'nodeapps-helloworld',
data: devDependencies: {},
data: scripts: { start: 'node ./bin/server' },
data: author: { name: 'Nodejitsu Inc.', email: 'support@nodejitsu.com' },
data: main: '',
data: description: 'a very basic node.js helloworld application',
data: homepage: 'http://nodeapps.github.com/helloworld',
data: version: '0.2.0',
data: licenses: [
data: { type: 'MIT', url: 'https://github.com/nodeapps/helloworld/raw
/master/LICENSE' }
data: ],
data: keywords: [ 'nodeapps', 'helloworld' ]
data: }
data:
prompt: Is this ok?: (yes) yes
info: Skipping require-analyzer because noanalyze option is set
info: Checking app availability nodeapps-helloworld
info: Creating app nodeapps-helloworld
info: Creating snapshot 0.2.0
info: Updating app nodeapps-helloworld
info: Activating snapshot 0.2.0 for nodeapps-helloworld
info: Starting app nodeapps-helloworld
info: App nodeapps-helloworld is now started
info: http://tspannnodejs.helloworld.jit.su on Port 80
info: Nodejitsu ok

 

You can see the deployed application here.

This NYC Node.js PAAS is very performant with a fast easy to use tool.  I am liking them so far.  They are also very Node.JS oriented, being the only of the PAAS vendors to use Node.JS for their command line tool.

They have also developed the very interesting FlatIron Framework, which I will be looking at next.

 

 

 

 

 

 

Nodester Node.JS + Express + Mongo App Part 1 – Nodester

The Running Node.JS Application on a Nodester

 

I am still working on putting up a full application for the tutorial.  Also I will try the same application on Nodejitsu, CloudFoundry and Heroku.

The following are the basic steps for working with Nodester. It is very similiar to all the other command-line PaaS interfaces. I am running this on
Windows, but it will work in most environments.

 

npm install nodester-cli -g
nodester user setup <username> <password>
nodester user setkey c:.sshid_rsa.pub
nodester app create <appname>
nodester app init <appname>
nodester npm install express
nodester npm install mongoose
nodester npm install socket.io

git add .
git commit -am "Ready to deploy"
git push nodester master

nodester app info
nodester app stop|start|restart
nodester app logs

For nodester they push to master for Nodester to get a new build.

Log into your Application List Page on the Administration Site for Nodester and you will see your newly added Application. Nodester has a good help system that will be useful to you while learning. The git commands are standard GIT which makes using all the cloud systems pretty similiar.

After uploading, I check the logs for errors:

nodester app logs
nodester info Showing logs for: rollerderby
New PID: 18884
chroot_runner
chroot_runner
Spawing /app/server.js
Running node v-0.8.1
:: nodester ::

App listening on port 19885

nodester info ok!

nodester deployed

 

I used there out of the box example and added a connection to my test mongo db database at MongoLab.

 

Link Section:

The final deployed application from this tutorial

http://blog.nodester.com/post/3634535277/running-websockets-on-nodester

http://blog.nodester.com/post/19902515151/tips-for-windows-users

http://blog.nodester.com/

https://github.com/nodester/nodester/wiki/

Restify with Mongodb and Mongoose (src)

Backbone.js Boilerplate

Node.JS Mongodb Native Driver

Mongoose Driver

Mongoose Tutorial

Node.JS and Mongodb Video Tutorial

Node.JS / Mongodb / Mongoose Tutorial

Finding Documents in MongoDB with Mongoose

Node.js Tutorial

Restful API with Node.js and Mongodb + Expresss & Mongoose

Backbone.js Fundamentals

Mongoose Model Definition

No, Not Python, It’s the Holy Grails…

I’ve been evaluating a few different technologies for doing some rapid web development work and recently I have been looking at the bounty of available tools, libraries, frameworks and associates of Spring.  Spring ROO and Groovy/Grails are the big two RAD tools from SpringSource and they look pretty amazing.  I don’t think I’ve found the Holy Grail of Web App development, but these two tools are really helpful in rapidly developing apps.  I am hoping someone combines Roo or Grails with Vert.x to make a really awesome alternative to Node.JS.  I like Node.JS and have been doing JavaScript for a decade, but I prefer the languages of the JVM and Vert.x’s support for multiple languages is pretty awesome.  Hmmm, Vert.x in Grails.

With the excellent STS inside Eclipse, this gives Groovy and Java a great IDE for development, testing and debugging.  And that is something that is lacking for Node.JS.  Node.JS has a few tools out there, but nothing open source, free, full of awesome mature plugins (PMD, Checkstyle, GIT, Maven, JUnit, FindBugs, …) and just plain easy to use.  Eclipse also has plugins for working with CloudFoundry, Heroku, OpenShift and other Cloud environments.

Between Grails and Roo, I really like the fact that I can remove Roo at anytime and still have a fully functionally application setup that utilizes standard Spring tools.  It’s also easier to add other cool Spring projects like Spring Social, Spring Mobile, Spring Data and more.

Both Grails and Roo support MongoDB very well and that’s great too see.  I have a few Mongo DB instances on MongoLab, MongoHQ and OpenShift.  These services all have great free developer services that are great for learning, prototyping and for tutorials.  I am really loving Heroku and OpenShift.  It’s hard to pick one, so I didn’t.  I use them both.

Vert.x + Groovy is really cool, but again not much IDE support, tools or extra libraries.  It should grow start building support now, but competition with Node.JS is pretty fierce.

Interesting, Roo vs Grails Jobs.

 

 

But if you look at just Spring (which Roo is just a tool to help with a Spring project):

 

 

There’s also some great documentation, tutorials and books on Groovy/Grails since it’s been out for a while:  http://grails.org/Tutorials  http://www.infoq.com/minibooks/grails-getting-started On the other hand, Roo is newer, but since it generates standard Spring + Java, you are really just getting a good head start on your project.

Heroku has a nice article on using both with their awesome platform:   https://devcenter.heroku.com/articles/grails  and https://devcenter.heroku.com/articles/spring-mvc-hibernate.

I will post a Github repository of some samples soon.

 

Spring MVC + Spring Data for Mongodb + Mongolab + OpenShift

I created a small tutorial application following the Spring Data for Mongodb guide with a little bacon for flavor. I wanted to use real hosting for MongoDB, so I created a database at MongoLab.   It was quick and easy and the hosting is fast and works great even remotely for local development.

The tutorial application in process is one to register your Bacon Creation for this year’s BaconFest.  The winner gets a mini BaconExplosion.

This is ONLY a test, you will not receive BACON.
image

Certification Notes

http://www.coderanch.com/how-to/java/SCJP-FAQ

http://docs.oracle.com/javase/tutorial/

http://www.oracle.com/technetwork/java/javaee/overview/index.html

http://www.google.com/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=1&cts=1330742455969&ved=0CDAQFjAA&url=http%3A%2F%2Fm2projects.googlecode.com%2Ffiles%2FSCJP_Sun_Certified_Programmer_for_Java_6_Exam_310-065.pdf&ei=boRRT5nSOOLv0gG-yejvDQ&usg=AFQjCNEYGyInJaVdgFZ2JVlZlPtOEdCFPA&sig2=E1R9kgPE6kv_3yCpI0K2BA

http://www.fileshut.com/find_files.php?submit=submit&q=Sun+Certified+Enterprise+Architect+For+Java+Ee+6+Study+Guide&ext=0&submitit=Search+Files

http://www.coderanch.com/how-to/java/ScbcdLinks

http://en.wikipedia.org/wiki/Sun_Certified_Professional

http://www.oracle.com/technetwork/java/javaee/documentation/index.html

http://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition

http://docs.oracle.com/javaee/6/tutorial/doc/

http://www.javaworld.com/javaworld/jw-04-2009/jw-04-lean-soa-with-javaee6.html

http://www.javaworld.com/javaworld/jw-02-2012/120214-jtip-rss-for-android.html

https://blogs.oracle.com/theaquarium/entry/and_then_there_were_14

http://www.oraclejavamagazine-digital.com/javamagazine/20111112#pg1

http://www.oraclejavamagazine-digital.com/javamagazine/premiere2011#pg1

http://www.oracle.com/technetwork/articles/java/unittesting-455385.html

http://www.oracle.com/technetwork/articles/java/springtojavaee-522240.html

http://www.oracle.com/technetwork/articles/java/cdi-javaee-bien-225152.html

http://code.google.com/p/jee6-cdi/wiki/DependencyInjectionAnIntroductoryTutorial_Part1

https://blogs.oracle.com/geertjan/entry/java_ee_6_cheat_sheet

http://www.oracle.com/technetwork/java/javaee/downloads/index.html

http://www.physics.usyd.edu.au/~rennie/javaEE6ReferenceSheet.html

http://www.physics.usyd.edu.au/~rennie/javaEE6ReferenceSheet.pdf

 

 

Useful Tools

Google CodePro

Part of the plug-in for Eclipse includes an awesome JUnit Test Case Generator.  It generates a lot of code you need for your unit test, much better than the OOTB Eclipse Junit Class Generator.  It generates all the methods you need to start with and most of the boilerplate test code.  It saves a lot of time and gives you a nice skeleton to start adding tests to.   Google’s CodePro is a nice free tool and a great addition to my toolbox.

https://developers.google.com/java-dev-tools/codepro/doc/features/junit/test_case_generation

My tip:  I have specific Eclipse installs for all my different tools.  One for Android Development, One Spring STS version, one JBoss/OpenShift version, one for Heroku, one for JEE, one for Client Focused / HTML 5, one for Mobile,  etc…  That way I am not loading any extra plugins.

Some of the standard plugins I like:

You definitely don’t want Android tools in your Eclipse if you are not going to do be doing Android apps everytime, keep that in a separate Eclipse install.  You can install as many as you want, space is cheap.   I have some that run of USB Sticks fine.

Recent Articles about JavaScript and Java

Jaggery JS (Server Side Framework and Server)
http://jaggeryjs.org/

Jetty on OpenShift
http://www.dzone.com/links/r/jetty_on_red_hats_openshift_enabling_lightweight.html

Introduction to AOP
http://www.javacodegeeks.com/2012/06/simple-introduction-to-aop.html

NoSQL Unit (soon for MongoDB)
http://www.javacodegeeks.com/2012/06/nosqlunit-030-released.html

Android Dashboard Design Pattern
http://www.javacodegeeks.com/2012/06/android-dashboard-design-pattern.html

App Logging
http://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html

Openshift Intro
http://www.javacodegeeks.com/2012/06/rise-above-cloud-hype-with-openshift.html

Getting Started with Spring Social
http://www.javacodegeeks.com/2012/06/getting-started-with-spring-social.html

Android UI Patterns
http://www.androiduipatterns.com/

Spring Social Google
https://github.com/GabiAxel/spring-social-google

https://github.com/GabiAxel/spring-social-google/wiki/Spring-Social-Google-Reference-Manual

 

 

 

 

ETE Presentations

Chariot Solutions Presentations / ETE Presentations
http://chariotsolutions.com/presentations

Chariot Solutions Emerging Technology Philly ETE 2012 Screencasts
http://emergingtech.chariotsolutions.com/category/screencasts/philly-ete-2012/

Chariot Solutions Videos and ETE Videos
http://www.youtube.com/user/ChariotSolutions/featured

CoffeeScript Edge
http://phillyemergingtech.com/2012/system/presentations/the_coffeescript_edge.pdf

Emerging Languages
http://phillyemergingtech.com/2012/system/presentations/Payne_Philly_ETE_2012_slides.pdf

StratisfiedJS (Structured JS)
http://onilabs.com/stratifiedjs

Large Scale Agile
http://phillyemergingtech.com/2012/system/presentations/Large-Scale_Agile_slides.pdf

Spring ROO with Addons
http://phillyemergingtech.com/2012/system/presentations/roo-addons.key.pdf

Backbone.js / Real-time Web Apps
http://phillyemergingtech.com/2012/system/presentations/realtime-web-ete-2012.pdf

Rich-Web Apps with Server Side Java
http://s3.amazonaws.com/chariot-website-production/presentation_documents/documents/000/000/632/vaadin-ria-in-server-side.pdf?AWSAccessKeyId=AKIAJTXMORYAM7NJWIJQ&Expires=1340418954&Signature=7%2BrH1fNE2Zn7vqlaw9ZDYQCQbvs%3D

Vaadin Java Framwork
https://vaadin.com/home

Interesting Stack (Backbone, NodeJS, Restify, MongoDB)
http://backbonetutorials.com/nodejs-restify-mongodb-mongoose/

Dependecy Injection
http://s3.amazonaws.com/chariot-website-production/presentation_documents/documents/000/000/607/di-without-the-gymnastics.pdf?AWSAccessKeyId=AKIAJTXMORYAM7NJWIJQ&Expires=1340422342&Signature=VVMi2uiG2c6m6oaP3%2Bn61pDmHbI%3D

HTML5 Apps with Java and Scala with Play
http://chariotsolutions.com/presentations/html5-apps-in-java-scala-with-the-play-framework

FindBugs
http://chariotsolutions.com/presentations/effective-use-of-findbugs-in-large-software-develo

Massive Scaling
http://chariotsolutions.com/presentations/massively-scaling-to-millions-of-players

Lean, Kanban and Large Scale Agile
http://chariotsolutions.com/presentations/lean-kanban-and-large-scale-agile

Let’s Play TDD
http://jamesshore.com/Blog/Lets-Play/Episode-199.html

Cross Platform Mobile Experience
http://phillyemergingtech.com/2012/system/presentations/Doug_Bellenger-PhillyETE_2012.pdf

Real-Time Web Apps with Backbone
http://chariotsolutions.com/presentations/building-real-time-web-applications

Better Agile Through Tribes
http://chariotsolutions.com/presentations/better%C2%A0agile-thought-throughtribes

Java EE in the Cloud(s)
http://chariotsolutions.com/presentations/java-ee-in-the-clouds

CSS#
http://chariotsolutions.com/presentations/evolution-of-css-layout-through-css3-and-beyond

EmberJS
http://chariotsolutions.com/presentations/emberjs-attacking-boilerplate-where-it-lives

PJAX
http://chariotsolutions.com/presentations/pjax-and-the-next-generation-of-server-side-web-fr

Grails 2.0
http://chariotsolutions.com/presentations/whats-new-in-grails-20

JavaScript Testing / BDD

Google APIs

Google API using JSON and OAuth 2.0 (Works on Android)
http://code.google.com/p/google-api-java-client/

http://google-api-java-client.blogspot.com/

Browse Samples
http://code.google.com/p/google-api-java-client/source/browse?repo=samples

http://code.google.com/p/google-api-java-client/wiki/DeveloperGuide

Setup
http://code.google.com/p/google-api-java-client/wiki/Setup

Google+ Sample
http://code.google.com/p/google-api-java-client/wiki/SampleProgram

Android Information and Video
http://code.google.com/p/google-api-java-client/wiki/Android

From Google:  WARNING: for Android, the jars MUST be placed in a directory named “libs” for the APK packager to find them. Otherwise, you will get a NoClassDefFoundError at runtime.

Android Sample Instructions:
http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html

OAuth 2.0 for Android
http://code.google.com/p/google-api-java-client/wiki/OAuth2#Android

http://code.google.com/p/google-http-java-client/wiki/Android

Calendar Sample for Android
http://samples.google-api-java-client.googlecode.com/hg/calendar-android-sample/instructions.html?r=default

 

 

 

Grails 2.0

Great video from SpringSource on Grails 2.0 from ETE 2012
http://www.youtube.com/watch?v=c3AMvP0HC9g&feature=plcp

Getting Started 2.04 
http://grails.org/doc/latest/guide/gettingStarted.html

Grails uses Spring 3.1 and latest Tomcat, Groovy and Hibernate.

Over 600 Grails Plugins
http://grails.org/plugins/

Hibernate Plugin GORM
http://grails.org/plugin/hibernate

JQuery for Grails
http://grails.org/plugin/jquery

JQuery UI for Grails
http://grails.org/plugin/jquery-ui

Cobertura Code Coverage
http://grails.org/plugin/code-coverage

Spock for Grails (now can extend Spock’s Class)
http://grails.org/plugin/spock

REST Client
http://grails.org/plugin/rest

Grails with Spring Mobile
http://grails.org/plugin/spring-mobile

Apache POI Grails Builder
https://github.com/andresteingress/gsheets

Log4J
http://blog.andresteingress.com/2012/03/22/grails-adding-more-than-one-log4j-configurations/

Groovy Console
http://grails.org/plugin/console

Twitter Bootstrap for Grails
http://grails.org/plugin/twitter-bootstrap

YUI on Grails
http://grails.org/plugin/yui

Grails is a full stack framework with ORM, DI, Tx, App Server, Database Server, …

Built-In H2 Console for Grails

=> http://localhost:8080/app/dbconsole

 

 

Spring and Hibernate

Spring 3.1

http://blog.springsource.com/2011/01/17/green-beans-getting-started-with-maven-and-spring/

http://javarevisited.blogspot.com/2012/03/spring-security-example-tutorial-how-to.html

http://blog.springsource.com/2011/01/25/green-beans-getting-started-with-enterprise-messaging-and-spring/

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/

http://blog.springsource.com/2010/11/09/green-beans-putting-the-spring-in-your-step-and-application/

http://www.springsource.org/greenhouse/guide

http://blog.springsource.com/2011/01/07/green-beans-getting-started-with-spring-in-your-service-tier/

http://www.mkyong.com/tutorials/spring-tutorials/

http://www.mkyong.com/spring3/spring-el-lists-maps-example/

http://www.mkyong.com/spring/spring-auto-wiring-beans-in-xml/

 

Spring MVC
http://blog.springsource.com/2011/01/04/green-beans-getting-started-with-spring-mvc/

 

Spring Social

http://harmonicdevelopment.tumblr.com/post/13613051804/adding-spring-social-to-a-spring-mvc-and-spring

 

Spring Data JPA
http://www.springsource.org/spring-data/jpa

 

Spring Mobile
http://blog.springsource.com/2010/11/19/spring-into-mobile-application-development/

 

Spring for Android
http://www.developer.com/ws/android/development-tools/spring-android-bringing-spring-components-to-your-android-apps.html

http://xebee.xebia.in/2010/12/31/spring-android-spring-for-android/

http://www.makeurownrules.com/rest-spring-maven-android

http://devblog.limettengruen.ch/?p=72

http://blog.orange11.nl/2011/02/07/creating-an-android-app-for-your-website-with-spring-android-and-rest/

http://www.ibm.com/developerworks/web/library/x-springandroid/index.html

http://www.jmanzano.es/blog/?p=163&lang=en

http://www.mkyong.com/spring/spring-sending-e-mail-via-gmail-smtp-server-with-mailsender/

http://www.mkyong.com/spring/spring-quartz-scheduler-example/

 

Spring Hibernate

http://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/

http://www.mkyong.com/spring/maven-spring-hibernate-annotation-mysql-example/

 

Hibernate 4.1.4 (JPA 2)

http://docs.jboss.org/hibernate/orm/4.1/quickstart/en-US/html_single/

http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html_single/

http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/

http://www.mkyong.com/tutorials/hibernate-tutorials/

http://www.mkyong.com/hibernate/maven-3-hibernate-3-6-oracle-11g-example-annotation/

http://www.mkyong.com/hibernate/hibernate-one-to-many-relationship-example-annotation/

http://www.mkyong.com/hibernate/how-to-generate-code-with-hibernate-tools/

http://www.mkyong.com/hibernate/how-to-configure-log4j-in-hibernate-project/