Bug 55376

Summary: org.apache.tools.ant.launch.Locator.getClassSource not working with JBoss VFS
Product: Ant Reporter: mleneveut <mleneveut>
Component: CoreAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 1.9.4   
Target Milestone: ---   
Hardware: PC   
OS: All   

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