Adam Bien's Weblog

Monday Sep 29, 2014

JavaOne 2014--The Zero Day

  1. More attendees than last year
  2. More sponsors, exhibition hall is packed
  3. 500 sessions--content is really good (I'm going to spend 14h a day at the conference attending sessions)
  4. NetBeans session Free Java Tools for Maven and Java EE [UGF8872] was full. I couldn't even get in as speaker first.
  5. Attendees are eager to ask questions and participate. Because of this, there was no time for lunch. TooManyQuestionsBetweenSessionsException
  6. GlassFish / JavaEE party was bigger than ever before--a nice opportunity to continue the conversation

The only problem is: Keynotes became a bit boring. Java is open source and the JCP open what makes "breaking news" impossible :-).


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Friday Sep 26, 2014

afterburner 1.6.1 Released

A small fix release this time:

  1. Demon threads are used for asynchronous view loading. (Thanks to: https://github.com/ennerf for the contribution)
  2. Per-view injection does not interfere any more with the regular model and service injection (bug fix)

Update your dependencies to:


<dependency>
	<groupId>com.airhacks</groupId>
	<artifactId>afterburner.fx</artifactId>
	<version>1.6.1</version>
</dependency>


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Tuesday Sep 23, 2014

The Most Popular Microservice (Is Written In Java)

One of the most popular microservice is Jenkins CI:

  1. Jenkins was initially created by a very small team (Kohsuke Kawaguchi)
  2. Jenkins plays well with other services like GitHub, SVN, Git using HTTP and REST-like APIs. In fact Jenkins is very popular in non-Java environments.
  3. The state is managed by each Jenkins instance individually in an own repository (JENKINS_HOME)
  4. Services are exposed via Remote API
  5. The UI is self-contained
  6. Jenkins can be easily extended by an independent team
  7. Jenkins is already packaged as a micro service: just launch the service with java -jar jenkins.war

However, I bet Kohsuke didn't knew the term "microservice" as he initially developed Hudson :-).

See you at Java EE Workshops at Munich Airport, Terminal 2 or on demand and in a location very near you: airhacks.io.


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Monday Sep 22, 2014

JavaOne, JUG, Q&As and Airhacking--Free Events, Sessions and Workshops

At JavaOne I'm speaking at the following sessions:

  1. Java EE 8 Community Update and Panel [CON2131] details / preenroll
  2. Productive JavaFX 8 [CON2265] details / preenroll
  3. Enterprise Nashorn [CON2266] details / preenroll
  4. Unorthodox Enterprise Practices [CON2301] details / preenroll
  5. Free Java Tools for Maven and Java EE [UGF8872] details / preenroll

All the sessions above have already around 100 pre-enrolled attendees. Hurry up, in the last years most of the sessions were full and only a few were repeated.

  1. Free event: 6th October, 6 P.M CET: 7th Airhacks Questions & Answers: With JavaOne coverage details / subscribe
  2. Free event: 16th October, 5.30 PM CET: Timisoara JUG Session: Hacking Opinionated JavaFX / Java 8 Apps details / subscribe

Special events at Airport Munich:

  1. 13th October, Munich Airport Java 8 with Java EE 7 workshop
  2. 14th October, Munich Airport Testing and Code Quality

Both workshops will take place--they are already well attended.

8th December - 12th December, Airport Munich: From Zero to Java EE with HTML 5--the "traditional" workshop series--already well attended.


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Friday Sep 19, 2014

#2 NetBeans Rocks: Maven, Ant, HTML 5 Support

Disclaimer: No additional plugins or custom configuration were used in this screencast :-)


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Thursday Sep 18, 2014

TomEE PluME--Like GlassFish But With Commercial Support

TomEE 1.7.1 Plus with Mojarra and EclipseLink (PLUME) feels like GlassFish 3 (Java EE 7 is not supported yet by TomEE), but comes with commercial support.

TomEE 1.7.1 PLuME is regular TomEE plus with Mojarra and EclipseLink.

