在JBoss 7.1.1上将JAR部署为模块 [英] Deploy JAR as a module on JBoss 7.1.1

查看:61
本文介绍了在JBoss 7.1.1上将JAR部署为模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用在jboss上部署的jar作为模块时遇到问题.

I have a problem using deployed jars on jboss as modules.

我知道我应该通过以下方式创建全局模块:创建JBOSS_HOME/modules的子文件夹,复制jar并创建module.xml文件,但是在这里

I know that I should create a global module by: creating a subfolder of JBOSS_HOME/modules, copy the jar and create the module.xml file, but here http://blog.tier2consulting.com/2013/04/02/understanding-modules-in-jboss-enterprise-application-platform-6/ and, more officially, here https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/chap-Class_Loading_and_Modules.html, I read, verbatim,

Dynamic Modules are created and loaded by the application server for each JAR or WAR deployment (or subdeployment in an EAR). The name of a dynamic module is derived from the name of the deployed archive.

仍然,当部署JAR时,我只能在JBOSS日志文件中看到:

Still, when I deploy my JAR, I can only see in the JBOSS log file:

16:06:18,698 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "Test.jar" 16:06:18,964 INFO [org.jboss.as.server] (HttpManagementService-threads - 14) JBAS018559: Deployed "Test.jar"

16:06:18,698 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "Test.jar" 16:06:18,964 INFO [org.jboss.as.server] (HttpManagementService-threads - 14) JBAS018559: Deployed "Test.jar"

在我链接的第一个站点上的示例的日志文件中,还有一行,即:

while in the log file of the example on the first site I linked, there is one more line, i.e.:

Register module: Module "deployment.utils.jar:main" from Service Module Loader

它仅在EAP 6上可用吗?还是在JBOSS AS 7.1.1-Final或JBOSS AS 7.1.1-Final上也有可能获得这种结果,您不得不使用文件夹JBOSS_HOME/modules?

Is it something available only on EAP 6 or is it possible to achieve such a result also on JBOSS AS 7.1.1-Final or on JBOSS AS 7.1.1-Final you're compelled to use the folder JBOSS_HOME/modules?

推荐答案

确定.我只是想通了. JBOSS AS 7.1.1-Final并未写任何有关作为模块进行部署的内容,但确实将其作为模块进行了部署. 要将其作为依赖关系引用到另一个项目中,必须在MANIFEST.MF文件中添加Dependencies: deployment.Test.jar,即,就像引用全局模块时一样,但要在前面加上deployment并将整个档案名称用作模块名称

OK. I just figured it out. JBOSS AS 7.1.1-Final just doesn't write anything about deployment as a module, but it does is deployed as a module. To reference it as a dependence in another project, in the MANIFEST.MF file you have to add Dependencies: deployment.Test.jar, i.e. just like when you reference a global module, but pre-pending deployment and using the entire archive name as module name.

部署的jar不需要任何特定的MANIFEST文件,也不需要嵌入module.xml文件.

The deployed jar doesn't need to have any particular MANIFEST file neither it needs to embed a module.xml file.

这篇关于在JBoss 7.1.1上将JAR部署为模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