RESTAssured tutorial

This tutorial discusses about RESTAssured, a Testing framework that is used by several frameworks (including Quarkus) to test specifically REST applications. REST Assured is a Java API that can be used to validate RESTful services through its fluent DSL (Domain specific Languages) that describes a connection to an HTTP endpoint and expected results. Here is … Read more

Running any Docker image on Openshift

In this tutorial we will learn how to run a Docker image, built from a Dockerfile, on Openshift. So our starting point will be a simple Dockerfile definition which pulls the default “WildFly” image and adds some customizations to it. In our case, it simply adds a management user: FROM jboss/wildfly RUN /opt/jboss/wildfly/bin/add-user.sh admin Password1! … Read more

How to handle Fault Tolerance in your Enterprise applications and Microservices

Microprofile fault tolerance specification is a way for your application to handle the unavailability of a service by using a set of different policies. In this tutorial we will see how we can apply these policies in an application that can be run in Thorntail runtime. Thorntail is a Microprofile compliant environment, therefore you can … Read more

JBoss JMS Topic example

The following article shows how to create a simple JMS Topic using WildFly and older versions of JBoss application server. Creating a JMS Topic with WildFly If you want to create a new Topic, the command to be executed from the CLI is the following one: [standalone@localhost:9990 /] jms-topic add –topic-address=jms.topic.DemoTopic –entries=java:/jms/topic/demoTopic The following topic … Read more

How to map a BLOB field with JPA?

@javax.persistence.Lob can be used to specify that the annotated field should be represented as BLOB (binary data) in the DataBase. A Lob may be either a binary or character type. Common use of @Lob is to annotate a HashMap field inside your Entity to store some of the object properties which are not mapped into … Read more

How to bind the EntityManager in JNDI?

By default the persistence unit are available in the java: Context. If you wish to make them available also in the global naming Context you have to add two properties to your persistence.xml configuration file: jboss.entity.manager.jndi.name gives you a transaction scoped entity manager you can interact with jboss.entity.manager.factory.jndi.name binds the entity manager factory into global … Read more

How to call a stored procedure from Hibernate / JPA?

Let’s learn how to invoke a Stored Procedure from Hibernate and JPA applications. Supposing you have the following Oracle Stored procedure: CREATE FUNCTION agenda RETURN SYS_REFCURSOR AS my_cursor SYS_REFCURSOR; BEGIN OPEN my_cursor FOR SELECT id,person_name,person_surname,person_address FROM Person; RETURN my_cursor; END; Invoking it from Hibernate requires mapping the Stored Procedure in the Person class. <sql-query name=”SP_agenda” … Read more

Securing a MicroProfile application with Keycloak

In this tutorial we will learn how to secure a Microprofile application running with Thorntail runtime and Keycloak.   Keycloak is an Identity and Access Management Server for Modern Applications and Services. In this tutorial we will learn how to delegate a bash Web application authentication (running on WildFly) to a KeyCloak server. First of … Read more

Hibernate tutorial for Eclipse Developers

This is a tutorial about creating a Java application using Hibernate ORM, Eclipse and MySQL Database. Hibernate is an object/relational mapping tool for Java environments. What does it mean the term object/relational mapping? simply a technique of mapping a data representation from an object model to a relational data model with a SQL-based schema. Setting … Read more

How to invoke a Maven plugin from the Command Line?

In this short tech tip, we will learn how to call a Maven plugin from the Command Line (i.e. a Plugin which is not included in your pom.xml file) With maven, you normally invoke plugin’s goals in this way: mvn myplugin:myGoal  so, for example, if you have declared the WildFly Maven plugin in your configuration: … Read more