I just deployed some JAX-RS, EJB 3, CDI, JSF, JPA (EclipseLink) applications developed on GlassFish to TomEE PluME and it worked without any modifications. TomEE works well with NetBeans 8+ -- just add an existing instance as a Tomcat server and you will be able to deploy straight from NetBeans.

The great story about Java EE is: when one vendor loses its commercial interests, several others (WLP, WildFly) can easily step in. The vendor lock-in is minimal.

See you at Java EE Workshops at Munich Airport (Terminal 2) or on demand and in a location very near you: airhacks.io!


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Monday Sep 15, 2014

Unit / Integration Testing the Bean Validation (JSR-303)

First you will need to load both: the Bean Validation and EL SPIs. Hibernate Validator is the Reference Implementation (RI) for Bean Validation, and GlassFish implements the EL JSR:


	   <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.1.2.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.el</artifactId>
            <version>3.0.0</version>
            <scope>test</scope>
        </dependency>

Hibernate Validator requires Expression Language dependency. Without the javax.el dependency you will get the following error:


Caused by: javax.validation.ValidationException: HV000183: Unable to load 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath
	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.(ResourceBundleMessageInterpolator.java:172)
	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.(ResourceBundleMessageInterpolator.java:118)

Now you are ready to launch your Integration Test:


import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;

public class ValidationTest {

    private Validator validator;

    @Before
    public void init() {

        ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
        this.validator = vf.getValidator();

    }

    @Test
    public void prereqsMet() {
        Workshop validWorkshop = new Workshop(2, 2, true, 3);
        Set<ConstraintViolation<Workshop>> violations = this.validator.validate(validWorkshop);
        assertTrue(violations.isEmpty());
    }  
}

Strictly speaking it is not a unit test, rather an Integration Test. In Unit Test you would like to test the validator logic only, without any dependencies to the SPI.

See you at Java EE Workshops at MUC Airport, especially at the Java EE 7 / Java 8 Testing day!


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Saturday Sep 13, 2014

Java EE Maven Archetype (BCE / ECB) v0.0.4 - EntityManager Mocking and System Test

The 0.0.4 version of Java EE Maven Archetype comes with JPA EntityManager mocking example and dedicated JAX-RS system tests.

Execute the javaee-bce-archetype archetype from the command line and choose version v0.0.4 to create a sample Java EE project with Boundary / Control / Entity (BCE) structure, unit-, integration-, stress-, and system tested:


mvn archetype:generate -Dfilter=com.airhacks:javaee-bce-archetype

The sources of the sample project are also available directly: https://github.com/AdamBien/javaee-bce-pom.

Thanks Dirk Franssen for the pull request!

See you at Java EE / HTML 5 workshops at Airport Munich and each first Monday of the month at 6 P.M. (CET) airhacks.io


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Friday Sep 12, 2014

WildFly, Bower, Karma, RequireJS or NetBeans 8.0.1

NetBeans IDE 8.0.1 is available for download and contains:

  1. Modularity and enterprise features for JavaScript via RequireJS
  2. Support for debugging JavaScript files with Karma
  3. Node.JS and Bower modules can be installed directly within the IDE
  4. Grunt tasks available in the popup menu for web projects
  5. Built-in support for: GlassFish 4.1, Tomcat 8.0.9, WildFly, and WebLogic 12.1.3
  6. Latest PrimeFaces framework bundled in the IDE
  7. GIT and Java tools improvement

All the features above are available without any additional plugin :-)

See the entire feature list.


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

Thursday Sep 11, 2014

HTML5, WebSockets and Java EE 7 -- Screencast

A simplest possible example for HTML - Java EE 7 communication using WebSockets.

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at Munich's Airport, particularly at the Java EE User Interfaces or / and Java EE 7 and HTML 5 workshops!


Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014

A book about rethinking Java EE Patterns

realworldpatterns.com
...the last 150 posts
...the last 10 comments
Links
License