WebLogic and Fusion Middleware Configuration Management using Chef and Puppet Webcast

Chef and Puppet are popular tools to manage WebLogic Server and other Fusion Middleware configurations. Share with your customers a brand-new video on demand that showcases how these popular assembly technologies can provide continuous, detailed configurations for WebLogic Server 12c.

See on demand video

Posted in Uncategorized

Publican

publican_logo

Documentation

We need to create some documentation for a project using DocBook, its nice if you are creating a large document with lots of different authors and input from several files (sources, messages, examples etc). Downside is its based on XML, so we are looking at Publican to help simply the job. Publican is used to produce all the docs for Red Hat linux and several other projects.

Publishing with DocBook XML

  • Books
  • Articles
  • Papers
  • Multi-volume sets

What is DocBook?

DocBook is a specification for technical documentation

  • It defines a markup language for creating books, articles, websites
  • Uses XML and XML tags
  • Presentation-neutral form
  • Publish in HTML, XHTML, PDF, ePub, man page

Links

User Guide

Posted in Books, Espalier

Experimenting with vSphere 5.5

Installing ESXi 5.5

HP Compaq 8200 Elite CMT PC
4 CPUs x 3.392 (i7-2600)
20GB RAM, 1TB Disk

ESXi Welcome Page

ESXi Welcome Page

vSphere Client 5.5

vSphere Client 5.5

vSphere Client 5.5

Managing vSphere from Mac OS X

Wanted to manage my new vSphere-environment from my Mac and not need to have a windows machine for the vSphere client

  • bad news is, the native OS-version client is only avaliable for windows…. no Mac, no Linux, no mobile..
  • and the good news, for most operations you can use the vSphere web client from Mac OS X but it only works with vCenter (so is not available when the vCenter server is down or you only have one ESXi server)

Usually the window vSphere client is needed at least once after installation of ESXi to import the vCenter Virtual Appliance or create a virtual machine (for windows and linux its also possible to import an appliance from the command line with VMware’s OVF Tool)

Access VM-consoles from Mac OS X with VMware Player

Once ESXi is up you can access the virtual machines running and also vCenter deployed as a virtual appliance with VMware Player. Its available for Windows, Linux and Mac OS X. VMware Player can connect to an ESXi using the command line:

vmplayer -h

This starts VMware Player to remote connect to an ESXi host (the IP address can also be given as a parameter to the -h command) using the normal credentials.

TODO: ADD IMAGE

Once logged in a list of available virtual machine is shown (they can also be powered on and a console to the VM opened). The vSphere Client can be used to manage the ESXi-host (in a windows VM of course…).

Using SSH and vCLI

The ESXi can also be partially managed using SSH (enabled first from the vSphere Client or from the Direct Console User Interface (DCUI) on the ESXi’s console). Once logged in using SSH the DCUI command can be used for configuration.

dcui

TODO: ADD DCUI IMAGE

And it will open the menu-based console (close it using ctrl-c). There also exists a vSphere Command Line interface (vCLI) for windows and linux for basic command line configuration and administration.

Posted in Virtualization

Cafe Babes and Java

Class files are identified by the following 4 byte header (in hexadecimal): CA FE BA BE (the first 4 entries in the table below). The history of this magic number was explained by James Gosling:

“We used to go to lunch at a place called St Michael’s Alley. According to local legend, in the deep dark past, the Grateful Dead used to perform there before they made it big. It was a pretty funky place that was definitely a Grateful Dead Kinda Place. When Jerry died, they even put up a little Buddhistesque shrine. When we used to go there, we referred to the place as Cafe Dead. Somewhere along the line it was noticed that this was a HEX number. I was re-vamping some file format code and needed a couple of magic numbers: one for the persistent object file, and one for classes. I used CAFEDEAD for the object file format, and in grepping for 4 character hex words that fit after “CAFE” (it seemed to be a good theme) I hit on BABE and decided to use it. At that time, it didn’t seem terribly important or destined to go anywhere but the trash-can of history. So CAFEBABE became the class file format, and CAFEDEAD was the persistent object format. But the persistent object facility went away, and along with it went the use of CAFEDEAD – it was eventually replaced by RMI.”

Posted in Java EE

Project Avatar

Thin Server Architecture

Project Avatar provides a JavaScript services layer zeroed in on supporting REST, WebSockets and Server-Sent Events, and a rich client side framework that assumes very minor JavaScript knowledge. The services side is focused on building data services using JavaScript, while the optional client side is entirely focused on supporting HTML5 and TSA (Thin Server Architecture).

Project Avatar

