Snoop 1.0.0 Released

Snoop..what…?

An explanation may be in order. Snoop is an experimental open source discovery service for Java EE that I created as a demo for my presentation at JavaLand earlier this year. After that I have developed it a little further and now I deem it good enough to be showcased more publicly.

The artifacts are published in Maven Central and has the following coordinates:

<dependency>
   <groupId>eu.agilejava</groupId>
   <artifactId>snoop</artifactId>
   <version>1.0.0</version>
</dependency>
<dependency>
   <groupId>eu.agilejava</groupId>
   <artifactId>snoop-client</artifactId>
   <version>1.0.0</version>
</dependency>

The Snoop Service is also available in Maven Central and for convenience available as a Docker image.

$ docker run -it -p 8081:8080 ivargrimstad/snoop-service:1.0.0

The GitHub project contains the source code as well as more documentation.

https://github.com/ivargrimstad/snoop

Tech Tip – Running Glassfish Nightly Builds in NetBeans

If you have tried adding a recent nightly build of GlassFish 4.1 to the server configurations in NetBeans, you may have come across the following problem:

glassfish-netbeans-error

The solution is as follows:

cd glassfish4/glassfish/lib/install/applications/__admingui/WEB-INF/lib/
mv console-core-4.2-SNAPSHOT.jar console-4.1.jar

This deficiency of the NetBeans server plugin is covered by Bug #250165

An update from JSR 371 (MVC 1.0)

The work in the Expert Group for JSR 371 progresses and here is a small update. A couple of decisions have been made and the most important one is that the JSR will be layered on top of JAX-RS. The decision was made by voting between this and the alternative of layering it on top of the Servlet API.

What this means for you as a developer is that the stuff you are familiar with from JAX-RS is directly transferable to MVC. As you can see in the simple example below, the only thing that differs from JAX-RS is the @Controller and @View annotations.

Note that this code is highly experimental and will most likely change as the work with the specification continues.

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import javax.mvc.Controller;
import javax.mvc.View;

@Path("count")
public class CountController {

   @GET
   @Controller
   @Produces("text/html")
   @Path("{id}")
   @View("counter.jsp")
   public void view(@PathParam("id") String id) {
   }
}

A more complete example with a little more details can be found at https://github.com/ivargrimstad/mvc-samples. I will continue evolving this example as we go.

The latest versions of the spec and reference implementation can be found here:

Docker is Everywhere

Here is a blog post I posted on my blog at Cybercom.

If I should mention one topic that has been more or less on everybody’s lips at every conference I have attended in 2014, it would be Docker. I do not think I have ever seen a technology that has been embraced by so many so fast before.

So what is Docker then?

In short, it is a platform for building, shipping and running applications using containerization.

Read more about it at https://www.docker.com/whatisdocker/

Here are a couple of examples:

Get ubuntu images from Docker Hub:

$ docker pull ubuntu

Starting a container running Ubuntu 14.04 is as easy as this:

$ docker run -it ubuntu/14.04 /bin/bash

Deploying an application in a container running Wildfly on Ubuntu can be done by creating a Dockerfile similar to this (ivargrimstad/ubuntu-wildfly is a Docker image I have uploaded to my repository at Docker Hub (https://hub.docker.com/u/ivargrimstad/):

FROM ivargrimstad/ubuntu-wildfly
ADD ./app.war /opt/jboss/wildfly/standalone/deployments/app.war

Build the image:

$ docker build --rm -t myapp .

And run the application on port 80:

$ docker run -it -p 80:8080 myapp

These were just a couple of easy examples to get you startet. Try the Docker tutorial at https://www.docker.com/tryit/ to try it out without installing anything locally.

 

A Little Status Update

My schedule for the upcoming months are beginning to fill up as a result of submitting talks to a lot of CFPs during summer. The scheduled talks so far are:

There are still some room, so if you are organizing a conference and need talks to fill up, feel free to contact me. My profile on Lanyrd is kept updated at all time.

But first of all I am going to JavaOne! This year as an attendee, so it is all about networking, community building and interesting technical sessions and keynotes.

nbjavaone_icon_125_2014