Archive

Archive for the ‘JavaEE’ Category

Devoxx UK: Test-Driven Development with Java EE 7, Arquillian and Embedded Containers

March 27th, 2013 Comments off

Thank you all for attending my Devoxx UK 2013 presentation earlier today: Test-Driven Development with Java EE 7, Arquillian and Embedded Containers. It was a total honour to be at the first United Kingdom franchise. I am very proud to have served the community.

Here is the Slidedeck for the talk:

And you can find the entire codebase of the demonstrations exported to Github as promised: https://github.com/peterpilgrim/devoxxuk2013-tdd-javaee7.

As I said before during the presentation, actually, I am writing a JavaEE 7 Developer User Guide book for Packt Publishing. Please look out for it as it will hit the shelves in late Summer / early Autumn of 2013. Finally, don’t be afraid to get in touch to ask any question on my talk and presentation, JavaEE 7 and development testing.

See you all at ACCU 2013 in Bristol, next month or perhaps further ahead to JavaOne 2013, San Francisco.

+PP+

 

Untitled

PS: A pleasure shout out to Aslak Knutsen and David Blevins from Red Hat JBoss team for their hints and tips on this talk.

Some Captured Tweets:

Markus Eisele ‏@myfear 2h
#devoxxuk @peter_pilgrim about #Arquillian and #JavaEE7 pic.twitter.com/CSv2rb5LTr

Holly Cummins ‏@holly_cummins 3h
‘The cloud is perhaps the heaviest container there is.’ @peter_pilgrim #DevoxxUK

Aslak Knutsen ‏@aslakknutsen 3h
http://yfrog.com/od34253901j Mocks are the old way of testing EE, it’s time to move on. @peter_pilgrim #Arquillian #DevoxxUK

Steven Van Impe ‏@sipofjava 3h
Attending “Test Driven Development with Java EE 7, …” by Peter Pilgrim (@peter_pilgrim) at #Devoxx.

Dan Allen and Aslak Knutsen retweeted you
20h: 13:30PM Weds, Test Driven Development with JavaEE 7, Arquillian & Embedded Containers http://www.devoxx.com/display/UK13/Test+Driven+Development+with+Java+EE+7%2C+Arquillian+and+Enterprise+Containers … #DevoxxUK “Let’s go UK!

Dan Allen and Aslak Knutsen retweeted you
20h: 13:30PM Weds, Test Driven Development with JavaEE 7, Arquillian & Embedded Containers http://www.devoxx.com/display/UK13/Test+Driven+Development+with+Java+EE+7%2C+Arquillian+and+Enterprise+Containers … #DevoxxUK “Let’s go UK!”

adoptajsr retweeted you
20h: Thanks to @aslakknutsen and @dblevins for a very insightful #JavaEE7 discussion around the hack tables #DevoxxUK

 

Build GlassFish 4.0 Snapshots Yourself

March 16th, 2013 Comments off

This post is about building GlassFish 4.0 snapshots release yourself and includes hacks.

I found the official Instruction for FullBuild of GlassFish and then decided to build the server myself. Sometimes, you may not want to wait for the GlassFish build files to be promoted by the team. In this entry, I reference Artifactory as a private Maven repository, of course, you can use something else as well.

Checkout the source code for GlassFish 4.0 yourself from Subversion:

svn checkout https://svn.java.net/svn/glassfish~svn/trunk/main glassfish-main

You need to hack the Maven Settings file for your workstation to exclude Eclipse artifacts.Here is an example of the settings.xml, which I configured.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0

http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <!--Maven http://maven.apache.org/settings.html -->
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers>
      <server>
         <id>ACME-ARTIFACTORY-PRIVATE</id>
         <username>administrator</username>
      <password>password</password>
    </server>
  </servers>
	<mirrors>
		<mirror>
		  <id>maven-central</id>
		  <url>http://repo1.maven.org/maven2/</url>
		  <mirrorOf>central,!eclipselink.repository</mirrorOf>
		</mirror>
	</mirrors>
  <proxies/>
  <profiles/>
  <activeProfiles/>
</settings>

Before we can compile the entire GlassFish code, we need to hack POM files so that they install artifacts into our private Artifactory server instead of the Maven Central.

Add the following Stanza to the POM files in the distribution:

	<distributionManagement>
		<repository>
			<id>ACME-ARTIFACTORY-PRIVATE</id>
			<name>acme-releases</name>
			<url>http://peabody.internal.acme.com/artifactory/ACME-ARTIFACTORY-PRIVATE</url>
		</repository>
		<snapshotRepository>
			<id>ACME-ARTIFACTORY-PRIVATE</id>
			<name>acme-snapshots</name>
			<url>http://peabody.internal.acme.com/artifactory/ACME-ARTIFACTORY-PRIVATE</url>
		</snapshotRepository>
	</distributionManagement>

In the above Stanza, edit the definitions from ACME to the Artifactory server that you privately own, then copy it the following POM files:

  • main/pom.xml
  • main/appserver/javaee-api/pom.xml
  • main/appserver/pom.xml
  • main/nuclues/pom.xml

This is a nasty hack, because I don’t like that you can’t set change the deployment server and credentials from a configuration. Other source code allow configuration of the deployment server through Maven Profiles or even property files.

Make sure that your Maven settings are correct for Artifactory deployment and also we set up Maven build process. Set the environment variable MAVEN_OPTS so that there Maven has enough memory and the permanent generation is high enough to avoid out of memory exceptions during compilation.

MAVEN_OPTS=-Xmx1024m -Xms256m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled

If you have 16GB RAM workstation, why not just max it out for compiling the entire GlassFish? The Garbage Collection algorithm is changed to the concurrent mark and sweep algorithm and we also set the enabled class unloading enabled.

You are ready to compile, entering the following commands:

cd glassfish-main
svn update
mvn clean
mvn install -DskipTests=true

Make yourself a hot beverage and snack for about 20 minutes on a decent Intel Core i5/i7 machine (2012). Have a break. Notice that we avoid running the unit tests here, we skip the tests, because we just want a working release in repo, quickly, which is just not to say testing is bad.

After successful compilation of all of the modules, now you are ready to deploy to the private Maven repository. If you have followed the earlier instruction, about copying the stanza to the individual POM files, then you can execute this command from root.

cd glassfish-main
mvn deploy -DskipTests=true

After deploying the artifacts to Artifactory, check the repository for snapshot 4.0 release, they should all be there.

Now descend to the Java EE project folder. Hack the POM file, glassfish-main/appserver/javaee-api/javax.javaee-api/pom.xml. It is missing the maven source plugin in the build section, and therefore, by default, it does not generate the sources JAR, which is useful for seeing the new JavaEE 7 APIs!

Find the XPath project/build/plugins and append the following stanza to this POM.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Execute the following command line, to deploy the Java EE api artifacts

cd glassfish-main/appserver/javaee
mvn deploy -DskipTests=true

For some reason, the main execution does not install javax.javaee-api artifacts automatically. Executing this line generates JAR and SOURCES JAR for the three underlying modules: javax.javaee-api, javax.javaee-web-api and javax.javaee-endorsed-api.

Go Artifactory and see that the artifacts have all been deployed. You can then write a Gradle build file like this:

repositories {
    maven {
        credentials {
            username 'administrator'
            password 'passowrd'
        }
        url 'http://peabody.internal.acme.com/artifactory/ACME-ARTIFACTORY-PRIVATE'
    }
    maven {
        url 'https://maven.java.net/content/groups/promoted'
    }
    maven {
        url 'http://repository.jboss.org/nexus/content/groups/public'
    }
}

dependencies {
    providedCompile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-SNAPSHOT'
    providedCompile 'javax:javaee-api:7.0-bpeter-private'
    providedCompile 'javax:javaee-web-api:7.0-bpeter-private'

    compile     'org.glassfish.main.extras:glassfish-embedded-all:4.0-SNAPSHOT'
    compile     'javax:javaee-api:7.0-bpeter-private'

    testCompile 'junit:junit:4.10'
}

Especially, note that the build version are annotated as 7.0-bpeter-private.

The last piece of the puzzle, which I have not yet worked out is how to configure the build.id Maven property so that I can customize the build number. It is a mystery, still. If you happen to know the answer, please give me a bell. Cheers!

+PP+ 2013
 

PS: The EclipseLink uses it own Maven repository for artifacts: http://wiki.eclipse.org/EclipseLink/Maven


 

Categories: Education, Glassfish, JavaEE, javaee7, Open Tags:

GlassFish 4 Promoted Build, Gradle and Embedded Application Server