Project Avatar

With the introduction of HTML5, CSS3 and fast JavaScript engines, modern browsers have become a powerful platform. In the advent of the so called single-page application (SPA), also known as single-page interface (SPI) the design of modern user interfaces shifted away from server side generation to web applications or web sites that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application. An SPA moves logic from the server to the client. This results in the role of the web server evolving into a pure data API or web service.

This architectural approach has been coined Thin Server Architecture to indicate that complexity moved from the server to the client while reducing overall system complexity.

In addition to REST, Project Avatar also has built-in support for Server Sent Events (SSE), consisting of push services on the server side and push models on the client side.

var avatar = require("org/glassfish/avatar");
 
var message = 'The server time is ';
 
var getTime = function() {
    var current = new Date();
    return {
        msg: message,
        h: current.getHours(),
        m: current.getMinutes(),
        s: current.getSeconds() };
};
 
avatar.registerRestService({ url: "data/message" },
    function() {
        this.onPut = function(request, response) {
            message = request.data.msg;
            response.send(null);
        };
    }
);
 
avatar.registerPushService({ url: "push/time" },
    function() {
        this.onOpen = this.onTimeout = function(context) {
            context.setTimeout(1000);
            return context.sendMessage(getTime());
        };
    }
);

To communicate with this new push service, the client side needs a push model as well as some other changes to support updating the message.

<html>
    <head>...</head>
    <body>
        <script data-model="rest">
            var Message = function() {
                this.msg = '';
            };
        </script>
        <script data-model="push">
            var Time = function() {
                this.msg = this.h = this.m = this.s = '';
            };
        </script>
        <script data-type="Message" data-instance="message" data-url="data/message"></script>
        <script data-type="Time" data-instance="time" data-url="push/time"></script>
 
        <output class="time">#{time.msg}#{time.h}:#{time.m}:#{time.s}</output><br><br>
        <label for="im">New Message: </label>
        <input id="im" size="35" data-value="#{message.msg}"/>
        <button onclick="#{message.put()}">Update</button>
    </body>
</html>
Posted in Java EE, Mobile

Java EE 7 Simplifies Development

Java Platform, Enterprise Edition 7 (Java EE 7)

JSR-342 is the umbrella specification ties together the various subsystems which compose the platform, and provides additional integration support. The Java EE 7 platform added the following new APIs to previous version of the platform:

Also the following APIs have also been significantly updated to help simplify building enterprise applications with Java:

  • Java Message Service (2.0)
  • Contexts and Dependency Injection (1.1)
  • Java Persistence API (2.1)
  • Java Transaction API (1.2)
    Adds 2 important new features : @Transactional and @TransactionScoped
  • Java Server Faces (2.2)
  • Java API for RESTful Web Services (2.0)
  • Bean Validation (1.1)
  • Servlet (3.1)

Java Transaction API (1.2)

The new @Transactional annotation solve this by basically bringing the semantics of those EJB transaction attributes in managed beans without any dependencies on the EJB container. So the @Transactional annotation provides the ability to declaratively control transaction boundaries on managed beans. Under the hood, this capability is provided by a CDI interceptor that handle the necessary transaction plumbings (suspend, resume, commit, …). In a nutshell, @Transactional bring the ease of CMT transactions to various Java EE Components (Servlet, JAX-RS, etc.) without requiring to use EJBs.

The new @TransactionScoped annotation provides the ability to specify a standard CDI scope to define bean instances whose lifecycle is scoped to the currently active JTA transaction. This simple code driven post explain and demonstrate such a behaviour in action.

package com.espalier.javaee7.bean;
 
import java.util.Random;
 
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.transaction.TransactionScoped;
 
@TransactionScoped
public class TestTransactionalScopeBean 
              implements TestTransactionalScope {
 
  private static final long serialVersionUID = 1L;
  private long value;
 
  @PostConstruct
  private void init() {
    value = System.currentTimeMillis();
    System.out.println("TestTransactionalScopeBean initialized. Value is "
        + value);
  }
 
  @PreDestroy
  private void destroy() {
    System.out.println("TestTransactionalScopeBean destroyed. Value is "
        + value);
  }
 
  @Override
  public long getValue() {
    return value;
  }
}

Example Links

  • Cargo Tracker
    Applied domain-driven design blueprints for Java EE
  • Wildfly Quickstart
    Quickstarts demonstrate WildFly, Java EE 7 and a few additional technologies.
    They provide small, specific, working examples that can be used as a reference.

Implementation Links

Useful Links

Posted in Java EE, News, Training

Java Batch JobUtil

