Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, December 19, 2022

EC2 and Java Spring Boot

These days, containers and ECS/EKS seem to be all the rage.  However, I wanted to make sure I could still install and run my application on an EC2 Instance.

I decided to create an EC2 Instance t2.micro) using the AMI for Amazon Linux 2.

Step 1: Installing Java 17 (Amazon Corretto)

I logged in using the private key from the Keypair I generated and installed Java 17:

login as: ec2-user
Authenticating with public key "java-demo-keypair"
Last login: Mon Dec 19 02:54:32 2022 from **********

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/

[ec2-user@ip-10-0-0-72 ~]$ sudo yum install java-17-amazon-corretto

after all the dependencies were downloaded, installed, and this completed, I verified:

[ec2-user@ip-10-0-0-72 ~]$ java -version

openjdk version "17.0.5" 2022-10-18 LTS

OpenJDK Runtime Environment Corretto-17.0.5.8.1 (build 17.0.5+8-LTS)

OpenJDK 64-Bit Server VM Corretto-17.0.5.8.1 (build 17.0.5+8-LTS, mixed mode, sharing)

Finally, I added a Bash script to /etc/profile.d to set JAVA_HOME and PATH to include JAVA_HOME. 

[ec2-user@ip-10-0-0-72 ~]$ sudo vi /etc/profile.d/java.sh



export JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64
and sourced this Bash script so it would take effect immediately:

[ec2-user@ip-10-0-0-72 ~]$ source /etc/profile.d/java.sh

Step 2: Create Service to run Spring Boot App

Create java-user (in java-group) with a home directory of /opt/java-apps 

[ec2-user@ip-10-0-0-72 ~]$ sudo groupadd -r java-group

[ec2-user@ip-10-0-0-72 ~]$ sudo useradd -r -m -g java-group -d /opt/java-apps -s /bin/false java-user
                             
I copied the Spring Boot JAR into /opt/java-apps/demo.jar and created the following Systemctl Service file:

[root@ip-10-0-0-72 system]# sudo vi /etc/systemd/system/springboot.service

[Unit]
Description=Java Spring Boot Demo App
After=syslog.target

[Service]
WorkingDirectory=/opt/java-apps
ExecStart=/bin/java -jar demo.jar
SuccessExitStatus=143

User=java-user
Group=java-group

[Install]
WantedBy=multi-user.target

Saturday, December 10, 2022

Dockerfile and Amazon Corretto

Managed to crawl out of bed this weekend to play with Dockerfiles and Amazon Corretto (didn't feel well today).

I went to Docker Hub site for Amazon Corretto and was surprised to see Java 19 and thought about using this as my base Docker Image.  

However, went out and checked, and Java 19 is not a LTS version, so I decided to stick with Java 17. 

My Dockerfile:
FROM amazoncorretto:17.0.5-alpine3.16
RUN addgroup -S spring && adduser -S java -G spring
USER java:spring
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]
Then I ran the following command: 

docker build -t philiptenn/demo-app .

to create a Docker Image in my local Docker Desktop, and ran it with

docker run -p 8080:8080 philiptenn/demo-app

to create a running container.  

Tuesday, April 21, 2015

IntelliJ IDEA, Spring Data Plugin, and recognizing @EnableJpaRepositories Annotation

Today I worked through an IntelliJ IDEA 14.1.1 (THE latest and greatest as of today, 4/21/2015) configuration issue that had me baffled.

I could not get IntelliJ to recognize Spring Data Repositories. 

I am using Spring JavaConfig for a Spring MVC Web Application and have the following code-based config class:


/**
 * Spring JavaConfig Web Application Configuration for Spring MVC App.
 *
 * @author Philip Tenn
 */
@Configuration
@EnableWebMvc
@EnableTransactionManagement
@ComponentScan("com.philiptenn.scholarship")
@PropertySource("classpath:application.properties")
@EnableJpaRepositories(basePackages = "com.philiptenn.scholarship.repository")
public class WebAppConfig extends WebMvcConfigurationSupport {
...
}


My issue was that the @EnableJpaRepositories annotation was not causing the IDE to recognize Spring Data JPA Repositories in my basePackage to be recognized as Spring-managed Repositories.

I have this working in other environments and could not figure out why.

I worked through the following JetBrains guide: Enabling JPA Support.  However, this did not enable IntelliJ to recognize the annotation.

Since I had this exact same project working in a different install of IntelliJ in a VM, I figured that it had nothing to do with my project and had to be something global.

Taking an educated guess, went to plugins.  Found a plugin that was disabled that looked like it could be relevant ... :-)





























After enabling the Spring Data Plugin and restarting IntelliJ ... here was my result (SO HAPPY)!



Monday, April 20, 2015

Spring JavaConfig

I recently learned how to use Spring JavaConfig.  Unfortunately at work, we are still using XML-based Spring Configuration.

I wanted to dig into JavaConfig, so I started using it at home on personal development projects.

Just replaced the full contents of the web.xml file with the following:


package com.philiptenn.scholarship.init;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration.Dynamic;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * @author Philip Tenn
 */
public class Initializer implements WebApplicationInitializer {

    private static final String DISPATCHER_SERVLET_NAME = "dispatcher";

    public void onStartup(ServletContext servletContext)
            throws ServletException {
        AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
        ctx.register(WebAppConfig.class);
        servletContext.addListener(new ContextLoaderListener(ctx));

        ctx.setServletContext(servletContext);

        Dynamic servlet = servletContext.addServlet(DISPATCHER_SERVLET_NAME,
                new DispatcherServlet(ctx));
        servlet.addMapping("/");
        servlet.setLoadOnStartup(1);
    }

}


Now, my web.xml file is really skinny ...


  
<?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.1"
         xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         metadata-complete="false">

  <display-name>Spring MVC Application</display-name>

</web-app>


Having such a small XML file, that doesn't even contain a Servlet entry for the Spring MVC DispatcherServlet felt strange, like walking on a tightrope without a safety harness. However, everything seems to be working fine. :-)

Sunday, April 19, 2015

Spring Data JPA Setup

I'm having one of those "build your own lightsaber" moments.

At work, we are using Spring Data JPA and Hibernate.

Everything is nice and configured already, the Repositories, the TransactionManager, the EntityManagerRef.

With everything configured, it's pretty easy to just create a new Repository, write a couple of query methods following the nice findByFirstNameAndLastName  DSL provided by Spring Data, and inject the Repository into a Spring Service Bean.

The hard part is the configuration.  I'm trying to do that from scratch on a little personal project this weekend, to make sure I can do it.

Issue #1: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration

Was getting this as a Runtime error immediately when deploying in JBoss Wildfly 8.2.0.Final.

In my Maven POM:


        
        
        
          org.hibernate
          hibernate-core
          4.3.7.Final
          provided
        


According to wildfly.org 8.2.0 Release Notes:

  • Hibernate 4.3.7.Final
Is supposed to be included as a component.

I could get around it by changing dependency scope from provided to compile and the error goes away, but that feels wrong.

I really don't want to package Hibernate into my WAR file when the Application Server I've selected (JBoss Wildfly 8.2.0.Final) provides it.  

Tuesday, April 14, 2015

IntelliJ IDEA and Git

Well, I've gotten a basic "Hello, world" Spring Web MVC Application running in JBoss Wildfly 8.2.0.Final set up with the initial Git Repo from OpenShift.

Now, I'm trying to do my first commit.  I've worked with Git through the Git Bash (msysgit), along with TortoiseGit and through Visual Studio / Git integration.

Even cloned, pushed, fetched to/from GitHub through these tools for .NET Projects.

However, this is my first experience using Git through IntelliJ IDEA on a pure Java project.

Initial take: for some reason IntelliJ is *not* picking up my user.name and user.email from the Global Git configuration.

From my Git Bash:

$ git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Philip Tenn
user.email=ptenn@users.noreply.github.com

What I am seeing on the VCS commit window in IntelliJ:


































I could (and did) manually type into this ComboBox my name and .  Just seemed strange it did not pick up from my Git config. 