January 31st, 2013 Comments off

Very recently, perhaps towards end of last year, the GlassFish open source team released GlassFish 4.0 beta 72 as a promoted build. Arun Gupta posted an article on the Maven coordinates for the GlassFish 4 .0 beta 72 on his blog. This release was significant because the team published the artifacts into a maven repository.

This year, 2013, I am the author of a up and coming Java EE 7 User Guide and so it is important that I investigate the latest GlassFish, especially since it is the reference implementation of the specification. I want to actually research and investigate how far the latest Java Servlets 3.1, Web Sockets and JAX-RS specifications behave in the server.

Here is a Gradle build script that I wrote last night to execute an GlassFish Embedded application:

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'

group = 'com.javaeehandbook.book1'
archivesBaseName = 'ch06-servlets-basic'
version = '1.0'

repositories {
 mavenCentral()
 maven {
   url 'https://maven.java.net/content/groups/promoted'
 }
 maven {
   url 'http://repository.jboss.org/nexus/content/groups/public'
 }
}

dependencies {
 compile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b72'
 compile 'javax:javaee-api:7.0-b72'
 testCompile 'junit:junit:4.10'
}

// Override Gradle defaults - a force an exploded JAR view
sourceSets {
 main {
   output.resourcesDir = 'build/classes/main'
   output.classesDir = 'build/classes/main'
 }
 test {
   output.resourcesDir = 'build/classes/test'
   output.classesDir = 'build/classes/test'
 }
}

task(run, dependsOn: 'classes', type: JavaExec) {
 description = 'Runs the main application'
 main = 'je7hb.common.webcontainer.embedded.glassfish.EmbeddedRunner'
 classpath = sourceSets.main.runtimeClasspath
}

The key to the build script is the order of the dependencies. I found that the glassfish-embedded-all had to be first dependency on the list, otherwise there would be ValidationException from the Hibernate Validator (bean validator) jar not being found. The exception message was "javax.validation.ValidationException: Unable to load Bean Validation provider".

The Gradle build also references the GlassFish Java repositories, which is the second key point.

Here is the EmbeddedRunner, the Java application code:

package je7hb.common.webcontainer.embedded.glassfish;

import org.glassfish.embeddable.*;
import java.io.*;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;

public class EmbeddedRunner {

 private int port;
 private AtomicBoolean initialized = new AtomicBoolean();
 private GlassFish glassfish;

 public EmbeddedRunner(int port) {
   this.port = port;
 }

 public EmbeddedRunner init() throws Exception{
   if ( initialized.get() ) {
     throw new RuntimeException("runner was already initialized");
   }
   BootstrapProperties bootstrapProperties = new BootstrapProperties();
   GlassFishRuntime glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProperties);

   GlassFishProperties glassfishProperties = new GlassFishProperties();
   glassfishProperties.setPort("http-listener", port);
   String [] paths = System.getProperty("java.class.path").split(File.pathSeparator);
   for (int j=0; j<paths.length; ++j) {
     System.out.printf("classpath[%d] = %s\n", j, paths[j]);
   }
   glassfish = glassfishRuntime.newGlassFish(glassfishProperties);
   initialized.set(true);
   return this;
 }

  private void check() {
    if ( !initialized.get() ) {
      throw new RuntimeException("runner was not initialised");
    }
  }

  public EmbeddedRunner start() throws Exception{
    check();
    glassfish.start();
    return this;
  }

  public EmbeddedRunner stop() throws Exception{
    check();
    glassfish.stop();
    return this;
  }

  public static void main(String args[]) throws Exception {
    EmbeddedRunner runner = new EmbeddedRunner(8080).init().start();
    Thread.sleep(1000);
    runner.stop();
  }
}

The class executes the embedded GlassFish as the beginnings of a containerless build, which is a term that James Ward and others have coined. This class starts GlassFish, waits one second, and then shuts it down again. The code works with Gradle, by invoking at the command line gradle run or through an IDE. I used the command gradle idea to generate IDEA project files.

Here is sample output from IntelliJ IDEA 12:

/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/bin/java -Didea.launcher.port=7537 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11.app/bin" -Dfile.encoding=UTF-8 -classpath "/Users/Developer/Documents/IdeaProjects/javaee7-handbook/ch06/servlets-basic/out/production/servlets-basic:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/org.glassfish.main.extras/glassfish-embedded-all/4.0-b72/jar/942b982d5c005806a08843d2a1f411f278c04077/glassfish-embedded-all-4.0-b72.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/javax/javaee-api/7.0-b72/jar/56d50eaa8d21c2f70394f607efc1aa27c360141d/javaee-api-7.0-b72.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/javax.activation/activation/1.1/jar/e6cb541461c2834bdea3eb920f1884d1eb508b50/activation-1.1.jar:/Users/Developer/.gradle/caches/artifacts-15/filestore/com.sun.mail/javax.mail/1.4.6-rc1/jar/5c5de8592e570afb595a8be727b484d438b49d69/javax.mail-1.4.6-rc1.jar:/Applications/IntelliJ IDEA 11.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain je7hb.common.webcontainer.embedded.glassfish.EmbeddedRunner
classpath[0] = /Users/Developer/Documents/IdeaProjects/javaee7-handbook/ch06/servlets-basic/out/production/servlets-basic
classpath[1] = /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/ant-javafx.jar
classpath[26] = /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/ext/zipfs.jar
classpath[27] = /Users/Developer/.gradle/caches/artifacts-15/filestore/org.glassfish.main.extras/glassfish-embedded-all/4.0-b72/jar/942b982d5c005806a08843d2a1f411f278c04077/glassfish-embedded-all-4.0-b72.jar
classpath[28] = /Users/Developer/.gradle/caches/artifacts-15/filestore/javax/javaee-api/7.0-b72/jar/56d50eaa8d21c2f70394f607efc1aa27c360141d/javaee-api-7.0-b72.jar
classpath[29] = /Users/Developer/.gradle/caches/artifacts-15/filestore/javax.activation/activation/1.1/jar/e6cb541461c2834bdea3eb920f1884d1eb508b50/activation-1.1.jar
classpath[30] = /Users/Developer/.gradle/caches/artifacts-15/filestore/com.sun.mail/javax.mail/1.4.6-rc1/jar/5c5de8592e570afb595a8be727b484d438b49d69/javax.mail-1.4.6-rc1.jar
classpath[31] = /Applications/IntelliJ IDEA 11.app/lib/idea_rt.jar
Found populator: org.glassfish.kernel.embedded.EmbeddedDomainXml
Jan 31, 2013 10:05:12 AM org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl initialize
INFO: Authorization Service has successfully initialized.
Jan 31, 2013 10:05:12 AM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 5.0.0.Alpha1
Jan 31, 2013 10:05:13 AM com.sun.enterprise.config.modularity.StartupConfigBeanOverrider postConstruct
INFO: Starting the config overriding procedure
Jan 31, 2013 10:05:13 AM com.sun.enterprise.config.modularity.StartupConfigBeanOverrider postConstruct
INFO: Finished the config overriding procedure
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Grizzly Framework 2.3 started in: 18ms - bound to [/0.0.0.0:8,080]
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Grizzly Framework 2.3 started in: 3ms - bound to [/0.0.0.0:8,081]
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
Jan 31, 2013 10:05:13 AM com.sun.enterprise.v3.server.AppServerStartup$StartupActivator awaitCompletion
INFO: Undefined Product Name - define product and version info in config/branding 0.0.0 (0) startup time : Embedded (1,204ms), startup services(856ms), total(2,060ms)
Jan 31, 2013 10:05:13 AM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService has disabled JMXConnector system
Jan 31, 2013 10:05:13 AM com.sun.enterprise.connectors.jms.util.JmsRaUtil getInstalledMqVersion
WARNING: RAR7000 : Check for a new version of MQ installation failed : /var/folders/kr/vj5fd5s91g76_t348ndnbtxr0000gn/T/gfembed883899172293116872tmp/lib/install/applications/jmsra/../imqjmsra.rar (No such file or directory):/var/folders/kr/vj5fd5s91g76_t348ndnbtxr0000gn/T/gfembed883899172293116872tmp/lib/install/applications/jmsra/imqjmsra.rar
Jan 31, 2013 10:05:14 AM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
JdbcRuntimeExtension, getAllSystemRAResourcesAndPools = [GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool]
Jan 31, 2013 10:05:15 AM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished

Process finished with exit code 0

You should be seeing something the above output in the IDE if you are doing it right. It would appear we will have to be on our guard until JDK 9 in order to avoid class path loading issues. My book on the user guide to Java EE 7 is scheduled for the Summer of 2013.

