EJB Inheritance is Different From Java Inheritance

Despite the fact that EJB inheritance sometimes uses Java inheritance – they’re not always the same. Just as you could read in my previous post, EJB doesn’t have to implement any interface to expose a business interface. The other way around is also true – just because EJB is implementing some interface or extending other EJB doesn’t mean it exposes all or any of its views. Let’s say we want to have some basic EJB exposing remote business interface....

March 21, 2013 · 4 min

Using JGroups Directly From JBoss AS 7 Component

UPDATE (5.08.2013) – I’ve updated this post to support JBoss EAP 6.1 Final (JBoss AS 7.2). Enjoy UPDATE (2.09.2013) – Bela Ban pointed to his very interesting post about new ForkChannel feature and easy channel hijacking directly from JBoss AS / Infinispan. Read about it here JGroups is Bela Ban’s piece of software for reliable message exchange that is highly configurable and can use either TCP or UDP as a transport protocol....

February 24, 2013 · 5 min

Enabling Java EE Security in OpenShift Application

By default few of the security features are turned off in OpenShift JBoss 7.1 cartridge. If you want to use the Java EE security features first you need to define your security roles and constraints in your deployment descriptor, e.g. web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app> // ... <security-role> <role-name>admin</role-name> </security-role> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/admin/login.xhtml</form-login-page> <form-error-page>/admin/login.xhtml?error=1</form-error-page> </form-login-config> </login-config> <security-constraint> <web-resource-collection> <web-resource-name>Modify questions section</web-resource-name> <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint> </web-app> (I’ve omitted the logging form source code as it’s not the main point here....

September 29, 2012 · 2 min

Arquillian, ShrinkWrap and archive filename

When you create a deployment using Arquillian (great test runner for testing your Java EE code in the container of your choice: jBoss, Glassfish, OpenEJB, … either in embedded, managed or remote mode) remember that the name of the deployment archive file is the exact filename that will be executed in the container. It does make a difference if you use *.war or *.jar for your deployment, so beware the following construct if it’s not exactly what you intended to do:...

June 13, 2011 · 1 min

More than one -exec in find

I was trying to execute several commands on a single record found by the GNU/Linux find command. The first attempt was to create something like: find . -name "*.pdf" -exec echo 'test' && echo 'test2' \; But it’s not the way the find command works. If you want to execute more than one command for each hit, you should use multiple -exec actions: find . -name "*.pdf" -exec echo 'test' \; -exec echo 'test2' \; I used this feature to list JAR files in a specified location along with classes they consist of:...

April 24, 2011 · 1 min