How to configure MDB properties dynamically

A simple and effective way to configure the MDB properties dynamically with JBoss EAP and WildFly is via System Properties. All you have to do is coding your MDB Properties and then enable Property replacement: import java.util.logging.Logger; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; @MessageDriven(name = “HelloWorldQueueMDB”, activationConfig = { … Read more

EJB Annotations cheatsheet for JBoss AS or WildFly

There is a vast number of annotations you can use when running EJB applications, spanning from Cache configuration to Clustering and Security. Let’s see them more in detail in this tutorial. Dependency required to build projects using jboss.ejb3 annotations First of all, in order to be able to compile projects using @org.jboss.ejb3 annotations you need … Read more

Using Spring CXF descriptors in WildFly

In some cases, users might still want to consume Spring cxf.xml descriptors. On client side, in order to do that, the Spring libraries need to be available in the current thread classloader. For the Web Services stack to have correct visibility over Spring classes, the Spring libraries need to be properly installed in a specific … Read more

Web services deployment descriptor: jboss-webservices.xml

For those willing to configure a given Web Services endpoint deployment without adding a compile time dependency to WildFly (or Apache CXF) specific classes, the jboss-webservices.xml descriptor can be also used. It needs to be placed either in WEB-INF or META-INF folder of the deployment (depending on it being a war or jar archive) and … Read more

Using Axis Web Services with JBoss

Apache Axis is an implementation of the SOAP (“Simple Object Access Protocol”). This project has been decommissioned in favor of Apache CXF, therefore it is highly recommended that you migrate your Axis Web services to Apache CXF. If you need to use Axis Web services in a recent JBoss EAP / WildFly application, you should … Read more

JSF validation tutorial

Data validation is a key element of every application and JSF makes no exception to it. In this tutorial we will introduce the basic concepts of JSF validation using the validation options available since JSF 2.0.

Read more

Categories JSF

Testing JPA out of a container

One of the main reasons Enterprise JavaBeans (EJB) has been neglected in recent years is because EJB components can’t be easily unit tested. Fortunately, the EJB 3.0 spec greatly changes the programming model make EJB—primarily entities—usable and testable outside the container. Since we need the EJB 3.0 persistence layer we can use Hibernate or Toplink implementation: for  … Read more

Custom pool configuration for your EJBs on JBoss AS 7/WildFly

Stateless session beans are held in a pool which can be configured at EJB Container level. You can define as many pool configuration as you want and then decide which one to use for your EJB container. One thing which if often requested is to apply some specific settings for a particular EJB. With JBoss … Read more

Reading properties in EJB

One of the most compelling needs of applications is to read initialization properties. If your application is EJB-centric, then a very simple strategy is to read the properties from a File and store them in an EJB Singleton. Here is how to do it. At first here is how our application looks like: DemoApp.war | … Read more

Faces Flow tutorial

This tutorial discusses about Faces Flow which is an addition to Java Server Faces 2.2, included in the Java EE 7 stack. Faces Flow has been inspired by the popular Spring Flow framework and as such it is not intended to be a replacement for the Web application navigation system; rather Faces Flow can be … Read more

Categories JSF