Happy Testing.

+PP+

Categories: Author, Book, Glassfish, JavaEE, javaee7, programming Tags:

Catch Up At Devoxx 2012

November 8th, 2012 Comments off

Next Week, I will be at Devoxx 2012, in Antwerp, Belgium from Monday 12th until Friday 16th, December. I shall, therefore, be out-of-office. I am looking forward to meeting you all in person, if you can make it, at Europe’s premier Java IT technology conference. Sadly, the conference has already sold out weeks ago.

 

Devoxx2012 WeCodeInPeace

 

I feel on this year’s conference that I may go off on a different track to peek at some of the other technologies, because not just Java is offered at Devoxx. For instance, there is on Monday, An Introduction to iOS 6 for Java developers, by Michael Seqhers. I know how to program with Android since Summer 2011, but I for iOS and Objective C, I haven’t the faintest idea, and I think this could be nice start; especially now that I already invested this Summer in a new Apple MacBook Pro machine.

On Tuesday, there is an Advanced Scala talk on concepts and best practices by Bill Venners and Dick Wall on offer. This should tie me up for the University days, and not forgetting the JavaFX Bootstrap talk with Jim Weaver and Gerrit Grundwald.

The conference really starts on Wednesday through until the last half day on Friday, and there are literal lots of interesting talks depending on your personal choice. I have marked a few that I would like to attend in person.

  • Joe Darcy has a Road to JDK 8: Lambda talk; now that Lamba functions will be showcase in the next Java Development Kit release in 2013, version 8.
  • David Blevins has a Java EE 7 talk on Context and Dependency Injection, Bean Validation and JAX-RS.
  • Jerome Dochez and Nicolas Behrens has an Effective Dependency Injection talk on CDI.
  • The JavaPosse of Dick Wall, Carl Quinn and Tor Norbye have a now annual live podcast, Javaposse Episode 400 at Devoxx. I will be there, definitely.
  • I am very tempted to visit Jonas Boner‘s Akka talk (again), especially since Akka actors are going to part of Scala 2.10 as recently confirmed by Martin Odersky.
  • What is this alternative JavaScript language called Dart about? It is off the beaten track for my usual conference interests, yet I feel Seth Ladd’s talk on the Dart Programming Language for Web Applications, may be worthy of educational investment.
  • Jasper Potts and Richard Bair are reprising their JavaOne JavaFX talk for Devoxx, Building Amazing Applications.
  • Adam Bien, the illustrious Java enterprise consultant of note, has a talk on Real World Java EE

There are also many other events, like birds-of-feathers, hands-on-labs and tutorials. I expect to meet folk in the exhibition halls and the upstairs hacking open area. I will giving an interview to Stephen Chin, for his Nighthacking Tour in Europe, which I am also scheduled to do back in London;  and I also will interview with  Tori Wieldt for Oracle Technology Network news. So come along and say hello. Some other people from London are also going to there.

 

Eurostart Trains

On the way to Devoxx from London St. Pancras

 

See you over there in the lovely city of Antwerp after stepping off an Eurostar train from London.

+PP+

 

JavaOne 2012 Report 3 Analysis & Conclusions

October 16th, 2012 Comments off

The Conference

This year’s conference, in my opinion, was the best that Oracle have produced in the three years that it has taken over the stewardship of Java. It was great for technical content. The positives were that similar sessions were arranged to be close together in the same hotel, in other words tracks were co-located. This was markedly better than 2010, when I remember rushing from building to building to get some particular session.

( Read the earlier section of the report Part 1 and 2 )

 

IMG_1129
The Bi-Plane from Moscone West

 

Oracle chose to give only 40% of the technical session to its own employees. The result was that we the happy consumer could choose a lot more sessions, however sometimes quantity is rather not quite a good as quality. I share Adam Bien‘s observation that perhaps this was tad too restrictive and Oracle were a bit hard on themselves. The quality of the engineers, designers and architects on Oracle side is really good and usually the Oracle teams have internal know-how for the rest of us, which we need to know, as they are working on critical future projects to do with any of the Java edition, SE, EE and ME. I would also want this percentage to 50% Oracle and 50% external speakers. Compare this percentage against the other tech conferences such Apple’s WWDC and Google’s I/O, which have good company speakers. I should throw in there were no marketing talks that I can bear witness to, which is fantastic.

I can only speak of the JavaFX, Rich Media track in conference, as a program reviewer, the technical content was great. I suspect that for the other tracks, Core Java, Java EE and Cool Stuff and other tracks, the reviewers in those areas, were equally transparent, ethical about what they thought and chose as a decent material for JavaOne. In my opinion, this a conference for the people and by the people, and they deserve to have the investment in flights [expensive], hotels [really expensive] and energy and time [priceless] returned in the greater measure of satisfaction. The sum of outputs has to greater than the sum of inputs for JavaOne to really work.

In terms of the people who did turn up to JavaOne, I felt that this was landmark year, were not only I, but other Java Champions (Frank Greco, New York Java User Group), noticed that there were lot of young Java developers out and around. When I say young, I also qualify it that to not only youthful, but also including new inexperienced oldies too. This is good thing for the increasing talent in the global community of Java engineering. We will always need good engineers, who are enthusiastic about learning the Java platform. The influx of the new was so peculiar that many failed to notice and recognise the Father of Java, walking around the Hilton San Francisco, on Wednesday 3rd October.

Community Keynote

In fact, I thought I had seen James Gosling too, from about 75 yards away, in profile only, just momentarily, and I dismissed it as  a figment of my imagination. I was pleasantly surprised and amazed when James Gosling came up on stage on the Thursday community key note. We should have all guessed, because his face was featured on the September 2012, digital edition of  the Java Magazine. James Gosling came up to the stage and talked about the Liquid Robotics software, waves, low-level level volume, guaranteed 100% data storage on Glassfish servers, and cloud services he had developed over the last year or so. James Gosling said that he reviewed many cloud computing offerings for a possible PaaS solution, and in the end, explained why  he chose JElastic. He chose this PaaS solution, because it supports GlassFish, virtualisation, scaling up-and down and clustering on demand.

Bruno Souza immediately stepped in to help with the tee-shirt throwing. He gave James Gosling the tee-shirts that he had collected to take back to folk in Brazil. We should make tee-shirt throwing a proper feature of the next JavaOne, especially if James Gosling is back.

Stephen Chin became the new Program Chairperson for JavaOne 2013 and Beyond. I believe that I already mentioned how amazing this was. JavaOne now has a really fantastic community-aware person. I have every confidence that the level of the technical sessions will remain at the high standard, and I can even see that those sessions will improve.

Martijn Verburg also did a very good job explaining the Adopt-a-JSR project at the keynote. It seems like a laudable approach to get Java engineers outside of Oracle and in the wider community to help implement some of the standards.

Call For Improvements

Where there any sore points? Yes there were some that I observed.

As an oldie, I can remember the great JavaOne conferences of 2005 and 2007 at the Moscone Center. In particular, the mega humongous party to celebrate Java’s tenth birthday in 2005, which was my second time at JavaOne ever. We only need to get JavaOne back to Moscone Center or the West, which probably is not going to happen.

On the JavaOne home page, the most important tools, Schedule Builder and Content Catalogue were located in the Fat Footer. These tools needs to the above-the-fold. Please explain these web design principals to the principal web site designer. The content catalogue should also show the speakers, the full name. Many talks are attractive because of the speaker who is delivering them, for example Mark Reinhold for Jigsaw, Brian Goetz for Lamda in JDK 8 and Martin Odersky for upcoming Scala 2.10 features.

The speaker room is tiny, in the Hilton San Francisco, consequently I spent very little time in it, except to grab coffee to get the endorphins charged up. Were there speaker preparation rooms available in the other hotels, Parc 55 and Nikko? I did not check when I was there. This would be important if the track you are presenting, e.g Mobile or Java ME was co-located in the other hotels. Also I thought they could have  supplied some more edibles, sandwiches or more snacks.

Oracle were really lucky with the weather this year, because the open area, Buzz Cafe, sponsored by IBM was a pleasant space for the odd tipple of beer, roasted coffee and to get some air. What if it had rained?

The Duke’s awards, this year, were held in the Buzz Cafe and open area. It should have been part of an official keynote. The winners deserved the entire group of attendees to be there, to bear witness, in order to respectfully receive such prestigious and rare awards. In fact, we could have one additional keynote session, may be Oracle can claim some of that 10% time back that they gave up. We need to dedicate a morning or afternoon keynote to this achievement ceremony, especially, now we have such a glut of young developers attending JavaOne for the first time.

Some technical sessions were poorly attended I thought. I am quite sure on Wednesday in one of the Imperial Ballrooms A or B, and not in my session, there were only 6 to 10 people watching a speaker talk. We have to do a little better in talk selection, and attracting some good speakers to JavaOne. I think that the cost of JavaOne may be the main prohibitor. I would like to see a much longer lead-time for this, say by a couple of months, so that speakers can take advantage of the earliest flights and hotel deals possible. I would also like to hear from the developer community and what you think are good ideas for JavaOne 2013, so that if I am involved as one of the program reviewers again for JavaFX, Rich media tracks, that I am serving the best interests.

 

DSCF4026
The Mongo DB stand at JavaOne 2012

 

Future of the Java

The future of Java is basically in your own hands. From my perspective, it is good see that Java is growing and there is still interest in advancing the entire platform forward. The key brands to look out for me are JavaFX 8, Java EE 7 and of course the growing adoption of Scala in the workplace.

Oracle produced some figures, graphs and statistics showing that businesses are adopting Java SE 7 since it was released earlier last year [28 July 2011], people have switched over, and that Java SE 6 is on the wane. Henrik Stahl,  senior director of product management at Oracle, posted a blog entry mention the statistics from Jelastic, quoted adoption was 79%, which matches their internal indicators. This can be positive for the possible adoption of Java SE 8, which will have lambda functions and more functional programming concepts. It is taking a long time to change, but I believe we are getting there with the Mother Language, as the other alternative JVM languages remain attractive for those businesses and developer willing to get more productivity and not be left behind hind with legacy application and infrastructure. I want to personally see job advertisements changing from “Scala, JRuby, or Groovy are high desirable” into “Scala, JRuby, or Groovy are desired”.

A clear break for user interface development on client Java is called for, concerning JavaFX and new media APIs. There are many people who depend on Swing, SWT, Adobe Flash / Flex and even Microsoft SilverLight for their UI. I will leave out the businesses that have already decided that Web platform and HTML5 are only UI for their products. JavaFX represents a sea change for Flash and SilverLight, it means that once again, you can build the entire application, client and server side, from metal to UX nuts using Java, if you so want to architect that way. This is fantastic if you are starting in mythical world of greenfield, development which every recruiter will try to sell to you that their client is offering, and we know in reality is that it never is, quite, the case. The bath water is the Swing framework from 1998, because the API was built with immediate graphics and rendering, and the babies are the application built squarely on Swing that the business is using now. It is going to be frightfully hard to do, cruel even, some poor architect will have to come to the conclusion, JavaFX and some sort scene-graph is the new path. There is no such thing as dirty job done cheap, but hey somebody has to inform the business that the UI code and application is in serious danger of becoming out dated. A transition from the old UI world to new is called for. Those young developers from JavaOne walking the floor, enjoying the demonstrations, FX and taking it all in, the 3D and rich media, including my very own video fracture demo that I repeated again, I really envy the sort of exciting applications that those fertile uncontaminated imaginations are going to create in the next few years or so.

The new idea is no longer the Java Applet that runs inside a web browser. The Java Plugin is history and Java Web Start is error prone and broken. Instead of deploying an application with an Applet or Plugin, you will be deploying your business application, the UX part of it, in the future to an application store. The application store may be a commercial one or might be a private implementation solely for the use of your employees and staff inside the big corporation. Getting JavaFX and Java to work in the forthcoming Microsoft Application Store must be a given, because it represents a clear competitive advantage to Microsoft in its battle with Google and Apple, when Java applications can be distributed by Windows Store. Modularisation of Java is going to be crucial as are Mark Rheinhold’s architectural idea about offering a series SE profiles, of ever increasing usefulness and package, until Jigsaw and Java 9 is here.

Will these young developers be willing to apply for Swing application developer job writing Java SE 6 in 2015 for some investment bank in the city, the financial district, the extreme majority, quite absolutely not? I could be even more crueler, but I think I will stop now and put the chalk down.

 

DSCF4040
Ben Evans [holding the mic] is talking about Adopt-a-JSR program

 

Shout Outs

In no particular order, whatsoever:

  • Mark Stephens, IDR Solutions
  • Betrand Goetzman, Consultant et Développer Web 2.0
  • Valérie Hillaware, iText PDF
  • Hans Docktor, CEO, Gradleware
  • Peter Walker, COO, Gradleware
  • Sidney Allen, StackMob
  • Peter Van de Voorder, RealDolmen
  • Dr. Olaf Grebner, Unternehmer
  • Gerritt Grunwald, Canoo
  • Ix-chel Ruiz and Andres Almiray, Canoo
  • Arvinder Brah, Navis
  • Dierk Koenig, Canoo
  • Wolfgang Wiegend, Oracle, Sales Consultant Fusion Middleware
  • Branko Mihaljevic, Hujak, Croatian Java User Association
  • Matija Tomaskovic, Evolva, Croatia
  • Fried Saacke, President of the Germany Association of Java User Groups
  • Frank Greco, New York User Group, USA
  • Cecilia Borg, Senior Manager, Engineering, Oracle
  • Arun Gupta, Glassfish, Oracle
  • Simon Ritter, Java Evangelist, Oracle
  • Jim Weaver, JavaFX Evangelist, Oracle
  • Yara Senger, SouJava, Brazil
  • Bruno Souza, SouJava, Brazik
  • Todd Castello, countless JavaPosse Round-Ups
  • Mark Heckler, Oracle
  • Sharat Chandler, Principal Productor Director and ex-JavaOne Program Chairperson, Oracle
  • Stephen Chin, new JavaOne Program Chairperson, Oracle
  • Ed Burns, Specification Lead for JSF, Java EE 7, Oracle
  • James Ward, Heroku
  • Jonathan Giles, JavaFX SDK team,Oracle
  • Michael Heinrichs, JavaFX SDK team, Oracle
  • John Yeary, Greenville JUG
  • Victor Klang, Typesafe
  • Fred Simon, Artifactory, JFrog
  • Shlomi Ben Haim, JFrog
  • Jasper Potts, JavaFX, Oracle
  • Richard Bair, JavaFX, Oracle
  • Carl Dea, Software Engineer, Author
  • Cameron Purdy, VP Product Development, Oracle
  • Nandini Ramani, VP Product Development, Oracle
  • Gail and Paul Anderson, Book Authors
  • Paul Deitel, Book Author
  • Peter van de Voorde, RealDomen
  • George Saab, VP Java Platform Development, Oracle
  • Csaba Toth, my regular JavaFX talk attendee
  • Adam Bien, Java EE book author, rock star and Java EE 6 consultant
  • Brian Goetz, Lambdas in Java 8, Oracle
  • Anton Epple, Netbeans
  • Mark Reinhold,  JDK Architect, Jigsaw in Java 9, Oracle
  • Luc Duponeel, ScalaFX committer, get that code generation in there please
  • Martijn Verburg, Adopt-a-JSR, London Java Community
  • Danno Ferrin, Groovy, OpenJFX Hacker
  • Mike Lehmann, Senior Director, Java EE, Oracle
  • Ryan Cuprak, Enginuity
  • Tori Wieldt, Oracle
  • Mattius Karlson, Swedish JUG, JFokus
  • Stefan Janssen, Devoxx, Belgium JUG
  • Dick Wall, JavaPosse
  • Van Riper, Google
  • Carl Quinn, JavaPosse
  • Kevin Nilson, Java Champion
  • Kirk Pepeerdine, Performance Tuning Expert, Java Champion
  • Heinz Kabutz, Java Language Expert, Java Champion
  • Jevgeni Kabanov, ZeroTunraround
  • Geetjan Wielenga, NetBeans Dream Team
  • Roger Brinkley, Java Spotlight Podcast, Oracle
  • Stephen Colebourne, Java Champion
  • Nichole Scott, Oracle
  • Regina Ten Bruggencate, Java Champion, JDuchess
  • Henrik Stahl, Oracle

Apologies, if I left you out. See you next year, San Francisco, Sunday 22 – Thursday 26, September 2013.

+PP+

 

DSCF4078
Java Client side desktop lunch with Jasper Potts [L], Richard Bair [R] is looking directly at Stephin Chin in the background, sitting to next Richard Bair with his right hand touching his left hand and watch is Sven Reimers

 

 

IMG_1219
This was supposed to be a clear view of Eddie Vedders from the Grunge Band, Pearl Jam, performing at the Oracle Appreciation Event

 