Monday, April 13, 2015

Error running Wildfly 8.2.0.Final: Address localhost:9990 is already in use

Downloaded the latest JBoss Wildfly Final release (8.2.0.Final as of today, 2015-04-13).

Thought I would do some late-night personal coding now that the everyone else has gone to sleep.

Trying to run it through my IDE, immediately get an error:

Error running Wildfly 8.2.0.Final: Address localhost:9990 is already in use


I did some searching, and found the program that is competing with JBoss for port 9990 (which JBoss uses for its management endpoint by default).

C:\java\jdk1.7.0_76>netstat -a -b

...
  TCP    127.0.0.1:9990         acer-predator:0        LISTENING
 [NvNetworkService.exe]
...

Aha ... NVidia's Network Service.  Now, I could change JBoss's port easy enough, but I like using out-of-box configuration.  I don't want to hack up my JBoss configuration to play nicely with my Windows Environment when I'll be working out of Linux as well ... best to make the Windows Environment work with my development projects.

Went into Windows Services, found NVIDIA Network Service, stopped it, set it to Manual.

Now Everything is actually Awesome! :-)  JBoss Wildfly starts up great!

OpenShift, Git and Maven

This is very interesting, it appears that by creating the OpenShift Application, it created a whole initial code layout (similar to a Maven Archetype), complete with POM file as the first commit in the git repository.

Here is what I saw when viewing the log for the cloned Git repository that OpenShift created:


I've always believed in trying to follow the best practices and standard approaches whenever I come into an environment.

For example, when doing Java Development, I follow the camelCase method naming approach; when doing C# development, I follow the PascalCase method naming approach.

In keeping with this tradition, I'm going to try and use Maven, seeing as how OpenShift coreated a pom.xml on my behalf. 

Sunday, April 12, 2015

OpenShift Client Setup

I just signed up for the free OpenShift account.

OpenShift is RedHat's foray into PaaS.

Since I've used JBoss as my JavaEE Application Server for the past 10 years at work (going all the way back to JBoss AS 4.2.2), it made sense for me to use as a platform for personal development projects.

They gave me 3 free small gears to use.  Ended up using my first one for a JBoss Wildfly 8.2.0.Final cartridge (community created).  I'm sure I'll need to use my second one for the database (debating between MySQL and Postgres).

It was easy to create the server instance.

Next step: gain access.

I followed the instructions for setting up OpenShift rhc Client Tools in a Windows Environment (I run a dual boot Fedora Core 21 / Windows 7).  Normally I do all my development out of Linux except .NET Development, and if/when I really start rolling on an OpenShift-deployed project, I'll probably switch back to Linux.

Step 1 - Install Ruby

Installed the latest Ruby x64 for Windows:

ruby 2.2.1p85 (2015-02-26 revision 49769) [x64-mingw32]

Step 2 - Install Git

Already had Git on my machine.

Step 3: Install and Configure the OpenShift gem

Ran into an error immediately after running rhc setup.

