Custom application context or name in Jboss or Wildfly
Tech-Today

Custom application context or name in Jboss or Wildfly


As far as I know there are 3 ways to deploy an application in JBoss or Wildfly with a custom application context name.

1.) By adding jboss-web.xml in your web project WEB-INF folder;
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/</context-root>
</jboss-web>

2.) Adding application.xml in your ear's META-INF folder:
<?xml version="1.0" encoding="UTF-8"?>
<application version="5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd">
<module>
<ejb>czetsuya-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>czetsuya.war</web-uri>
<context-root>/</context-root>
</web>
</module>
</application>

3.) In your ear's pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>${version.ear.plugin}</version>
<configuration>
<!-- Tell Maven we are using Java EE 6 -->
<version>6</version>
<!-- Use Java EE ear libraries as needed. Java EE ear libraries are
in easy way to package any libraries needed in the ear, and automatically
have any modules (EJB-JARs and WARs) use them -->
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>

<webModule>
<groupId>com.kbs</groupId>
<artifactId>czetsuya-web</artifactId>
<contextRoot>/</contextRoot>
</webModule>

</modules>
<fileNameMapping>no-version</fileNameMapping>
</configuration>
</plugin>




- Wildfly Server Provisioning Elastic Search Integration
I'm interested and would like to evaluate the integration of Elasticsearch to hibernate-search. I'm using the Wildfly container, however, Wildfly's hibernate-search library is a bit outdated: 5.5.8. so I need to find a way to outdate the jars...

- How To Generate Jax-rs Documentation Using Maven
To generate the jax-rs documentation automatically using maven, we need to add some plugins in the build section of the project's pom file. To avoid running this plugin every time you invoke mvn install, you can create a separate profile for it. Here's...

- How To Setup Seam3-security In Jboss 7
Recently, I've done some research on several Java Security Framework that can perform authentication, authorization and cryptography. I've worked with Apache Shiro, it's really good and complete but I've found several problems like there's...

- Using Ejb3.1 As The Backing Bean For Jsf Using Cdi (jsr-330)
This tutorial assumes that you already have knowledge on EJB, JSF, maven and injection. These are the steps as well as the code I use to make it work. 1.) Create 2 maven projects (web, ejb - has HelloBean class) 2.) 2.) In the web part we need to create...

- How To Add Pmd Reporting To Maven
Before proceeding to this exercise, you may want to try my tutorial on how to setup a maven project to eclipse: http://czetsuya-tech.blogspot.com/2012/04/how-to-create-modularized-maven-project.html. Assuming you have follow the tutorial above, you should...



Tech-Today








.