VFS and directory handling
alesj May 27, 2008 4:18 AMAnother VFS issue I stumbled upon.
I guess this was there for quite some time, we just never deployed things in this way to see it. :-)
The issue is that when I deploy an artifact that contains persistence.xml as exploded jar, this is what I get:
2008-05-23 18:08:35,578 DEBUG [org.hibernate.ejb.packaging.AbstractJarVisitor] (HDScanner) Searching mapped entities in jar/par: vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-5.0.0.CR1/server/default/deploy/service-test.jar/ 2008-05-23 18:08:35,578 WARN [org.hibernate.ejb.packaging.InputStreamZippedJarVisitor] (HDScanner) Unable to find file (ignored): vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-5.0.0.CR1/server/default/deploy/service-test.jar/ java.io.FileNotFoundException: C:\projects\jboss5\trunk\build\output\jboss-5.0.0.CR1\server\default\deploy\service-test.jar (Access is denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:106) at java.net.URL.openStream(URL.java:1007) at org.jboss.virtual.plugins.context.AbstractURLHandler.openStream(AbstractURLHandler.java:131) at org.jboss.virtual.VirtualFile.openStream(VirtualFile.java:216) at org.jboss.virtual.plugins.vfs.VirtualFileURLConnection.getInputStream(VirtualFileURLConnection.java:117) at java.net.URL.openStream(URL.java:1007) at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:38) at org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:139) at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287) at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:614) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:360) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:280)
Response from HEM team:
"emmanuel" wrote:
You guys do not expose a directory as a directory.
So the alternative is to go read the InputStream. I don't see why VFS could not expose a directory as an InputStream (just like a zip file does). What else can I "assume"?
The proper solution is a real integration with VFS but I lack time at the moment.
No to blame them.
But I guess we're gonna see a lot of this eventaully.
So, this needs more generic solution, which doesn't expect all external libs to adopt VFS.