-
1. Re: Wrong file path (*/jboss-as-web-7.0.1.Final/bin/content/...)
gistarbird Sep 21, 2011 9:32 PM (in response to gistarbird)I copy mywar.war to JBOSS_HOME/standalone/deployments
I used all kinds of methods to get the path of my own file, but all are failed!
It always refer to JBOSS_HOME/bin/content/mywar.war/WEB-INF/lib/myjar.jar.
-
2. Re: Wrong file path (*/jboss-as-web-7.0.1.Final/bin/content/...)
tichon007 Jun 21, 2012 5:17 AM (in response to gistarbird)Hello,
I got the same problem.
When i try to deploy my ear i got for each jar contain into EAR_ROOT/lib the message :
14:55:49,960 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry hibernate-validator-4.2.0.Final.jar in "/C:/Program Files (x86)/JBoss/jboss-as-7.1.1.Final/bin/content/ner-ear-4.0.5-SNAPSHOT.ear" does not point to a valid jar for a Class-Path reference.
But there is nothing into content my ear is into the deployment folder.
Other issue is when i search a jar path using : URL url = LibraryLog.class.getResource(""); the url is wrong because refer to a jar contain into the bin/content folder wich do not exist.
Any help will be apreciate.
Thanks
-
3. Re: Wrong file path (*/jboss-as-web-7.0.1.Final/bin/content/...)
martsecurit Jul 5, 2012 4:11 AM (in response to gistarbird)Hello.
I have exactly the same issue with AS 7.1.1 final. Did you find a solution?
I have a file here: EAR/WAR/WEB_INF/classes/myfile.xml
And reference it llike this:
getClass().getClassLoader().getResource("/help_layout.xml")
JBOSS then says it cannot find a file here:
vfs:/C:/jboss-7.1.1/bin/content/ear/war/WEB-INF/classes/myfile.xml
There is no bin/content directory.
Thanks for reading.
-
4. Re: Wrong file path (*/jboss-as-web-7.0.1.Final/bin/content/...)
hai_feng Jun 5, 2014 11:17 PM (in response to gistarbird)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;
}
So at runtime I just need to call getRealFilePath() with the original path, and problem solved