Modules detailed configuration of the JBoss EAP 6 Series six public module for the jar configuration to JBoss

Source: Internet
Author: User
Tags jboss

Problems encountered and to be solved in the company project


1: In principle, in addition to their own code, the public jar should not be packaged in the ear, so the package is too large, also does not conform to the layered logic, inside the JBoss container, each ear of the packet repeat jar will be transferred to the internal JBoss, resulting in a waste of excessive server resources, An occasional exception occurs.

2:jboss EAP 6.* Series, requires a modular configuration, requires a loaded jar, and solves how to configure in JBoss

3: The common jar is already configured in JBoss, loading ... However, when the source code is running, the path of the jar cannot be loaded according to MAVEN's configuration.

First Step: Configure the module


Configure MySQL and Oracle driver mode, details see my blog is not duplicated

http://blog.csdn.net/lishehe/article/details/43069361

We now extract the relevant spring public jars, Shiro, etc. into the JBoss module, and in our own JBoss modules module, add the configuration of the relevant jar



Step Two: Need to add the dependency of the War\core\parent Pom file on each line to the jar

<scope>provided</scope>


This means that we will load the jar when we are developing and compiling it, and will not break into the inner ear package when we pack it, but automatically load it through the jar provided by the container.

As follows

War Modification
<dependency><groupid>org.springframework</groupid><artifactid>spring-webmvc</ Artifactid><scope>provided</scope></dependency><dependency><groupid> Commons-lang</groupid><artifactid>commons-lang</artifactid><version>2.6</version ><scope>provided</scope></dependency><dependency><groupid>org.apache.shiro </groupId><artifactId>shiro-cas</artifactId><version>${shiro.version}</version> <scope>provided</scope></dependency><dependency><groupid>net.sf.ehcache</ Groupid><artifactid>ehcache-core</artifactid><version>${ehcache.version}</version> <scope>provided</scope></dependency><dependency><groupid>org.jasig.cas.client </groupid><artifactid>cas-client-core</artifactid><version>${cas.version}</version ><scope>provided</scope>&lT;/dependency><dependency><groupid>commons-fileupload</groupid><artifactid> Commons-fileupload</artifactid><version>1.3.1</version><scope>provided</scope> </dependency>

The parent Pom file for each system, after modifying the team leader remember to deploy a copy


<dependency><groupid>org.hibernate</groupid><artifactid>hibernate-core</artifactid ><version>${hibernate.version}</version> <scope>provided</scope></dependency> <dependency><groupid>org.codehaus.jackson</groupid><artifactid>jackson-mapper-asl</ artifactid><version>1.9.13</version><scope>provided</scope></dependency>< Dependency><groupid>org.springframework</groupid><artifactid>spring-webmvc</artifactid ><version>${spring.version}</version> <scope>provided</scope></dependency>< Dependency><groupid>javax</groupid><artifactid>javaee-api</artifactid><version >${javaee-api.version}</version><scope>provided</scope></dependency>

Step three: Add the load configuration to the path of the jar package in the ear, modify the jboss-deployment-structure.xml in the ear

<?xml version= "1.0" encoding= "UTF-8"? ><jboss-deployment-structure><sub-deployment name= " Itoo-authority-role-web-0.0.1-snapshot.war "><dependencies><module name=" Org.jboss.xnio "/>< Module name= "Org.apache.shiro" ><imports><include path= "meta-inf**"/><include path= "org**"/> </imports></module><module name= "org.jasig.cas.client" ><imports><include path= " meta-inf** "/><include path=" org** "/></imports></module><module name=" Org.springframework.data "><imports><include path=" meta-inf** "/><include path=" org** "/></ Imports></module><module name= "Org.crazycake" ><imports><include path= "META-INF**"/> <include path= "org**"/></imports></module><module name= "Commons-fileupload" ><imports ><include path= "meta-inf**"/><include path= "org**"/></imports></module><module name = "Org.codehaus.jacksoN "><imports><include path=" meta-inf** "/><include path=" org** "/></imports></module ><module name= "redis.clients" ><imports><include path= "meta-inf**"/><include path= "org**"/ ></imports></module><module name= "Org.apache.commons.commons-pool2" ><imports>< Include path= "meta-inf**"/><include path= "org**"/></imports></module><module name= " Org.springframework "><imports><include path=" meta-inf** "/><include path=" org** "/></ Imports></module></dependencies></sub-deployment></jboss-deployment-structure>

Fourth Step

In this case, most of our public jars will not be penetrated into the ear packet, and now the test ear will be around 6M after we have integrated it.



Summarize

The whole problem-solving process, more is to find English materials and documents, believe that the solution to the problem is more than difficult ...

Modules detailed configuration of the JBoss EAP 6 Series six public module for the jar configuration to JBoss

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.