1 Reply Latest reply on Jun 2, 2015 5:32 AM by Raghavendra Kanakala

    How to replicate same shared library in jboss

    Raghavendra Kanakala Newbie

      I have a common library (JAR) that shouldn't be part of any application (EAR). I need to use runtime with the common JAR file with application. It is easy to do in web sphere through Admin console, could you any one help me to do in Jboss EAP 6.3.0.

        • 1. Re: How to replicate same shared library in jboss
          Raghavendra Kanakala Newbie

          Hi All,


          I have resolved this issue by doing following steps.

          Sample project Structure used as common shared library for JBoss EAP 6.3.0.









          │ SimpleUtil.java

          └───target SharedLib -ejb-client-1.0-SNAPSHOT.jar



          package com.techm.util;

          public class SimpleUtil {

          *public* String toString(){

          *return* "I am from SimpleUtil ";




          <?xml version= "1.0" encoding= "UTF-8"?>

          <project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">






          <name>SharedLib EJB client module</name>





















          GOTO "E:\Programs\EAP-6.3.0\jboss-eap-6.3\modules\system\layers\base " and create the folder " com\sharedlib\util\main\" Inside 'main' copy the shared library jar file " SharedLib -ejb-client-1.0-SNAPSHOT.jar " and then create a file module.xml with following content. Important make sure the package name consistent as given in project for ex: "package com.sharedlib.util" used for the file StringUtil.java make sure the dependency is added, this can be done using the command " mvn dependency:tree" inside the shared lib project. in this case it is executed inside " E:\DOCUMENTS\SHARED-EJB-CLIENT" and after the listing following dependency tag "org.jboss.as.logging" is added.


          <?xml version="1.0" encoding="UTF-8"?>

          <module xmlns="urn:jboss:module:1.1" name="com.sharedlib.util">


                     <property name="jboss.api" value="private"/>



                     <resource-root path="SharedLib-ejb-client-1.0-SNAPSHOT.jar"/>



                     <module name="org.jboss.as.logging"/>





          <subsystem xmlns="urn:jboss:domain:ee:1.2">


               <module name="com.techm.util" slot="main"/>






          I hope it will help. Please send private message if anybody want any clarification on this solution.