简体   繁体   English

如何使用模块向Wildfly Application Server添加库?

[英]How to add libraries to Wildfly Application Server using module?

I want to load the Application server Libraries in Java Build Path in Eclipse, 我想在Eclipse的Java Build Path中加载Application Server库,

I have 5 applications in Eclipse which shares common libraries, I can't put all the libraries in each project lib folder, so i want to add the libraries in Wildfly Application server using modules. 我在Eclipse中有5个共享公用库的应用程序,我不能将所有库都放在每个项目的lib文件夹中,所以我想使用模块在Wildfly Application Server中添加这些库。

This is my module.xml file add added the lib at WILDFLY_HOME/modules/system/layers/base/com/mysql/main/mysql-connector-java-5.1.23-bin.jar 这是我的module.xml文件,它在WILDFLY_HOME/modules/system/layers/base/com/mysql/main/mysql-connector-java-5.1.23-bin.jar添加了lib

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
    <resources>
        <resource-root path="mysql-connector-java-5.1.23-bin.jar" />
    </resources>
    <dependencies>
        <module name="javax.api" />
        <module name="javax.transaction.api" />
    </dependencies>
</module>

After Restarting the server, this module is not loading in Eclipse Build path. 重新启动服务器后,此模块未在Eclipse构建路径中加载。
Can any one knows what wrong with this modules ? 有人知道这个模块有什么问题吗?
In Wildfly I have some predefined modules, those are loading in build path successfully, but user-defined modules are not loading ? 在Wildfly中,我有一些预定义的模块,这些模块已成功加载到构建路径中,但是用户定义的模块未加载?
Why ? 为什么呢

Solution found: 找到解决方案:

Follow below steps : 请按照以下步骤操作:

Go To Eclipse > preferences > Server > Runtime Environments > Default Classpath Entries 转到Eclipse>首选项>服务器>运行时环境>默认类路径条目

Select "Wildfly 8.x Runtime" and add a module 选择“ Wildfly 8.x运行时”并添加一个模块

and click on apply, now rebuild your application and check, 并点击“应用”,现在重建您的应用并检查,

the library will be added in buildpath by module name. 该库将通过模块名称添加到buildpath中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 CLI 将具有多个资源的模块添加到 WildFly - How to add module with multiple resources to WildFly using CLI 如何使用Eclipse停止Wildfly 8.2.1最终服务器上的应用程序-Java - How to stop application on Wildfly 8.2.1 final server using Eclipse - Java 将WildFly Application Server插件添加到NetBeans - Add plugin for WildFly Application Server to NetBeans 如何在正在运行的Wildfly服务器上自动更新模块? - How to automatically update a module on a running Wildfly Server? 使用HTTP管理API的wildfly10添加模块 - wildfly10 add module using HTTP managment API 如何将https-listener添加到WildFly的默认服务器? - How to add https-listener to WildFly's default-server? 谁能详细指导如何使用SSL加密通过Wildfly 10应用程序服务器连接到AWS RDS MySql实例 - Can anybody please guide in detail how to connect to an AWS RDS MySql instance via Wildfly 10 application server using SSL encryption 从应用程序隔离的WildFly9 JASPI模块 - WildFly9 JASPI Module Isolated from Application Wildfly如何删除邮件等模块 - Wildfly how to remove module such as Mail 如何使用ProcessBuilder将EAR文件部署到wildfly服务器? - How to deploy an EAR file to wildfly server using ProcessBuilder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM