Bug 55376 - org.apache.tools.ant.launch.Locator.getClassSource not working with JBoss VFS
Summary: org.apache.tools.ant.launch.Locator.getClassSource not working with JBoss VFS
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.9.4
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2013-08-07 08:54 UTC by mleneveut
Modified: 2018-06-18 22:39 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description mleneveut 2013-08-07 08:54:59 UTC
This code works well under Tomcat 7 :

File sourceJar = Locator.getClassSource(getClass());

But under JBoss AS 7, it returns null.

This is due to Jboss returning vfs:/pathToFile/myClass.class instead of file:/...

The method Locator.getResourceSource is not handling vfs prefix.
Comment 1 Stefan Bodewig 2013-12-31 13:52:54 UTC
I don't have any idea how JBoss VFS works but guess simply assuming vfs: was the same as file: is way too naive.  Unless anybody who knows enough about JBoss VFS steps in and provides us with the necesary information I don't see how we can "fix" it.  TBH I'm not even sure there will be a way to create a proper File instance from a VFS URI at all.
Comment 2 Gintas Grigelionis 2018-06-18 22:39:13 UTC
Upstream issue https://issues.jboss.org/browse/JBVFS-147