-
1. Re: How to convert vfs protocol to file protocol.
guinotphil May 2, 2012 10:51 AM (in response to nick.sree)You may not be able to do this. A VFS resource can refer to something within a JAR, WAR file, etc..
Do you really need to create a File instance... In many cases, URL.openStream() is okay...
-
2. Re: How to convert vfs protocol to file protocol.
alesj May 2, 2012 11:26 AM (in response to nick.sree)Like guinotphil says, vfs url might not point to File instance, it's impl detail.
If you really need a File, then you will probably have to hack this via AS extension / deployment unit processor.
But, as already suggested, stream normally does the trick.
-
3. Re: How to convert vfs protocol to file protocol.
nick.sree May 3, 2012 1:53 AM (in response to alesj)vfs is not supported by some of the framework's api, so we need to have some mechanism to convert vfs to file protocol. I'm not so convinced using openStream or openConnection to make this work done, do you know any other tweak.
-
4. Re: How to convert vfs protocol to file protocol.
guinotphil May 3, 2012 5:27 AM (in response to nick.sree)I had this kind of issue with a couple of libs as well.
For one of them, which I had the source, I recompiled it to accept the configuration as a stream instead of a file.
For the other one, I did not had the source, so I had to deploy the files outsite of the EAR. Then the directory of those files is passed to the server as a system property in standalone.xml.
-
5. Re: How to convert vfs protocol to file protocol.
nick.sree May 4, 2012 4:13 AM (in response to guinotphil)Thanks for your suggestion.
Mainly we are getting this problem from struts2 framework. We can't modify the source for our purpose, since it may lead to problem while upgrading the framework. I dont think struts2 will work if we deploy it outside the EAR.
-
6. Re: How to convert vfs protocol to file protocol.
guinotphil May 4, 2012 4:22 AM (in response to nick.sree)Can you give more details about what Struts 2 tries to do ? The stracktrace or anything ? Thx
-
7. Re: How to convert vfs protocol to file protocol.
alesj May 4, 2012 4:32 AM (in response to nick.sree)vfs is not supported by some of the framework's api, so we need to have some mechanism to convert vfs to file protocol. I'm not so convinced using openStream or openConnection to make this work done, do you know any other tweak.
Sometimes (good) frameworks have resource lookup abstractions; e.g. Seam, Drools, Spring, ... have it
And for those we managed to get proper VFS based impl working.
Struts2 is widely adopted framework, hence it might have something similar?
-
8. Re: How to convert vfs protocol to file protocol.
nick.sree May 7, 2012 10:32 PM (in response to alesj)The bad part is that still struts2 latest is facing some problem in JBoss AS 5 and JBoss AS 7 in different OS... I have provided patch twice to get rid of this problem. But recent struts2 upgrades (fixes) broke those patches. Please see the below apache jira link.
https://issues.apache.org/jira/browse/WW-3803
https://issues.apache.org/jira/browse/WW-3662
after the above recent fix it broken for JBoss AS 5
https://issues.apache.org/jira/browse/WW-3810
There are lots more