How to deploy to JBoss EAP 7 with Gradle, Cargo, and Jenkins

It took me quite a while to get my Java EE 7 application automatically deployed to a target JBoss EAP 7 server from within Jenkins using Gradle as the build tool and Cargo for managing the deployment. So here’s my final solution for you to use! 😉 build.gradle dependencies { classpath ‘com.bmuschko:gradle-cargo-plugin:2.2.3’ } apply plugin: … Read moreHow to deploy to JBoss EAP 7 with Gradle, Cargo, and Jenkins

Mastering the Generational Change in Software AG’s Natural

Software AG recorded a video with us on how we cope with the generational change that takes place in the Natural developer community. How do you handle the problem of aging Natural developers? I’d love to hear your comments on that! By the way, I’ll be talking about modern Natural development at IUG 2017! See … Read moreMastering the Generational Change in Software AG’s Natural

Exception-like error handling in Software AG’s Natural

Error handling in Software AG’s Natural can be done in a way that resembles Exception handling in object-oriented languages like Java. throw Instead of throwing an Exception, you raise an error simply by assigning a value to the system variable *ERROR-NR. As soon as a statement like the following is executed, the current program flow … Read moreException-like error handling in Software AG’s Natural

Automatically reconnect to a database after a failure in JBoss EAP 7

My JBoss EAP 7 server couldn’t cope with a failing database. After a database restart or failure, e.g. due to maintenance, it simply would not connect to the database again automatically. The application simply stopped working as soon as the database was unavailable for a short period of time. JBoss’s server.log was full of (not … Read moreAutomatically reconnect to a database after a failure in JBoss EAP 7

How to find the physical file path of the current FUSER of a Natural runtime

Here’s a short subroutine for reading the physical file path of the current FUSER of a Natural (from Software AG) runtime. I’m not sure if it works on a mainframe, but it definitely runs on a Linux system. The subroutine returns the following information, if it runs successfully: P-FUSER-PATH /home/macke/fuser P-RC 0 Otherwise the return … Read moreHow to find the physical file path of the current FUSER of a Natural runtime

How to combine/join file paths in Gradle/Groovy

One might think that joining (or combining) two file paths together with Groovy would be an easy thing to do. I’m used to “nice” methods from Ruby like File.join (see How to do a safe join pathname in ruby?): File.join(“path”, “to”, “join”) As it turns out, there is no such method in Groovy. However, here … Read moreHow to combine/join file paths in Gradle/Groovy

How to use an existing access token to authenticate against the Google API in Ruby

After a few hours of trial and error and finally getting authentication against Google’s API working in Ruby I think it’s time for a blog post 😉 I had a simple (at least I thought it was simple) requirement: Reading the people in a user’s Google+ circles with Ruby. Because I use OmniAuth in my … Read moreHow to use an existing access token to authenticate against the Google API in Ruby

How to enable access logging (accesslog) in JBoss EAP 7

Configuring JBoss EAP 7 to write an access log (e.g. like Apache webserver) is quite easy with the CLI: /subsystem=undertow/server=default-server/host=default-host/setting=access-log:add If you need any additional configuration, take a look at this: Wildfly 10.0.0.Final Model Reference. For example, to change the prefix of the log’s file name: /subsystem=undertow/server=default-server/host=default-host/setting=access-log:write-attribute(name=prefix, value=”my_access”) Alternatively, you could change the configuration in … Read moreHow to enable access logging (accesslog) in JBoss EAP 7

How to seed the database with sample data for an Arquillian test

Arquillian makes it easy to test your Java EE application on a real server. However, if you deploy an application, that uses a database to perform its tasks, how do you make sure a database with test entries is available on the target server? If you set up a “real” database on the server, the … Read moreHow to seed the database with sample data for an Arquillian test

How to test a REST API with Arquillian

Testing a REST API on a real application server with Arquillian is easy – if you know what you need to do 😉 I have this simple REST service, that authenticates a user: @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response authenticateUser(final UserData userData) { … return Response .status(401) .entity(false) .build(); } Let’s write a test for this … Read moreHow to test a REST API with Arquillian