kernel_require.rb:54:in `require': cannot load such file -- dl/import (LoadError)

Upgraded net-ssh to 2.9.3.beta1 like the answer recommended, re-ran rhc setup, and it worked like a champ. 

Now that I'm all set up, next steps for me will include:


  1. Cloning (and understanding) the built-in Git Repository with the OpenShift Application.  I was surprised to read in their documentation that each OpenShift Application has its own Git Repo.  I had expected to create a Repo on GitHub and when I needed to deploy to OpenShift, I thought I would just drop a WAR or EAR file. 
  2. Setting up my Gradle Build. 


Wednesday, September 26, 2012

Grails, GORM, lazy loading one-to-one

I spent all yesterday evening trying to figure out a way to lazy load a one-to-one relationship. At first glace, this probably looks like an academic exercise. However, I have a very pragmatic reason for needing to lazy load a one-to-one relationship.

I have Property and PropertyDetail Domain Classes. 

For now, I am storing images in the database.

Long-term, I am going to look at using Amazon S3 for storing images, but for a personal project where I am still learning, it seems like a decent compromise.

class PropertyDetail {

    static constraints = {
        description type: 'text'
    }

    static belongsTo = [property : Property]

    String description
    byte[] imageMain
    byte[] image1
    byte[] image2
    byte[] image3
    byte[] image4
    byte[] image5
}

I am going to have a list page for Property domain class.

I definitely do not want to take the hit of pulling the PropertyDetail class, not with the images stored in the database.

I hit a wall late evening, when I discovered the following Jira Issue: GRAILS-5077 hasOne mapping is by default eager and cannot be changed to lazy.

However, this is an older JIRA issue, and I did see on the recent Grails 2.1.1 documentation information on doing lazy one-to-one. http://grails.org/doc/latest/guide/GORM.html#manyToOneAndOneToOne

My new plan is to:

  1. Try the approach documented for Grails 2.1.1.
  2. Turn on SQL logging
        datasource { 
            ... 
            logSql = true 
        } 
    

  3. If that does not work, drop back and remap this relationship as a many-to-one.

Monday, September 10, 2012

Technology Stack

It's late Monday evening, and I'm working on a new personal development project. 

I think I've selected my technology stack:
  • Twitter Bootstrap 2.1.1
  • Grails 2.1.0
  • MySQL 5.5
I find Grails to be rather amazing because it is, for all intents and purposes, a complete stack.  It even has a Twitter Bootstrap plug-in, as well as MySQL Connector/J plug-in, so I guess I could technically say that my technology stack is "Grails".

When working on Java / Java EE projects, I've grown so accustomed to saying "My technology stack is jQuery/JSP/Taglib/Struts/EJB3/Spring/Hibernate/Oracle". 

It feels pretty neat to say "My technology stack is Grails". 

Since I am looking at eventually hosting in a PaaS environment, I am not really concerned about details like OS and Application Server.

However, for my own development environment I am using the following:
  • Windows 7 (thought about switching to Fedora 17 KDE, decided not to take hit on installing a whole new OS).
  • Tomcat 7.0.30
I've made the mistake in working on past personal projects during nights/weekends and getting too caught up in technical details and not focused enough on building a product. 

Grails BuildConfig.groovy: dependencies vs plugins

I am configuring BuildConfig.groovy for a test/sample project.

One item I have always found a bit confusing is the question of the dependencies closure block vs the plugins closure block.

There are times where I have seen that a library could be specified in either.  Also, the version of library would be different.  

For example, the following dependencies closure is provided out of the box with Grails 2.1.0:

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

        // runtime 'mysql:mysql-connector-java:5.1.20'
    }

Obviously, this leads me to conclude that if I need MySQL Connector/J support, all I have to do is uncomment that line.

However, I have also successfully gotten MySQL Connector/J support by doing the following (I have verified this works):


    plugins {
        compile ":mysql-connectorj:5.1.12"
        compile ":searchable:0.6.3"
        build ":tomcat:$grailsVersion"
        build ":hibernate:$grailsVersion"
        runtime ":database-migration:1.1"

    }

I found the following Nabble post from Graeme Rocher explaining the difference of plugins {} vs dependencies {} blocks. 

Graeme states:

plugins { } block is used declare dependencies on grails plugins found
in the portal (http://grails.org/plugins/) and built locally.

dependencies { } block is used to declare dependencies on JAR files
and third party java libraries typically found in Maven central (see
http://search.maven.org/#browse)


This made sense to me.  What it did not answer is when I am able to obtain a library via either, which is preferable, if there is a "best practices" or "recommended" approach. 

Knowing that I can get my MySQL Connector/J library from either one (I am certain I would not want to do both), I would just be curious as to which approach is better.

Wednesday, August 22, 2012

Grails, Scaffolding, GSPs

I've spent the last few evenings reading up on Grails Domain Classes and Controllers, the 'M' and 'C' portions of MVC, respectively.

I have been working through Getting Started with Grails, Second Edition by Scott Davis and Jason Rudolph. 

Throughout the process of working through their Racetrack sample application, I have been switching between MongoDB 2.0.6 and MySQL 5.5.25. 

In the process, I have hit some bumps in the road regarding MongoDB Issues with Grails Scaffolding that do not occur in MySQL. 

I posted these on StackOverflow and mentioned in LinkedIn discussions.  This has led me down the path of going so far as to trying to download a tag from GitHub for newer builds of the MongoDB Plugin for Grails (as of today 2012-08-22, 1.0.0.GA is the latest official release for this plug-in).

I've also learned a lot about MySQL in the process of setting it up, securing it on Fedora 17. 

Neat things I've learned:

Now, I'm starting to learn about the 'V' aspect of MVC in Grails.  I am digging into GSPs. 

Friday, July 13, 2012

NoSQL, BigTable, and data stores

I've started reading a lot about NoSQL Databases and it fascinates me, especially as a developer who has grown up in the Relational Database world (Oracle and SQL Server) and spent a lot of time optimizing queries, working on complex SQL statements, normalizing tables, inner joins, left outer joins, inline views, and all that good stuff.

Over time, I've watched the evolution from the Data Tier of the n-tiered model go from DAOs that executed JDBC to ORM (been doing a lot of Hibernate and NHibernate) to Grails/GORM (which provides a ton of create/read/update/delete methods automatically, freeing the developer from having to maintain this code). 

I have read articles about how companies that work with extremely large volumes of data like Google have developed distributed, non-relational data stores such as BigTable.  When I was playing with Google App Engine was my first exposure to BigTable, and it was a bit of culture shock for a developer who is used to the traditional RDBMS model present in most corporate environments (at least every environment I have worked in since I started in industry in 1998). 

BigTable and the problem it was created to address fascinated me.  However, I really couldn't get into Google App Engine.  At the time, it was purely Python/Django, though it has since been expanded out to include Java.  I did write several Python scripts and built a few pages in Django, but found it to be an uncomfortable fit for someone comfortable with writing Java in IntelliJ or C# in Visual Studio .NET. 

Recently I have been reading about the NoSQL movement.  I am going to pull down MongoDB and give it a try.  I was glad to read that Grails has a MondoDB plugin.

Sunday, November 27, 2011

Obtaining Android Source Code on Microsoft Windows Platform

I was able to obtain the Android source code.

Here's a screenshot in Eclipse of what prompted me to go searching for the Android source code.







(really ugly when you try control-clicking on an Android API class only to get this)

Obtaining the source was MUCH more of a challenge than I expected, and took me several hours yesterday evening (plus an overnight download). Somehow I just imagined that the source would be available by Android API version as a ZIP or JAR file. Nope ...

In order to get it installed on Windows (which is officially not supported per the Android Open Source Project documentation), here's what I had to do:




  1. Install Cygwin. I installed Cygwin 1.7.9-1, the latest, obtained from cygwin.com.
  2. The setup.exe is a Web Installer. I specified C:\cygwin as my Root Directory, installed for All Users. When running setup.exe, administrator privileges are required.
  3. In the Cygwin Setup - Select Packages dialog, I found packages for curl, git, and python. These 3 will be necessary for obtaining the Android Source. This installation was a bit tricky, so I want to document this well here:

Cygwin - curl installation


Cygwin - git installation



Cygwin - Python installation


  1. From here, complete installation of Cygwin.
  2. Once Cygwin has been installed, create a local directory to hold the Android Source. In my case, I used C:\android\android-source.
  3. Open a Cygwin terminal session and type:
    cd /cygdrive/c/android/android-source
    (of course, using whatever path for your local directory).
  4. Now, type:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/repo
    This will pull down the repo Python script used by the Android SDK Team and place it in your local directory for Android Source.
  5. Next, type:

    repo init -u https://android.googlesource.com/platform/manifest

    This will create a .repo file and initialize the directory to hold the Android Source.
  6. Finally, type:
    repo sync

    This will do the actual downloading of the Android Source. It takes a long time, and pulled down 8.72 GB into my local working directory.



Saturday, November 26, 2011

Setting up Android Development Environment

I am going to be doing my Android Development on a Windows 7 environment. This has already proven to present a unique set of challenges, especially regarding obtaining Android source for the android.jar.

Thus far, here are the steps I have taken for setting up my dev environment:

  1. Download Java SDK 6. I always install this to C:\java\jdk1.6.0_29
  2. Download Eclipse Indigo (Eclipse 3.7.1), 32 bit. I download the "Eclipse IDE for Java EE Developers" version and unzip this (no installer) to C:\eclipse.
  3. Download Tortoise SVN 1.7.1. Figured I will need this for source/version control. I *should* switch to git at some point. However, I use Subversion at work, and did not feel like struggling with learning a new distributed version control system at this point in time (already plenty of new stuff to learn).
  4. Installed Android SDK R15 (Windows Installer). I installed this to C:\android\android-sdk and ran the Android SDK Manager.


  5. I installed everything for Android 4.0 (Ice Cream Sandwich), Android 3.2 (Honeycomb), and Android 2.3.3 (Gingerbread). This took quite some time.
  6. Install Eclipse plugin for Subclipse 1.8 (compiled against SVN 1.7)

  7. Install Eclipse plugin for ADT (Android Development Tools)



From here, I began to create a "Hello World" Application. However, as I did so, I realized that the android source was not available.

Obtaining the Android source for android.jar was quite an adventure that I'll write about in my next post.


Hello, Android

Over the Thanksgiving break, I upgraded my JDK to Java SDK 6 update 29 (I've been living in JDK 5-land for quite some time), pulled down Eclipse Indigo, and installed the Android SDK and the ADT Plugin for Eclipse.

At this point in time, I don't actually own any Android devices, yet I'm interested in getting into Android development.

I actually own 4 iOS devices (2 iPhone 4s, 2 iPad 2s). I was interested in iOS development and perused articles and books on Objective C, Cocoa, and even higher-level frameworks such as cocos2d and Corona SDK.

However, as much as I love my iOS devices, I just found it really difficult to get into iOS Development.

I've been doing Java Development for the past 12+ years. Although I think I'm fairly good at learning new languages and environments (I am comfortably able to hop between the Java and Microsoft .NET realms), I just found that there was a steep learning curve for Objective C and Cocoa.

When I first began getting into .NET development about 7 years ago, I found that C# was an easy transition for a Java developer. The .NET BCL provides many of the same classes for I/O, XML, Strings, and i18n as is provided by the core Java API. Thus, as a Java programmer in a new land, it didn't feel too horrendously foreign.

iOS development, on the other hand, felt like a completely different world.

There are definitely points in the article where my thoughts and philosophies regarding technology trends diverge from that of the author.

However, I found myself definitely relating to his points regarding the barriers to entry for iOS development, both in terms of knowledge and equipment, as well as the lack of transferability of skills developed in the iOS arena back to the world of writing enterprise business applications (he referenced the TIOBE Software Index, which in 11/2011 shows Objective-C has a Community Index Rating of 5.983% as compared to Java at 17.874%).

So, based on the fact that Android development fits with my Java / Eclipse background extremely well, I'm embarking on learning as much as I can during Thanksgiving break, and during subsequent evenings and weekends.

Wednesday, October 12, 2011

Oracle Certified Master, Java Enterprise Architect

After 2 months of extremely hard work (studying every evening, working on a design project during nights and weekends), and another 2 months of waiting, I received good news on October 6th: I achieved Oracle Certified Master, Java Enterprise Architect 5 status.

Timeline:



  • 2011-JUN-01 - Began studying early June

  • 2011-JUL-21 - Passed Part 1 Multiple Choice Exam

  • 2011-AUG-02 - Submitted Part 2 Project

  • 2011-AUG-03 - Took Part 3 Essay

  • 2011-OCT-06 - Received Congratulations Email


Part 1: Multiple Choice Exam

I used the following study material:



  • Design Patterns: Elements of Reusable Object-Oriented Software. The Gang of 4 Design Pattern book. Like any software engineer, I have a copy of this book sitting on my desk at work and reference it on occasion. However, in preparation for this exam, I read this from cover-to-cover twice.

  • Core J2EE Patterns, Deepak Alur, Dan Malks, John Crupi. I read over this book cover-to-cover, and went back several times to reference particular patterns.

  • Core J2EE Patterns Online. This site is based on the Core J2EE Patterns book. I used it in-tandem with the book.

  • Sun Certified Enterprise Architect for Java EE Study Guide, Second Edition, Mark Cade, Humphrey Sheil. This was the only exam-focused guide I used. I used it as my outline, to understand which areas the exam would cover, and where I needed to focus my time. I didn't have a hardcopy of this book, but was extremely fortunate that my employer purchased me a Safari Books Online subscription. I love Safari Books Online, have found it to be a wonderful technical resource, since I can read all the technical books I need without having to purchase hardcopy books.

  • Java EE 5 Tutorial.
Part II: Project

I LOVED doing the project. This is where I felt like I learned new skills and grew, and formalized my UML.

I have done UML diagrams for years. However, after a while, one tends to get a little bit sloppy. Blending interaction and time transition into a static class diagram, for example. It's so easy to do when one has an understanding of UML, but isn't held to a rigid standard.

The project really forced me to "clean up" and "formalize" my system design documents. At work, if I bleed a little bit of state transition into a class diagram, everyone still understands and gets the gist. However, I am sure that sort of thing would have been penalized on the Java Enterprise Architect Project (as well it should).

It took me over 40 hours. I went at it aggressively, started working on it immediately after getting home from work. At one point, I probably put in an 80 hour week (40 for work, 40 for my Java Enterprise Architect Project).

I learned how to use StarUML, and used it for the Class and Sequence Diagrams.

For the Component and Deployment Diagrams, I used Visio Stencils and Template for UML 2.2.

I learned of the Visio Stencils for UML 2.2 from Jeanne Boyarsky's posting, which was referenced on Coderanch.

Part III: Essays



This part was a proctored sit down and defend/explain aspects of the Project. I enjoy writing, so it was fun. The only thing I felt badly about is that I type extremely fast and tend to like getting my thoughts into words as quickly as possible (trying to get a stream of consciousness into a coherent essay while I have just the right words in my mind), and the keyboards at the testing center were "clicky" keyboards.


By "clicky", I mean, they make a click-klack, click-klack as I typed. Felt badly for other test-takers.

Overall, the Java Enterprise Architect Certification was by far the best learning experience I've ever had in certification series. I've never taken a certification series that involves a challenging hands-on design project prior to this.

I also thought it was really neat that they did not require any particular UML tool, or any particular approach. I had the freedom to design a system using EJBs or Web-container only, SOAP, REST, VMs, cloud, or physical machines.

I just had to clearly define and document a well-designed system that meets the business needs based on JAD session results, BRD, and Use Cases, much like the challenge faced by actual Enterprise Architects in designing solutions for businss problems.

Wednesday, March 26, 2008

Tampa Java User Group Meeting: Hibernate, My Experience

Well, I went to the Tampa Java User Group meeting last night. Didn't get back home until close to 10 PM ... long day.

However, I'm definitely glad I went ... it was a very positive experience. I was impressed by our speaker, Ed Lance from nTier Training (note: I am not affiliated with them in any way, but I figured I'd give them a shout because they provided their time). I've been to courses in the past where the instructor's experience had been going through the coursework as a student, and perhaps doing the labs. This was not the case at all with Ed.

Ed definitely worked in industry, and I can tell that he's someone who is very passionate about technology and programming, and digs into this stuff during his own time. There really is a difference ... you really can tell when someone's passionate about their subject, and it makes all the difference.

I've worked a lot with Hibernate, so most of it was review. However, one thing that stuck out was that he placed a lot of emphasis on Hibernate object states, and had a nice diagram that hammered this home. Also, he called his methods (if I recall correctly), makePersistent (instead of save) and makeTransient (instead of delete). This really placed a strong emphasis on what was happening to the Object State.

I did get 2 lotto tickets out of it (Ed was giving out lotto tickets to people who answered questions or initiated discussion, to keep the group engaged). This was an interesting approach. Maybe I'll get lucky.