Kohei Nozaki's blog 

jberetweb, JBeret job repository viewer


Posted on Friday Jan 02, 2015 at 01:01AM in jberetweb


What are JBeret and jberetweb?

JBeret is the out-of-the-box JSR352 JBatch implementation of the WildFly application server. It manages its statuses of jobs and steps in several types of data storage, like RDBMS, which is called repository. But it has no management console or even a standardized way to see it efficiently (I've been watching the repository through SQL!). So, I have created jberetweb as a small web application which shows the JDBC job repository of JBeret.

jberetweb can be obtained at GitHub.

スクリーンショット 2015-01-01 23.31.18

What can be done with jberetweb?

It shows recent job executions with their names, the start/end time and the batch status on the table in the upper half of the page. These rows are clickable. Additional information, like job parameters and step executions, will be shown when any row of the job executions table is clicked. Execution exception data will be shown if the step has failed because an exception occurred. Any problematic rows, such as a failed execution or step, are highlighted. Thanks to JSF's partial rendering and Ajax, paging and operations are fast.

How do I install it?

As I described at README.md in GitHub repository of it, you have to clone and build it with mvn yourself, and some configuration is needed for WildFly before deploying the WAR.

  • Create a database on PostgreSQL (jberetweb should run on any other RDBMS, but I haven't tested yet)
  • Register a XA data source for the job repository
  • Register JNDI name of the JDBC job repository
  • Set the job repository type as JDBC
  • Define JSF project stage to JNDI
Configuration procedures with jboss-cli should be like this:
batch
xa-data-source add \
      --name=JBatchDS \
      --driver-name=postgresql \
      --jndi-name=java:jboss/jdbc/JBatchDS \
      --user-name=postgres \
      --password=***
/subsystem=datasources/xa-data-source="JBatchDS"/xa-datasource-properties=ServerName:add(value="localhost")
/subsystem=datasources/xa-data-source="JBatchDS"/xa-datasource-properties=PortNumber:add(value="5432")
/subsystem=datasources/xa-data-source="JBatchDS"/xa-datasource-properties=DatabaseName:add(value="jbatch")
run-batch
/subsystem=batch/job-repository=jdbc:write-attribute(name=jndi-name, value=java:jboss/jdbc/JBatchDS)
/subsystem=batch:write-attribute(name=job-repository-type, value=jdbc)
/subsystem=naming/binding=java\:\/env\/jsf\/ProjectStage:add(binding-type=simple,value=Development,class=java.lang.String)

NOTE:

  • JBeret creates the schema automatically if any tables aren't found, so make sure the database user can execute DDLs.
  • Use XA datasource for both the job repository and your application database.

Here's some related pointers:

I would be grateful for your feedback because it's my first software which is public on GitHub.


「わかりやすいJava EEウェブシステム入門」書評


Posted on Tuesday Dec 30, 2014 at 11:13PM in Technology


貴重な日本語のJava EE7入門書「わかりやすいJava EEウェブシステム入門」の書評.

Read More

650km car trip


Posted on Tuesday Dec 30, 2014 at 01:39PM in General


Feelings or random thoughts of a trip.

Read More

Two ultimate MMA fighters: Junior Dos Santos and Cain Velasquez


Posted on Monday Dec 29, 2014 at 11:14PM in General


About my favorite MMA fighters and their video.

Read More

JSFじゃんけん作った


Posted on Monday Dec 29, 2014 at 09:37PM in Technology


日本のJava開発者クラスタの間で若干流行っていた「じゃんけん」を作った話と,その考察.

Read More