在jBoss AS 7中展开WAR或EAR文件 [英] Expand WAR or EAR files in jBoss AS 7

查看:127
本文介绍了在jBoss AS 7中展开WAR或EAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Web服务项目部署到jBoss AS7中,并且一切正常,除了jBoss不会扩展我的WAR或EAR文件.

I'm deploying a WebService project into a jBoss AS7, and everything goes OK except that jBoss doesn't expand my WAR or EAR file.

已经尝试将文件复制到"jboss-as-7.1.0.Final \ standalone \ deployments"文件夹并使用WebConsole,但是在两种情况下结果都是相同的.

Already tried copying the file to the "jboss-as-7.1.0.Final\standalone\deployments" folder and using the WebConsole, but in both cases the result was the same.

如果我从Eclipse内部署,一切运行正常.

If I deploy from within Eclipse everything runs OK.

我需要它来扩展我的文件,因为在应用程序初始化中,我扫描了类 目录中寻找使用反射实例化的正确类.

I need it to expand my file because in the application initialization I scan the class directories looking for the correct class to instantiate using reflection.

不知道这是jBoss AS 7还是jBoss AS系列的特殊情况,因为我已经使用过WebSphere和jBoss Web,并且它们都扩展了文件.

EDIT : Don't know if this a particular situation with jBoss AS 7 or with the jBoss AS family, because I already used WebSphere and jBoss Web and both of them expanded the files.

添加了具有执行路径的System.out

EDIT2 : Added a System.out with the execution path

MyClass.class.getProtectionDomain().getCodeSource().getLocation().getPath();

并返回以下路径

C:\jboss-as-7.1.0.Final\bin\content\ServerEAR.ear\Server.war\WEB-INF\classes

女巫不存在.因此,我搜索了班级名称并在以下位置找到了它

witch doesn't exist. So I did a search for the class name and fount it at

C:\jboss-as-7.1.0.Final\standalone\tmp\vfs\deployment5a9e98d5c43716c3\Server.war-e31a657d2bc3bd0f\WEB-INF\classes\r30

是否可以强制JBoss将文件提取到部署文件夹?或者如何在运行时获取上一个路径.

Isn't it possible to force JBoss to extract the files to the deployment folder? Or how can I get the previous path at run time.

推荐答案

已经忘记了这个问题,所以这是我解决它的方法:

Had forgotten about this question, so this is the way that I solved it:

public String getRealFilePath(String aFilePath) throws Exception
{
    org.jboss.vfs.VirtualFile vFile = org.jboss.vfs.VFS.getChild(aFilePath);
    URI fileNameDecodedTmp = org.jboss.vfs.VFSUtils.getPhysicalURI(vFile);

    path = fileNameDecodedTmp.getPath();
    System.out.println(path);
    return path;
}

所以在运行时,我只需要使用原始问题值调用getRealFilePath()即可解决问题;)

So at runtime I just need to call getRealFilePath() with the original question values, and problem solved ;)

这篇关于在jBoss AS 7中展开WAR或EAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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