DSCF4082
Jonathan Giles at the Desktop lunch, which he organises with Stephen Chin, every year since 2010.

 

IMG_1176
Mac Book Pro Retina Display keyboard

 

IMG_1262
Of course, this conference fell on anniversary of Steve Job’s death – Someone wrote “SJ, please use TimeMachine and come back!”

 

 

 

+PP+

JavaOne 2012 Report Part 2

October 13th, 2012 Comments off

The theme of this year’s JavaOne was Make The Future Java. Was this tagline a clever choice of words? Maybe an implied call to action? It would appear that Oracle are relying more and more on community involvement to ensure certain products were.

DSCF3945
View from the Villa Florence, JavaOne had unseasonal sunny weather, we were fortunate.

Scala

It was somewhat as a surprise to see TypeSafe exhibit at JavaOne 2012. I believe this showing of the premier Scala software company is a clear sign that Scala is gaining interest. Although I did not go to many of the technical session in Scala, I saw that there were some very good presenters, more importantly framework inventors during JavaOne. For example, I bumped into Victor Klang, the co-protagonist for Akka framework.

Typesafe build an iOS application for the JavaOne content builder that automatically filters out full Scala talks or just presentations, which mentioned Scala. My second presentation Scala, JavaFX, EE 7 and Enterprise Integration was featured in the app. Stephen Chin’s talk JavaFX and Scala, Like Milk and Honey was also featured.

I believed Scala won the Web Framework Smackdown technical session, which I suspect was for the Play Framework. I was so busy on the rich client track and preparing for my own talks, I failed to catch Hazelcast: Scalable Data Structure with Talip Ozturk, who once presented his framework to JAVAWUG many seasons ago.  Then there was Scala Tricks, by Venkat Subramaniam, who I have never seen present and is well known for his books, blogs and superior knowledge of Scala programming.

It is safe to say, here, that at this year’s JavaOne conference, Scala was well represented with a serious development technical sessions and BOF. The naysayers might be still be upset about Scala is gaining traction at Java’s premier conference, but I believe that this is nice and deliberate progress for a new language. Let us remember Scala is a bit behind Groovy the programming language is breaking out of the Mother Language in terms of timeline. Groovy was the first non-JVM language that I knew, which caught serious interest and sparked a change for innovation; and plotted a path to remove boilerplate, being more expensive and quicker at being creative.

Scala is getting there and now that there is a commercial company behind it with funding, after all somebody has to pay for booth space at big conference, things can only get be better. May be this is a little bit of salt, there, in that last sentence, with that sly reference to former British Prime Minister, Tony Blair, winning theme song lyric. I only just saying, since Typesafe scored by bombshell last month [September] with the announcement that Rod Johnson, creator of father of the Spring Framework, former CEO of SpringSource, has joined the board. Let’s keep moving forward, shall we?

Trade Matching Engine in Scala

Surprise of the conference for me, came by chance, attending a talk by CME Group, about a trading engine. Matching trades is the practice of associating equivalent deals with another deal, which happens in financial exchanges. In order to sell X quantity of B, there must be a buyer is willing buy B at X and willing to also trade A at Y. Matching is math heavy

CME Group talk was about their architecture in product which is currently working with 19 Trading Engines. Market liquidity is provided by the buy/sell orders submitted to the system over the whole market. Each market is a type product, for example foreign exchange (forex) or equities (stocks) or stock loan (bonds and guilts) etc. The particularly of major difficulty of any trading engine, is the number one requirement, allow customers to trade anything at any time, with anybody in any order. Second, the ordering of trades is very important. The impact of the requirements befits the design of the architecture of the trading engine.

I just was listening to this talk, billed as high availability trading engine with sub millisecond response time, I thought, hey hoy, another example of Core Java implemented. To my surprise, the presenter suddenly push on the next to slide, I was stunned by it. CME Group is using Scala against MongoDB in their architecture.

IMG_1185
CME Group use a trading matching engine written in Scala with solid state memory MongoDB, which is matching a billion deals per month in September 2012. The UI is Google Web Toolkit

Some of the statistics were:

  • CME Group were matching trades to a billion orders per month in 2012
  • A peak 32 billion order per month at the height of the financial crisis in 2008
  • 6 years ago the 11 ms response time
  • This year, 2012, they are down 1ms

Java Enterprise Edition

Java Enterprise Edition 7 is the next edition of the enterprise platform. Whereas a last year, there was an obsequious announcement that Java EE going to be Moving to the Cloud, this year that statement has been refactored to Supporting HTML5, RESTful Services and Web Sockets.

The Expert Group and all of the members who were at JavaOne, expressed that it too soon  to standardise the cloud features of the enterprise edition, when so many products, cloud provider and PaaS (Platform-as-a-Service) solution are experimenting and innovating. They collectively decided to defer standardisation of Cloud feature in Java EE until to next edition, eight, 2015 / 2016.

XaaS

In cloud computing, there are several definitions of services, also known as X-as-a-Service,
which are level of abstraction over software architecture. The lowest level is known as Infrastructure-as-a-Service (IaaS), the highest is Software-as-a-Service (Saas). Generally, the lower the abstraction the more control the customer (you) have, but you must have expertise and know how to operate your cloud services. The higher the abstraction, the less control (you) have, but you are can rely on the provider to look after scaling and provisioning across servers.

IaaS describes a cloud provider that will only supply, on-demand, infrastructure: network, bandwidth, operating systems, machines, data storage and, most importantly, virtualisation. It is up to the customer manager the cloud services. Think Amazon Web Services and Netflix.

PaaS describes a Platform-as-a-Service from a cloud provider, where they will look after the infrastructure and scale up or down for you the customer, on demand of course, but you build your business application against platform, which the provider supplied. Hopefully, the platform is compatible with Java, which might be an application server, such as Glassfish or JBoss. It can be some kind of virtualisation solution that make some, but not all, of Java EE available. Think Google App Engine and the restrictions store data in Google’s cloud storage using Java Persistence API. There is a limit about your database entities can only have a basic join between them. In other words, complex database table joins are out of the question.

SaaS describes a cloud provider that supplies a software solution, where they will look after the infrastructure and the application platform. The cloud provider is only responsible for the software that they offer on the demand, which can scale up or down, and you only pay for what you use. Think Salesforce and Force.com; and for a free variety, any of Google Mail, Yahoo Mail, Google Drive, Microsoft Office 365, DropBox, etc. They are all examples of SaaS.

FaaS stands for Framework-as-a-Service and it describes a cloud provider that usually sells a SaaS solution, but additionally offers an application API to customise the solution. For example to personalise the SaaS to an internal bank’s look or feel, or even add customer extensions (of course, that are vendor lock-in; if you find yourself in bed with a FaaS cloud provider, consider yourself married.).

This is fair enough, I believe this good idea. The last thing any of us all need is another EJB 1.x and EJB 2.x, design by committee, without consulting the community and the de-facto products that are out on the market. Nevertheless, the cloud landscape does look at the moment difficult to predict and the politics and market will dictate the necessary requirement for any standard. It is clear that the market leaders, Amazon and VMWare, Spring, may not want to join any standardisation process, because they are the leaders. It is all about the business and making a profit after all. Perhaps, the community and the customers should demand a bit more of their providers, because as a cloud customer, you are ultimately renting and paying for electricity, energy, bandwidth and cooling systems at whatever data centres around the world their application are provision on.

With a Java standard for cloud computing, the advantage for a consumer is that your application should be portable to another cloud provider, if you do not depend on vendor lock-in APIs. People would laugh at the old question, why would I migrate from Oracle to MySQL to Sybase for my business, architects would spin dizzies and scoff such a ludicrous suggestion being able to change database. However, in a cloud computing world, with big data, this is a environment where you, as a business owner and software architect, need to think very careful as to your future investment. Cloud may be too early for Java EE, but it is worth find out now who is your equivalent de-facto winner, the same as it was for Jakarta Struts in 2001 as a better way to structure Java Server Pages and Servlet applications.

Fast more important than cloud, and I feel that the Java EE expert group is on the ball, is to get Web Sockets, and support for HTML 5 out of the way. There were two crucial announcements, JavaScript running in the server, through Oracle’s Nashorn project. Oracle are going to donate Nashorn to the Openjdk project. The idea is to deliver a Node.jar a similar cousin to JavaScript’s node.js, which has the advantage of working in Java EE 6 / 7. Oracle said that Redhat and Twitter were third party companies, which were very interested in getting involved in the project.

