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” /> <formatter> <pattern-formatter pattern=”%d{HH:mm:ss,SSS} %-5p [%c] (%F:%L) %s%E%n” /> </formatter> </console-handler> <logger category=”pm.mbo” use-parent-handlers=”false”> <level name=”DEBUG”

Make your webapplication log debug messages under jboss Read More »

Create instance of javax.validation.Validator manually

To bootstrap javax.validation.Validator you can simply use the following code: final ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); final Validator validator = factory.getValidator(); For further information documentation see for version 5.1 http://docs.jboss.org/hibernate/validator/5.1/reference/en-US/html/chapter-bootstrapping.html#section-retrieving-validator-factory-validator for version 4.3 http://docs.jboss.org/hibernate/validator/4.3/reference/en-US/html/validator-bootstrapping.html#section-validator-instance

Create instance of javax.validation.Validator manually Read More »

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.

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