Development

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”/> </virtual-server> Or with cli: /subsystem=web/virtual-server=default-host:write-attribute(name=enable-welcome-root,value=false)  

Disable welcome-root in EAP6 Read More »

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: <system-properties>   <property name=”org.apache.coyote.http11.Http11Protocol.SERVER” value=”foo”/> </system-properties> Or with cli: /system-property=org.apache.coyote.http11.Http11Protocol.SERVER:add(value=foo) Then your header just is Server: foo instead.

Change SERVER header in EAP6 Read More »

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”/> </virtual-server> <configuration> <jsp-configuration x-powered-by=”false”/> </configuration> </subsystem> Or with cli: /subsystem=web/configuration=jsp-configuration:write-attribute(name=x-powered-by,value=false) In a JSF application you have to add the following context param: <context-param>

Remove X_POWERED_BY Header in JBoss EAP6 Read More »

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 »

Eclipse Luna Performance

To speedup eclipse I first edited the eclipse.ini file to look like this (don’t just copy paste my file – compare it with yours): -vm /opt/jdk1.8/jre/lib/amd64/server/libjvm.so -startup plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar –launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140521-1744 -product org.eclipse.epp.package.jee.product –launcher.defaultAction openFile -showsplash org.eclipse.platform –launcher.defaultAction openFile –launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.7 -Xms60m -Xmx1024m -Xss2m -Xverify:none -Duser.name=mbo I removed lines setting MaxPermSize as this is deprecated in

Eclipse Luna Performance Read More »