Category Archives: JBoss

Remove H2 JDBC-Driver from EAP6

To remove the H2 JDBC-driver from your EAP6 simply remove the relevant part from your standalone.xml:

<driver name="h2" module="com.h2database.h2">

Or with cli:



Remove ExampleDS datasource in EAP6

To remove the ExampleDS datasource simply remove the relevant part from your standalone.xml:

<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

Or with cli:



Configure Aliases in EAP6

The default configuration states localhost and as aliases. To change this you have to simply change or remove the specific parts of your virtual-server config in your standalone.xml:

<virtual-server name="default-host" enable-welcome-root="false">
  <alias name="localhost"/>

This would only be a single alias with value localhost (and disabled welcome root).

Or to change it with cli:



Disable welcome-root in EAP6

To remove the default welcome page your have to change your virtual server config in your standalone.xml to state enable-welcome-root=”false”:

<virtual-server name="default-host" enable-welcome-root="false">
  <alias name="localhost"/>

Or with cli:



Change SERVER header in EAP6

I found no way to remove the Server header in EAP6. But there is a way to change its content. Just add the folling config to your standalone.xml:

  <property name="org.apache.coyote.http11.Http11Protocol.SERVER" value="foo"/>

Or with cli:


Then your header just is Server: foo instead.

Remove X_POWERED_BY Header in JBoss EAP6

First you have to disable it in standalone.xml by adding jsp-configuration x-powered-by=”false”. Here the relevant part of my config:

<subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">
  <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
  <virtual-server name="default-host" enable-welcome-root="false">
    <alias name="localhost"/>
    <jsp-configuration x-powered-by="false"/>

Or with cli:


In a JSF application you have to add the following context param:


Then start your server and the header should be gone.

Make your webapplication log debug messages under jboss

I often catch myself writing info-messages because jboss is configured to info-mode by default. By adding the following few lines you can make your application use debug mode:

<subsystem xmlns="urn:jboss:domain:logging:2.0">
  <!-- add begin -->
  <console-handler name="DEBUGCONSOLE">
    <level name="DEBUG" />
      <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%F:%L)  %s%E%n" />
  <logger category="pm.mbo" use-parent-handlers="false">
    <level name="DEBUG" />
      <handler name="DEBUGCONSOLE" />
  <!-- add end -->

Of course you have to change the category (your package name) in the logger. The snippet is from Wildfly 8.1. But it is the same approach for JBoss AS 7+.

Get rid of Wildfly/JBoss headers “Server” and “X-Powered-By”

If you don’t want to send these headers with every response you have to disable them in your configuration file (standalone.xml).

I just removed the following lines from my undertow subsystem (urn:jboss:domain:undertow:1.1):

<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
<response-header name="server-header" header-name="Server" header-value="WildFly/8"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>

After a server restart the headers were gone.

JBoss Login Configuration

Here a short example for a security-domain that has to be configured in the urn:jboss:domain:security subsystem:

<security-domain name="mysecuritydomain" cache-type="default">
    <login-module code="" flag="required">
      <module-option name="dsJndiName" value="java:jboss/datasources/ExampleDS" />
      <module-option name="principalsQuery" value="select u.password from users u where" />
      <module-option name="rolesQuery" value="select as rolename, 'Roles' as rolegroup from users u, roles r, users_roles ur where and and" />
      <module-option name="hashAlgorithm" value="SHA-256" />
      <module-option name="hashEncoding" value="base64" />
      <module-option name="hashCharset" value="UTF-8" />

To use the domain in your application here an example jboss-web.xml descriptor:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns=""

JBoss JDBC Module Creator

Every time I download a new jboss I have to add the needed jdbc module manually. And every time I have to look how the module.xml has to look like. So I decided to write a simple script that creates a module for PostgreSQL. with some configuration, it should be capable of creating every jdbc module you want. Just see the options it supports.

You can see my project at github:

Here some instructions how to run it with default options:

[codesyntax lang=”bash”]

git clone
cd jboss_module_creator