Oracle have also been working on a binding between JavaScript and Java, so that web client can directly bind, securely and safely, with servide side Java object. This project is called Avatar. Little was none of this internal Oracle project, apart from slideware written and product by the one, Arun Gupta. It is believed that project makes use of a little known HTML 5 technology, Server-side Events (SSE), where a rich internet application or web client makes a JavaScript call to the server and gets a response back presumably from annotated EJB service end point or CDI manage bean. Avatar may also make use of RESTful services as well.

There is two things that in my notes for Java EE 7 that are missing for draft standard proposal. For a Java SE standalone client, where is the API for calling WebSockets and Serverside Events from Java. This would be eminently be very useful for JavaFX applications as well as integration testing.  The second thing is a how to instantiate the Context and Dependency Injection container in a standalone Java SE client.

At the conference, I pick literature about some of the cloud provider for Java EE. There Of course, Oracle, offers it own Oracle Cloud Java computing service, which is based on hosted WebLogic servers. JBoss OpenShift is an offering from RedHat, which offer Java EE scalability and on-demand functionality in the cloud. There is also Heroku, which supports some of the Java EE standards and has a very different model and history to the common Java developer track. These are more famous cloud provider for Java at the moment.

After James Gosling, technical community keynote on Liquid Robotics, he revealed that Liquid Robotics had settled on using JElastic as their cloud provider of choice. It was a second major coup for this years Duke’s award winner for enterprise Java. JElastic support GlassFish hosting as a Java EE application server in the cloud environment.

There was one other offering at JavaOne that I saw, albeit very briefly, Waratek, an Irish cloud provider, based in Dublin. Their solution was based on Java Virtual Containers, no coding required and instant scalability. Waratek is a Java licensee, thus is not aimed at a Java EE squarely.

As you can see, Java EE, and cloud provisioning, at least in the PaaS solution is a bit of mangled mess in 2012. There is no way that this hotch potch can be standardise, because it is all new, fuzzy and very not in focus. For the Java EE 7 specification, the removal of cloud PaaS standardisation is a sigh of relief, we can start to build both HTML5 application and may be those rich client JavaFX application too. This is progress.

Next Part. The Google Office Visit and the annual shout-outs.

Santa Clara, October 2012
+PP+

IMG_1194
Carl Dea, an Apress book author, who wrote the mini tome: JavaFX 2 Introduction By Example

IMG_1132
[R] Yara Sanger of the Brazilian Soujava and [L] Martijn Verburg of the London Java Community

IMG_1205
This guide dog undergoing training apparently. The owner brought him to the conference.

IMG_1184
Architecture overview slide from Chicago Mercantile Exchange Group

POSTSCRIPT: I managed to find details of that talk, which I wondered into.
It was called CON3753 – Delivering Performance and Reliability at the World’s Leading Futures Exchange and the speaker was called Rene Perrin, a Technical Specialist Software Engineer at CME Group. The billing for the presentation, describe how the order volume grew ten fold between 2007 and 2011 at the Chicago Mercantile Exchange has grown more than tenfold, from 1 to 11 billion monthly orders and quotes. During that same period, the average response time improved from 35 milliseconds down to less than 5 milliseconds. It was just lucky I suppose, because the session discussed how Java technology enabled the exchange to achieve the tenfold growth, little did I know from the bill that CME Group really meant Scala!

DSCF4377
The conference tee-shirt in the rucksack

IMG_1227
James Gosling is mobbed by the interested, amazed and delight fans. I should brand new fans who came to JavaOne for the first time this year. This photo was taken after Thursday’s community keynote

IMG_1161
Dr. Robert Ballard, the famous oceanographer explorer, of Titanic fame with movie director, James Cameron, gave an inspirational key note on the benefits of education at the Masonic Auditorium Center on Sunday evening. “We need to inspire the young – Don’t sell science, sell scientists and engineers”

IMG_1145
Cameron Purdy, Oracle VP, and the person looking after all things Java EE 7 and Beyond, takes the stage

IMG_1144
[L] Nandina Ramini, Oracle VP looking after JavaFX and Client side Java. Walking off the stage are [M] Arvinder Brah and [R] Dierk Koernig

More to come. Need to get over the Californian Tour, first ;-)

+PP+

JavaOne 2012 Report Part 1

October 11th, 2012 Comments off

DSCF3950

 

JavaOne 2012 Conference was last week, as I travel around Southern California, it seems like it happened yesterday. I write this blog initially in Monterey Bay, and then I finish it somewhere near Paso Robles, may be Los Angeles, probably. I have to say, that this year the JavaOne conference was a blast, and not just because I presented three times. Java has moved forward, following the tagline from the 2011 conference, “Moving Java Forward”. This year’s tag line is on the tee-shirt was “Make The Future Java”, indeed.

 

DSCF3979
This is Elber, at one-time an actor, a creative artist, sculpture maker and also a technologist from Brazil. He created the illuminated fish head. I am not sure what type of fish it is by the way. Ask Elber when you see him!

 

The Gathering

Why do we all come to JavaOne? We travel hard to get here, because this is the premier league conference where people from the four corners of the Earth can meet up, discuss the latest trends, solve headaches, come with new solutions, get involved with the community, learn from one another, socialise and finally measure the exact state-of-the-art, the technology rampantly swirlingly around the Java Virtual Machine. The most important and obvious reasons are that Oracle, the stewards of the Java, host this mega conference and they are based in California, so this is their home event. If you will, it probably feels like a home match. I think many people forget about that last relative sentence.

 

DSCF3980
[L] Van Riper, Google and [R] Stephen Colebourne, OpenGamma, both Java Champions, are chatting amongst themselves before the Strategy Keynote. Sitting behind them are Andres Ix-chel Ruiz and Andres Almiray [R-to-L]

 

I went out the JavaOne in order to find out what will happen to JavaFX from personally interest point of view and also to learn about the enterprise Java side, Java EE 7. I was pleasantly surprised to see a lot of Scala talks in the online content catalogue, although I did not go to many of them. Typesafe were featured predominantly.

Bundling JavaFX JAR

Why is jfxrt.jar bundled as a JRE separate  file, and not inside rt.jar?
The answer is that the JavaFX is not official part of the Java SE 7 standard. The only way to be standard is to provide certification Java SE committee. Thus JavaFX, in the future, has to be submitted, by Oracle, to the Java Community Process as new Java Specification Request in order that other valid Java SE implementations such as IBM, OpenJDK and SAP can make their choices. Choose to include JavaFX or not.

JavaFX

The story of JavaFX continues onwards. For the desktop environments and operating systems, JavaFX is not cross platform. JavaFX 2.2 runs on Windows, Mac OS X and Linux. As far as I am concerned, Oracle kept their promise to make JavaFX viable on the desktop, they also include JavaFX now with JDK and JRE for Java 7 Update 6 and better.

Hasan Rivi, a vice president at Oracle, Enterprise Middleware Products and Java, announced in a keynote that JavaFX will be fully open sourced by the end of the year 2012. Rivi said, “On the FX front, on the client, again a lot of new capabilities in the release, we really think that it is at a point now, we continue the process on open sourcing FX .. we will finish all components of FX by the end of the year. And we dearly like to invite the community to actively participate with us in taking FX forward”. The Sunday keynote were updates around products Java SE, Java EE and Java ME, you can watch it here. You might remember a couple of years ago, Stephen Chin, originally petitioned for JavaFX being open sourced fully. Ironically, Stephen Chin, is now a JavaFX ambassador for Oracle, and his wish is coming true. The code bundles will appear shortly in OpenJDK project dedicated to JavaFX.

Other folk were expecting that JavaFX would be ported to Android or other smartphone devices, and therefore expressed disappointment that this target was not announced at the conference. Oracle did say that they had already demonstrated some of the technical possibility of running JavaFX on devices to important corporations recently, however the take-up and the follow-through had been poor. It is hoped that open sourcing of JavaFX will produce the extra impetus to push the framework and architecture to mobile and embedded devices.

Personally, I believe we are close to getting a critical turning point. We need just one viable, fun and creative JavaFX desktop application that tips the below, which has the x-factor, with amazing vision and has been put together with talent and skill, using the best user interface design patterns, which provides the compelling reason, “Why are we not porting this existing and excellent JavaFX and Java application to a tablet device?”.

The open sourcing premise of JavaFX is promising, because it should allow third parties to jump in to the source code and add features to the platform that Oracle have not yet decided on? ( support for accelerometry, magnetometry, geo-location and photo cameras. I think it would be wise to check that Oracle have not yet invented any of these wheels internally first? However, history has shown that business does not prefer to wait for anybody, especially when they think that they can make money from the idea by doing it first.)

 

DSCF4001 Jasper Potts' JavaFX Content Catalog Kiosk
The Kiosk that Jasper Potts built to demonstrate JavaFX running on an embedded device. The application is the content catalog for entire JavaOne conference.

 

DSCF4002
Jasper Pott’s embedded JavaFX console side view

 

Oracle did announce JavaFX for Linux as a developer preview, JavaFX for Linux / Embedded ARM devices, and SceneBuilder version 1.1. Oracle is focused on their effort on embedded devices, which are always-on electronic kiosk, terminal, point-of-sole and monitoring domains. In fact, Oracle organised a parallel and separate conference called JavaOne Embedded, which ran on the Wednesday and Thursday, aimed for business managers and decision makers.

As if it to prove this point, Jasper Potts and Richard Bair, created four hand-made production kiosks, in a month long skunkworks and proof-of-concept project. The kiosks were displaying the entire JavaOne Content Catalogue as a JavaFX application running on Java SE Embedded on an embedded device. The LCD screens were multi-touch allowing the conference goers to log-in and plan their schedule touch UI. The kiosk were placed at certain points in the JavaOne complex, the Hilton, Parc 55 and Nikko hotels. As usual with embedded devices, the technical capabilities of the hardware was limited by the amount of available memory, the CPU speed, the number of cores, and the number of threads that could be run simultaneously. Jasper explained that there were even limits on the number of instructions that could be sent from the CPU to the GPU in order to maintain the illusion of performance through user responsiveness. Sending image buffer frames from CPU to GPU and back could be expensive if thought and effort are naively implemented. Porting JavaFX 2.2 to Java Embedded SE over the past months of was a humbling task, therefore it revealed many bugs and refactorings that were solved, which in turn benefitted to the JavaFX desktop product. This previous fact was revealed by Richard Bair in a hallway conversation. The penny should be dropping by now as you are reading this blog.

In case, you did know it already, JavaFX 2.2 has some great features in current edition. There is Canvas support. You can program graphics like HTML5, the Canvas API looks quite familiar. With Canvas in JavaFX, you get the ability to instantiate a writable image buffer with a fixed resolution associated with a Java 2D graphics context. Suddenly, you can develop interesting pixel rendering effects in, some might say, traditional computer graphic programming mode. There is also Pixel image buffer I/O support, where utility classes PixelReader and PixelWriter provide high performance access to reading and writing pixels.

JavaFX 2.2 already has JavaScript support, namely:

// Java
class DataSource {
	public List getCustomers();
}

// JavaScript
JSObject window = (JSObject)webEngine.executeScript("window")
window.setMember("ds", new DataSource() );

JavaFX Maven Integration Niggles

Due to licensing concerns, it is not yet possible to redistribute the jfxrt.jar
in to a third-party Apache Maven repository ( http://repo.maven.apache.org/maven2 or http://uk.maven.org/maven2). Therefore in Maven, Gradle or another build tool you need to explicit link to the JavaFX SDK.

JavaFX relies on native libraries in order to tap in to the underlying operating system’s graphics and media interfaces. These are guaranteed to be different for Linux, Windows and Mac OS X, and the issue is that the JavaFX needs to load one of these libraries dynamically at runtime. Bundling static link to jfxrt.jar is not enough, because the NativeLibLoader class inside of it, must resolve and load a platform specific native library. Therefore it prevents a deployment headache as well as a dependency headache. How do organise jfxrt.jar and decide on the proper Maven Group, Artifact and Version coordinates.

JavaFX will have amazing 3D capabilities. Attendees of the strategy keynote were treated to demonstration of a shipping container terminal system application, which was using an early alpha version of JavaFX 3D API. This was a demo from Navis Corporation [Arvinder Brar]  in collaboration Canoo [Dierk Koenig]. You can also watch this presentation yourself on line CON4853 – JavaFX for Business: Monitoring a Container Terminal. It would be appear the JavaFX 3D will ship with meshes, textures and of course polyhedra. You can also see Nandini Ramini in the Strategy Keynote. Canoo also announced an open source project about their interesting collaboration project Dolphin.

JavaFX 3D will have moving cameras, because they are now going to be treated as like javafx.scene.Node types. I can image translating and rotating a camera through 3D space, but scaling and shearing it. What the does mean? Scaling a camera could be zooming in and out , shrinking and enlarging the view pyramid. Shearing a camera in mathematic 3D transformation, I believe, would be just weird. Actually, I can imagine a sci-fi effect with lots of randomly placed stars [points] in 3D space. Yes I very am excited about the 3D possibilites for the next JavaFX version. I wonder personally, if I could simulate Hyperspace with it, but perhaps it involved non-affine transformations, a non-linear concept anyway ;-) .

The next version of JavaFX jumps from 3.0 to 8.0 in order to match the upcoming Java SE 8 release. I wholeheartedly agreed about this version jump so that matching the Java numbers, and also because the JavaFX library jar is bundled with the JDK. In the future, JavaFX will be itself a module in Java 9, which is expected to implement modularisation (Project Jigsaw).

JavaFX 8.0 will have really great rich text support. Richard Bair showed slides in one his JavaFX presentations about the TextPane and TextFlow controls. Finally, we will be able write an Integrated Developer Editor (IDE) with syntax handling in a JavaFX. Moreover, the new text controls will be composable, support bi-directional languages like Arabic and Hebrew, both at the same time. The text more important will also wrap correctly and best of all, developer will be able to add generic shapes to the TextFlow component so that the rich text wraps around and aligns correctly.

To find out more, watch the JavaOne 2012 Keynote Highlights.

 

DSCF4070
Brazilian are always in attendance at JavaOne USA. If you can’t beat them [for passion] then you might as well join them.

 

Java SE

Java SE 8 will have Lambda functions (JSR 335) long overdue for five years. Brian Goetz gave a talk on lambda functions, which I could not attend, of course, because of clashes [I am sure I will catch it again in Devoxx]. Lambda brings essential functional programming to the platform. Here is a word of caution here, the proposal does not introduce higher order functions, although they can be implemented in a library. Lambda functions will simply the event handling logic in JavaFX, and code will must more functional and readable.

Mark Reinhold explained his reasons again for deferring the Jigsaw project to 2015. Although the full implementation will be delayed, he mentioned at least four profiles. Each of these profiles builds extra functions into the other platform until the full version. Mark Reinhold explained in his session, which I did attend, how hard it has been to refactor and restructure the Java Runtime Environment. His major concern was testing and building a guaranteed implementation of module system that would work from version 1.0 with little flaw.

I believe he is correct in delaying Jigsaw to Java 9. Consider the flawed Apple iOS 6 map implementation that was released as a production code earlier this year. If Java Jigsaw were released as early and as buggy as the iOS 6 Maps then we would be crying, despairing and wondering how on earth we did not test, and test early. The profiles in Java SE are a great idea, in the Java EE land, we already have two, the WEB and FULL. It is a great compromise.

People are looking forward to the new Date Time API (JSR 310) and also improved Annotations on Types (JSR 308).

Oracle also announced the Sumatra project in OpenJDK, which looks to see how the Java Virtual Machine and HotSpot can take advantage of the abundance of cores in Graphical Processor Unit (GPU) chips, which are found in hardware accelerated graphics cards.

 

DSCF3993
Sharat Chandler addresses the gathering of JUG Leader and Java Champions at the social event where he expressed his thanks to all of us.

 

Miscellany

Sharat Chandler is moving somewhere in the Oracle chain. I think it is polite to allow him announce his final destination, when he gets there. The title of Chairperson of the JavaOne Program Committee passed from Sharat Chandler to Stephen Chin on the Thursday community keynote. This was a surprise to all of us. None of the Java Champions and / or JUG Leader knew this was happing. Stephen kept his secret under wraps.

I believe Stephen taking over the organisation of JavaOne will be asset to the collective, because he is very familiar with the community of user groups around the world. He travels to the conference, does a great job presenting and always involves the audience. Stephen starts his new role with the Nighthacking Tour of Europe.

Sharat Chandler also did a great job taking over the running of JavaOne in the past two years. He did listen to the concerns of the community, and push to support the leaders, the attendees and made JavaOne at least viable. One of the things he did, was reduce the markitecture of the conference. There were two days of key notes, and the rest of the conference with given over to the technical sessions. So I want to congratulations on both Sharat and Stephen.

This is the end of part one. In part two I will cover the Java Enterprise part of the conference, in particular “Moving Java EE to Cloud” or not, as it proved to be, provide more analysis and perspectives on Java and miscellany.

