Adding of external jar file into classpath for jBoss 7

泪湿孤枕 提交于 2019-12-05 21:57:08

There's a directory called modules where you can put your jars. But to know how to do that you should read this guide. You may also create a global module that is accessible to all deployments. Look at this doc.

No answer actually outlines exactly what to do here so here goes.

In your jboss-deployment-structure.xml file, which should be in webapp/WEB-INF you need to add the module reference :

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <dependencies>
            <module name="javaee.api">
                <imports>
                    <exclude path="org/apache/xml/security/**" />
                </imports>
            </module>
            <module name="com.sun.xml.bind" slot="main" />
            <module name="com.mycompany.mypackage" slot="1_0" />
            <module name="com.oracle.ojdbc14" slot="main" />    
        </dependencies>
    </deployment>
</jboss-deployment-structure>

then copy the jar file this dir :

C:\[JBoss-Home]\modules\com\mycompany\mypackage\1_0
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!