提供apache-shiro作为JBoss-7,WildFly-8的模块 [英] Supplying apache-shiro as a module for JBoss-7, WildFly-8

查看:180
本文介绍了提供apache-shiro作为JBoss-7,WildFly-8的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不幸的是,我为JBoss7(和WildFly8.0.0.Beta2)创建模块的尝试失败了,我看不到我犯的错误,我所做的是:

Unluckily my attempts in creating a module for JBoss7 (and WildFly8.0.0.Beta2) failed and I can't see the mistake I made, what I did was:

1.)在<wf-root>/modules/org/apache/shiro/main

2.)将文件shiro-core-1.2.2.jarshiro-ehcache-1.2.2.jarshiro-web-1.2.2.jar复制到其中

2.) Copying the files shiro-core-1.2.2.jar, shiro-ehcache-1.2.2.jar and shiro-web-1.2.2.jar into it

3.)创建一个名为module.xml的文件,其内容如下:

3.) Creating a file called module.xml with following contents:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.apache.shiro">  
    <resources>  
        <resource-root path="shiro-core-1.2.2.jar"/>  
        <resource-root path="shiro-ehcache-1.2.2.jar"/>  
        <resource-root path="shiro-web-1.2.2.jar"/>  
    </resources>
</module>

接下来,我启动了服务器.不幸的是,部署EAR文件需要shiro部署失败,并出现以下错误(摘要):

Next I started up my server. Unluckily deploying an EAR file, which requires shiro failed deploying with the following error (snipplet):

Caused by: java.lang.NoClassDefFoundError: org/apache/shiro/mgt/SecurityManager
    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_25]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:792) [rt.jar:1.7.0_25]
    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:345) [jboss-modules.jar:1.3.0.Final]
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:423) [jboss-modules.jar:1.3.0.Final]
    ... 31 more

有什么想法吗?

推荐答案

您只需在META-INF/MANIFEST.MF文件的主要部分中添加一行,就可以更简单,简洁地表示对自定义模块的依赖性:

You can express a dependency on your custom module more simply and succinctly merely by adding a single line to the main section of your META-INF/MANIFEST.MF file:

Dependencies: org.apache.shiro

有关更多信息,请参见: https://docs. jboss.org/author/display/WFLY8/Class+Loading+in+WildFly

For more information, see: https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly

这篇关于提供apache-shiro作为JBoss-7,WildFly-8的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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