See you in part two

Los Angeles, October 2012
+PP+

 

DSCF4073
[L] Sharat Chandler’s landyard compared to mine [R], spot the difference, no prizes.

 

DSCF4065
Stephen Chin, on stage, on the Community Keynote, has just become the Chairperson of Program Committee for all future JavaOne events from 2012 onwards.

 

DSCF4049
[L] James Gosling, the Father of Java, makes a welcome return to JavaOne after three year absence, promoting Liquid Robotics and Java working inside oceanographical science.

 

DSCF4030
On the way to and from from the Oracle Appreciation Event, I hung out with the Brazilian contingent at JavaOne. We were on our way back to the Hilton SF, when this photo was taken.

 

DSCF4027
[L] Simon Ritter is on demo kiosk duty explaining his Maker-make passion with JavaFX and strange and wonderful hardware to an attendee.

 

DSCF4017
This is me just moments before my first solo talk on Wednesday, on Contemporary User Interface Design Patterns in JavaFX 2.2. I was nervous as hell. Well you always need a little bit fear to give you a kick of adrenalin.

 

DSCF4015
Gerrit Grunwald is talking about writing JavaFX custom controls and all about the cool looking gauges that he has been implementing.

 

DSCF4011
[L] Bruno Souza of the Brazilian SouJava user group. He is holding the special JCP award for his user group’s involvement.

 

DSCF4006
Book authors should stick together, although at the time of writing [Oct 2012] and I am at the start of the journey of being a writer. [L] Paul Anderson and [M] Gail Anderson authors of Essential JavaFX (2009)

 

DSCF4087
[L] Stephen Chin, my partner in crime in the JavaFX Developer Guide for JavaOne 2012. This photo was taken at the annual desktop lunch that Stephen and Jonathan Giles organising for the conference.

 

DSCF4010
Centre stage, Chairperson of the Java Community Process, Patrick Curran, shares his delight at the JCP evening

 

 

+PP+

Silicon Valley Code Camp 2012

October 8th, 2012 Comments off

The Silicon Valley Code Camp is a free event organised Peter Kellner and others every year in October. The SVCC talkes place at Foot Hill College, Los Altos Hills, California. It is now in its seventh edition, which in my opinion extraordinary.

This years unofficial attendance was about 3800 participants, over range of technologies. It is not just a Java conference, the SVCC embraces native programming languages like C++; web development through JavaScript and Dart; the JVM platform with  Java, Scala and Groovy;  Microsoft technologies, Silverlight, C# and DotNet; and non-development sessions such how to find start-up funds, cloud computing and even how to recruit the best team in the valley.

What astounds me is that this is all available free to attendees, the sponsors pay the hosting, hiring and the obviously for food and beverages. This is training and education for free, albeit the speakers are not trained professional educators, but mostly from my witness, they do know what they are talking. To submit a talk here, you just volunteer your services. It is a decision, can I make the time and effort to lecture or speak about a topic that is interesting for attendees? If you can do that, then it is good chance to change the world. After all, it is the learning experience, in my opinion, it is chance I feel to give back something to community that somebody gave in the past to me.

Here are my slides to my talk Leveraging Java EE 7 and the Cloud with JavaFX, which took place on Saturday 6th October at 3pm

The attendance was smaller than JavaOne, but I am not disappointed in that at all, the smaller the audience size, the more intimate it is, the chance to get to know and ask questions about the developers. Why they like Java? What are they hoping to achieve? From these question, I was able to tailor the presentation slightly to be more about JavaFX than JavaEE.

Java EE 7 is now repositioned from Moving to the Cloud to HTML5 Web Sockets and RESTful services. It is draft specification and you can download the latest document from the JCP.org under JSR 342, which probably needs an update.

I met several members of the community including:

  • Van Riper
  • Kevin Nilson
  • Andres Almaray
  • Ixchel Almaray
  • Csaba Toth
  • Chris Richardson
  • Peter Niederwiesen
  • Dave Nielsen

 

+PP+

Moving Java Forward into The Future

September 30th, 2012 1 comment

Well now. I got here, San Francisco, on Friday night in one piece for another JavaOne 2012 conference. Sunday, today, is the first day of the conference. What will 2013 bring to the Java community world wide? What sort of technology will become more recognised?

I am actually very happy with the way JavaFX has been adopted. It started as this really hard to fathom thing in 2007, with Christopher Oliver. JavaFX Script was fantastic idea and those involved with graphics, rich media, and scene graph knew that Java had nothing to stand worth as competition against Adobe Flex, SilverLight and other technology. I was surprised as many have been in the time between now and 2007, how the mighty Flash and the markitecture of SilverLight fell to the way side.

I do not think this idea of thickness and size of an assembly, bundle or plugin was the entire story for Flash’s demise or Java on the Desktop to really take off. It certainly is the wariness of developers and business distrust of Microsoft technology that left SilverLight as being a corporate investment risk.

The Java platform is the success of the technology and the community around. I might bemoan the fact, the masses take an age to upgrade from J2EE to Java EE, keeping around old application server technology, like WebLogic Server 7, WebSphere 5, and IBM RAD 3, let alone moving to learning a new language like Scala or Groovy or something else. There is great warmth and comfort and a bit of patience around the Java platform. Oracle has to be congratulated for being a relatively gracious working steward and taking over the corporate mess of Sun Microsystems. JavaFX is a case in point.

Finally, we have a great scenegraph library and API that can deliver rich media, graphics and audio up to the standard of the early 21st century. Oracle have kept JavaFX alive, and supported Java EE and they should and will. I think with a little patience and a deliberate design it will all work out.

What is clear is to me, is that whole community deserves a global event where we all can meet up and see the state of the art. I expect exciting times are ahead for the whole Java platform and it will be up to the community to meet the challenges.

Here is my lanyard.

  Peter Pilgrim's Lanyard for JavaOne 2012

Here is Chris Oliver from 2007, the inventor of JavaFX Script and Form Follows Function (F3).  [Skip the first minute to get to Chris]

If you are at JavaOne 2012, say hello, and  feel free to chat about Java and the future. If you cannot be here, then watch the technology world press for details over the next few days.

+PP+

Which JSRs Are Included In Java EE 7?

July 6th, 2012 Comments off

I started to fill out a table of all of the Java Specification Requests that are supposed to go into Java EE 7. Because the platform edition is still being decided, some of the details are rather hard to pin down.

The full EJB Product for Java EE 7 has these following standard components and APIs:-

Name

Version

Description

JSR

Web

Profile

Batch Process

1.0

Batch Processing

352

 

Bean Validation

1.1

Bean validation framework

349

 

Common Annotations

1.1

Common Annotations for the Java EE platform

250

Might be

CDI

1.1

Contexts and Dependency Injection for Java EE

346

Y

Concurrency Utilities

1.0

Concurrency Utilities for the Java EE platform

236

 

DI

1.0

Dependency Injection for Java

330

 

EL

3.0

Unified Expression Language for configuration of web components and context dependency injection

341

Y

EJB

3.2

Enterprise Java Beans, entity beans and EJB QL

345

Y (Lite)

JAAS

 

Java Authentication & Authorization Service

   

JACC

1.4

Java Authorization Contract for Containers

115

 

Java EE Management

1.1

     

JASPIC

1.1

Java Authentication Service Provider Interface for Containers

196

 

JavaMail

1.4

Java Mail API

919

Might be

JAXB

 

Java API for XML Binding

   

JAXP

1.4

Java API for XML Parsing

206

 

JAX-RS

2.0

Java API for RESTful Services

339

Y

JAX-WS

1.3

Java API for XML –based Web Services including SOAP and WSDL

224

 

JCA

1.7

J2EE Connector Architecture

?

 

JCache

1.0

Temporary Caching API for Java EE

107

Maybe

JMS

2.0

Java Message Service

343

 

JPA

2.1

Java Persistence API

338

Y

JSF

2.2

Java Server Faces

344

Y

JSON

1.0

JavaScript Serialization Object Notation Protocol

353

Maybe

JSP

2.3

Java Server Pages

?

Y

JSPD

1.0

Java Server Pages Debugging

?

Y

JSTL

1.2

Java Standard Template Library

?

Y

JTA

1.2

Java Transaction API

   

Managed Beans

1.0

Managed Beans 1.1

342?

Y

Servlet

3.1

Java Servlet

340

Y

Web Services

1.3

 

224

 

Web Services Metadata

2.1

     

 

Are these the correctly numbered JSRs? Are you involved with the newest of these JSRs? If so can you give a definite answer?