Path setting for DLL's in JBOSS 7.1.1

前端 未结 1 1513
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 06:03

We have some DLL\'s which are related to Java,VB. In Joss 4.X , We used to place in bin directory under Application Server.

We migrated to

相关标签:
1条回答
  • 2021-01-03 06:52

    Configure module.xml as below:

    <module xmlns="urn:jboss:module:1.1" name="com.correction">
        <resources>
            <resource-root path="xxx.jar"/>
            <resource-root path="xyz.jar"/>
            <resource-root path="lib/win-x86_64"/>
        </resources>
    
       <dependencies>
           <module name="sun.jdk"/>
        </dependencies>
    </module>
    

    Put the DLLs into the directory lib/win-x86_64. Check the another dependencies of your project.

    In WEB-INF of your application creating the file jboss-deployment-structure.xml and put the content below:

    <jboss-deployment-structure>
      <deployment>
         <dependencies>
            <module name="com.correction"/>
         </dependencies>
      </deployment>
    </jboss-deployment-structure>
    

    That's all.

    Another Question: How can you make these properties files accessible to applications deployed on JBoss 7?

    create a custom module where you put your properties files and put jboss-deployment-structure.xml to your application archive (WAR/EAR) to use that custom module.

    Create the new module directory under $JBOSS_HOME/modules(using app/conf in this example)

    mkdir -p $JBOSS_HOME/modules/app/conf/main/properties/
    

    Put your properties files in $JBOSS_HOME/modules/app/conf/main/properties/

    Create a module.xmlhere $JBOSS_HOME/modules/app/conf/main/module.xml

    <module xmlns="urn:jboss:module:1.1" name="app.conf">
       <resources>
          <resource-root path="properties"/>
       </resources>
    </module>
    

    put the following jboss-deployment-structure.xml in WEB-INF:

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-deployment-structure>
       <deployment>
          <dependencies>
                <module name="app.conf" />
       </dependencies>
       </deployment>
    </jboss-deployment-structure>
    

    Then you can access your properties files using thecode below (example assumes you have a example.propertiesfile in $JBOSS_HOME/modules/app/conf/main/properties/)

    Thread.currentThread().getContextClassLoader().getResource("example.properties");
    

    Ps: I used JBoss AS 7.1.2 ( JBoss EAP 6 )

    Regards Mauricio Magnani

    0 讨论(0)
提交回复
热议问题