package com.espalier.jbatch.course.util;
 
import static org.junit.Assert.assertEquals;
 
import java.util.List;
import java.util.logging.Logger;
 
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.StepExecution;
 
public class JobUtil {
 
	private final static Logger LOG = BatLogger.TEST.getLogger();
 
	public static void waitForJobToComplete(final JobOperator jobOper, long executionId) throws Exception {
 
		loop: while (true) {
			JobExecution je = jobOper.getJobExecution(executionId);
			List<StepExecution> steps = jobOper.getStepExecutions(executionId);
 
			switch (je.getBatchStatus()) {
			case COMPLETED:
				assertEquals("Job batch status", BatchStatus.COMPLETED, je.getBatchStatus());
				assertEquals("exit status", "COMPLETED", je.getExitStatus());
				assertEquals("Steps executed", 1, steps.size());
				assertEquals("Step failed", BatchStatus.COMPLETED, steps.get(0).getBatchStatus());
				break loop;
 
			case ABANDONED:
			case FAILED:
				LOG.severe("Batch status " + je.getBatchStatus());
				break;
 
			default:
				LOG.info("Sleeping for 1 secs");
				Thread.sleep(1000);
			}
		}
	}
}
package com.espalier.jbatch.course.util;
 
import javax.batch.runtime.context.JobContext;
import javax.batch.runtime.context.StepContext;
 
public class ContextHelper {
 
	private ContextHelper() {
	}
 
	public static String getInfo(final JobContext jobContext) {
		if (null != jobContext) {
			StringBuilder builder = new StringBuilder(jobContext.getJobName());
			builder.append(" batchStatus = " + jobContext.getBatchStatus());
			builder.append(", executionId = " + jobContext.getExecutionId());
			builder.append(", exitStatus = " + jobContext.getExitStatus());
			builder.append(", instanceId = " + jobContext.getInstanceId());
			builder.append(", jobName = " + jobContext.getJobName());
			builder.append(", properties = " + jobContext.getProperties());
			builder.append(", transientUserData = " + jobContext.getTransientUserData());
 
			return builder.toString();
		}
 
		return "jobContext == null";
	}
 
	public static String getInfo(final StepContext stepContext) {
		if (null != stepContext) {
			StringBuilder builder = new StringBuilder(stepContext.getStepName());
			builder.append(" batchStatus = " + stepContext.getBatchStatus());
			builder.append(", executionId = " + stepContext.getStepExecutionId());
			builder.append(", exitStatus = " + stepContext.getException());
			builder.append(", instanceId = " + stepContext.getMetrics());
			builder.append(", jobName = " + stepContext.getPersistentUserData());
			builder.append(", properties = " + stepContext.getProperties());
			builder.append(", transientUserData = " + stepContext.getTransientUserData());
 
			return builder.toString();
		}
 
		return "stepContext == null";
	}
}
Posted in Code, Java EE

Payment Card Worldwide 2012 vs 2017

50443d7a-5b8c-11e3-ad29-12313d14bd6b-large

Posted in Payments

CDI Reloaded

CDI is available since EE6 and also with EE7 has evolved to version 1.1. CDI by many people is some kind of magic, though at the end it is only the assembly and usage of already known proxy features. The workshop provides hands on experience from writing and assembling simple beans, and then step by step extending the capabilities until adding portable extensions. Also differences, between running in a standalone environment (JSR 330) and an EE container (JSR 299) will be shown. The workshop will also make use of some of the public available extension libraries such as Apache Deltaspike or JBoss Seam. Finally also usage of CDI along with EE7 batches is shown.

At the end each participant should be ready to dive into the low level details of CDI mechanisms and implementations.

 

Posted in Code, Java EE

OOP2014: Introduction to JSR 352 Java Batch and Spring Batch

logo-sub-title
With the release of Java EE 7, batch processing was standardized and provided as a reference implementation based on the new specification “JSR 352 Java Batch”. The reference implementation of the JSR provides an implementation of JEE Batch integrated into Glassfish 4. In context of current legacy renewal and business transformation efforts, the ability to develop high-end, mission-critical batch jobs supporting extensive scalability and failure resiliency is essential for the success.

Until now Spring Batch addressed those characteristics in a flexible and extensive way. With JSR 352 the core concepts were now standardized. The talk will give an in-depth introduction to JSR 352 and Spring Batch providing a good foundation allowing architects to decide when to use JSR 352 or Spring Batch.

Come to OOP 2014 in Munich and see us presenting about Java JSR 352 and Spring Batch with examples.

Posted in Java EE