Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When and why would I need a jboss-deployment-structure.xml for a Spring application?

I am trying to understand how to use JBoss EAP6 with Spring applications. I have a sample OpenShift application and it contains a jboss-deployment-structure.xml file.

I found some documentation about this file, but I am not clear why and when one should use those files with Spring applications. The content is the following:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">    <deployment>        <dependencies>             <module name="com.h2database.h2"/>             <module name="org.codehaus.jackson.jackson-core-asl"/>             <module name="org.codehaus.jackson.jackson-mapper-asl"/>             <module name="org.slf4j"/>        </dependencies>    </deployment> </jboss-deployment-structure> 

Why does one need to declare dependencies to modules? And what are modules in the JBoss paradigm? Is it possible to live without this xml file?

like image 388
Jérôme Verstrynge Avatar asked Jan 29 '13 11:01

Jérôme Verstrynge


People also ask

What is the use of JBoss deployment structure XML?

JBoss Deployment Structure File xml is a JBoss specific deployment descriptor that can be used to control class loading in a fine grained manner. It should be placed in the top level deployment, in META-INF (or WEB-INF for web deployments). It can do the following: Prevent automatic dependencies from being added.

What is JBoss Web XML?

The jboss-web. xml is a file within your deployment's WEB-INF or META-INF directory. It contains configuration information about features the JBoss Web container adds to the Servlet 3.0 specification. Settings specific to the Servlet 3.0 specification are placed into web.

Where is module XML in JBoss?

Installing a module on WildFly / JBoss EAP requires creating a path under the JBOSS_HOME/modules folder. Under this path, you will install the JAR libraries which are part of the module and a module. xml file which describes the module itself and dependencies with other module. Within the module.

What is JBoss module?

JBoss Modules is designed to work with any existing library or application without changes, and its simple naming and resolution strategy is what makes that possible. Unlike OSGi, JBoss Modules does not implement a container; rather, it is a thin bootstrap wrapper for executing an application in a modular environment.


2 Answers

As long as you don't have any classloading problems with your application you don't need the jboss-deployment-structure.xml file. But once you have trouble of such kind the dependency management in jboss-deployment-structure.xml would be your friend.

The article Modularized Java with JBoss Modules explains what modules are very well.

I think in short you can say that everything that is deployed as WAR, JAR or EAR is a module. These modules are referred to as dynamic modules. Beside them there are static modules in $JBOSS_HOME/modules. The only difference is how they are packaged.

like image 122
Thomas Avatar answered Oct 11 '22 14:10

Thomas


This is what I found on the internet:

"In order to avoid using JBoss provided logging APIs, we need to place the following kind of “jboss-deployment-structure.xml” file inside “/home/userone/ApplicationLevelLog4jDemo/src” so that we can exclude the jboss logging APIs for our application and our application can use it’s own version of logging APIs."

Source: http://middlewaremagic.com/

like image 31
Alex Mi Avatar answered Oct 11 '22 13:10

Alex Mi