Override logging in WildFly

You can use logback to configure logging in your application. You can’t use logback to configure logging for the server. To use logback in your configuration you’ll need to change the add-logging-api-dependencies to false or create a jboss-deployment-structure.xml that excludes the subsystem. You’ll also need to include logback and slf4j in your deployment. The first … Read more

SLF4J + Logback does not log in WildFly

WildFly adds slf4j as a default logging dependency Have you tried excluding the main implementation in jboss-deployment-structure.xml descriptor (It should go under the META-INF directory). This can be done with below lines: <?xml version=”1.0″ encoding=”UTF-8″?> <jboss-deployment-structure> <deployment> <exclusions> <module name=”org.apache.commons.logging” /> <module name=”org.apache.log4j” /> <module name=”org.jboss.logging” /> <module name=”org.jboss.logging.jul-to-slf4j-stub” /> <module name=”org.jboss.logmanager” /> <module name=”org.jboss.logmanager.log4j” … Read more

How do I Install JBoss AS / WildFly Server in Eclipse for Java EE

Install the most recent JBoss Tools. Go to Help > Install New Software. Set Work with to the following URL depending on Eclipse version: 4.8+ (Photon): https://download.jboss.org/jbosstools/photon/stable/updates/ 4.7 (Oxygen): http://download.jboss.org/jbosstools/oxygen/stable/updates/ 4.6 (Neon): https://download.jboss.org/jbosstools/neon/stable/updates/ 4.5 (Mars): http://download.jboss.org/jbosstools/mars/stable/updates/ 4.4 (Luna): http://download.jboss.org/jbosstools/updates/stable/luna/ 4.3 (Kepler): http://download.jboss.org/jbosstools/updates/stable/kepler/ 4.2 (Juno): http://download.jboss.org/jbosstools/updates/stable/juno/ 3.7 (Indigo): http://download.jboss.org/jbosstools/updates/stable/indigo/ 3.6 (Helios): http://download.jboss.org/jbosstools/updates/stable/helios/ Press Enter In the … Read more

How to configure Wildfly to serve static content (like images)?

Add another file handler and another location to the undertow subsystem in standalone.xml: <server name=”default-server”> <http-listener name=”default” socket-binding=”http”/> <host name=”default-host” alias=”localhost”> <location name=”https://stackoverflow.com/” handler=”welcome-content”/> <location name=”/img” handler=”images”/> </host> </server> <handlers> <file name=”welcome-content” path=”${jboss.home.dir}/welcome-content” directory-listing=”true”/> <file name=”images” path=”/var/images” directory-listing=”true”/> </handlers>

How to configure Jackson in Wildfly?

“How can I configure Jackson and its SerializationFeature in Wildfly?” You don’t need to configure it in Wildfly, you can configure it in the JAX-RS applciation. Just use a ContextResolver to configure the ObjectMapper (see more here). Something like @Provider public class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> { private final ObjectMapper mapper; public ObjectMapperContextResolver() { mapper = … Read more