java.io.FileNotFoundException: C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied)

Hibernate JIRA | Michał Kostrzewa | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Hi, Max from user list kindly redirected me to fill a bug here. Here it goes as I described it on list. I didn't attached a test case b/c doing it is non-trivial, maybe you'll just know what is the problem and I provided a patch that works for me. But if test case is needed - I'll do it. -------------- I'm having problems with bundling hibernate and my ejb model in eclipse RCP application. I managed to solve all classloading problems but one, related to InputStreamZippedJarVisitor class. Simplifying things I have: hibernate plugin which registers itself for buddy classloading policy dbmodel plugin which depends on hibernate and is a buddy of hibernate application plugin which depends on hibernate and dbmodel and is a buddy of hibernate. This application plugin has hibernate.cfg.xml in self. When I run this project from eclipse IDE, all is fine except the warning message in logs while creating EntityManager: 2006-10-20 09:07:23 org.hibernate.ejb.packaging.InputStreamZippedJarVisitor doProcessElements WARNING: Unable to find file (ignored): bundleresource://101 java.io.FileNotFoundException: C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.eclipse.osgi.framework.util.SecureAction.getFileInputStream(SecureAction.java:99) at org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry.getInputStream(FileBundleEntry.java:50) at org.eclipse.osgi.framework.internal.core.BundleURLConnection.connect(BundleURLConnection.java:53) at org.eclipse.osgi.framework.internal.core.BundleURLConnection.getInputStream(BundleURLConnection.java:99) at java.net.URL.openStream(URL.java:1007) at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33) at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:215) at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:253) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:229) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) at com.pentacomp.dicom.viewer.ViewerContstants.createEntityManager(ViewerContstants.java:170) at com.pentacomp.dicom.viewer.DicomViewerMainFrame$InitRepositoriesTask.call(DicomViewerMainFrame.java:146) I suppose hibernate tries to inspect the model jar for some reason, but in IDE this jar location is resolved to directory containing the plugin. But things get worse when I export the project into java webstart application. I'm getting NullPointerException instead of warning in the same place. I investigated the source and the problem is here: protected void doProcessElements() throws IOException { JarInputStream jis; try { jis = new JarInputStream( jarUrl.openStream() ); } catch (IOException ze) { log.warn( "Unable to find file (ignored): " + jarUrl, ze ); return; } The jarUrl is a bundleresource:// url which resolves to DirZipBundleEntry which in turn returns null in getInputStream(). Thus JarInputStream thows NPE. Here's what I've tried to solve this: - configure the dbmodel to be unpacked or packed after install - tried dbmodel with jar inside or with unpacked classes inside - set hibernate.archive.autodetection to 'none'. (I did it passing parameters map to createEntityManager method) - change the hibernate sources and replace IOException with Exception in doProcessElement method. This one worked I guess most likely I did something wrong to my deploy - any ideas please? But if not, perhaps such a change in code may make hibernate more robust (?) Hibernate version: 3.2.0 GA best regards, Michal Kostrzewa

    Hibernate JIRA | 1 decade ago | Michał Kostrzewa
    java.io.FileNotFoundException: C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied)
  2. 0

    Hi, Max from user list kindly redirected me to fill a bug here. Here it goes as I described it on list. I didn't attached a test case b/c doing it is non-trivial, maybe you'll just know what is the problem and I provided a patch that works for me. But if test case is needed - I'll do it. -------------- I'm having problems with bundling hibernate and my ejb model in eclipse RCP application. I managed to solve all classloading problems but one, related to InputStreamZippedJarVisitor class. Simplifying things I have: hibernate plugin which registers itself for buddy classloading policy dbmodel plugin which depends on hibernate and is a buddy of hibernate application plugin which depends on hibernate and dbmodel and is a buddy of hibernate. This application plugin has hibernate.cfg.xml in self. When I run this project from eclipse IDE, all is fine except the warning message in logs while creating EntityManager: 2006-10-20 09:07:23 org.hibernate.ejb.packaging.InputStreamZippedJarVisitor doProcessElements WARNING: Unable to find file (ignored): bundleresource://101 java.io.FileNotFoundException: C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.eclipse.osgi.framework.util.SecureAction.getFileInputStream(SecureAction.java:99) at org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry.getInputStream(FileBundleEntry.java:50) at org.eclipse.osgi.framework.internal.core.BundleURLConnection.connect(BundleURLConnection.java:53) at org.eclipse.osgi.framework.internal.core.BundleURLConnection.getInputStream(BundleURLConnection.java:99) at java.net.URL.openStream(URL.java:1007) at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33) at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:215) at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:253) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:229) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51) at com.pentacomp.dicom.viewer.ViewerContstants.createEntityManager(ViewerContstants.java:170) at com.pentacomp.dicom.viewer.DicomViewerMainFrame$InitRepositoriesTask.call(DicomViewerMainFrame.java:146) I suppose hibernate tries to inspect the model jar for some reason, but in IDE this jar location is resolved to directory containing the plugin. But things get worse when I export the project into java webstart application. I'm getting NullPointerException instead of warning in the same place. I investigated the source and the problem is here: protected void doProcessElements() throws IOException { JarInputStream jis; try { jis = new JarInputStream( jarUrl.openStream() ); } catch (IOException ze) { log.warn( "Unable to find file (ignored): " + jarUrl, ze ); return; } The jarUrl is a bundleresource:// url which resolves to DirZipBundleEntry which in turn returns null in getInputStream(). Thus JarInputStream thows NPE. Here's what I've tried to solve this: - configure the dbmodel to be unpacked or packed after install - tried dbmodel with jar inside or with unpacked classes inside - set hibernate.archive.autodetection to 'none'. (I did it passing parameters map to createEntityManager method) - change the hibernate sources and replace IOException with Exception in doProcessElement method. This one worked I guess most likely I did something wrong to my deploy - any ideas please? But if not, perhaps such a change in code may make hibernate more robust (?) Hibernate version: 3.2.0 GA best regards, Michal Kostrzewa

    Hibernate JIRA | 1 decade ago | Michał Kostrzewa
    java.io.FileNotFoundException: C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied)
  3. 0

    TypeHandler Scanning is not working in an Eclipse/OSGI environment

    GitHub | 3 years ago | tkvangorder
    java.io.FileNotFoundException: D:\devel_V3.0.X\java\Framework\classes\com\landacorp\lib\persistence (Access is denied)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [EJB-283] Ejb3Configuration can't read Jar file OC4J - Hibernate JIRA

    atlassian.net | 2 years ago
    java.io.FileNotFoundException: D:\workspace32\net.enbw.etg.soa.repository.ui\target\classes\ (Das System kann den angegebenen Pfad nicht finden)
  6. 0

    [hibernate-issues] [Hibernate-JIRA] Commented: (EJB-283) Ejb3Configuration can't read Jar file OC4J

    jboss.org | 2 years ago
    java.io.FileNotFoundException: D:\workspace32\net.enbw.etg.soa.repository.ui\target\classes\ (Das System kann den angegebenen Pfad nicht finden)

  1. linxiaolong 1 times, last 6 days ago
  2. rp 1 times, last 7 days ago
  3. jstrayer 1 times, last 1 week ago
  4. marcbouvierdav 15 times, last 4 weeks ago
  5. tyson925 9 times, last 1 month ago
54 more registered users
41 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.FileNotFoundException

    C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied)

    at java.io.FileInputStream.open()
  2. Java RT
    FileInputStream.<init>
    1. java.io.FileInputStream.open(Native Method)
    2. java.io.FileInputStream.<init>(FileInputStream.java:106)
    2 frames
  3. Eclipse OSGi
    SecureAction.getFileInputStream
    1. org.eclipse.osgi.framework.util.SecureAction.getFileInputStream(SecureAction.java:99)
    1 frame
  4. Eclipse OSGi
    BundleURLConnection.getInputStream
    1. org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry.getInputStream(FileBundleEntry.java:50)
    2. org.eclipse.osgi.framework.internal.core.BundleURLConnection.connect(BundleURLConnection.java:53)
    3. org.eclipse.osgi.framework.internal.core.BundleURLConnection.getInputStream(BundleURLConnection.java:99)
    3 frames
  5. Java RT
    URL.openStream
    1. java.net.URL.openStream(URL.java:1007)
    1 frame
  6. Hibernate EJB
    HibernatePersistence.createEntityManagerFactory
    1. org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33)
    2. org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:215)
    3. org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:253)
    4. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:229)
    5. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
    5 frames
  7. JavaEE 7
    Persistence.createEntityManagerFactory
    1. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
    1 frame
  8. com.pentacomp.dicom
    DicomViewerMainFrame$InitRepositoriesTask.call
    1. com.pentacomp.dicom.viewer.ViewerContstants.createEntityManager(ViewerContstants.java:170)
    2. com.pentacomp.dicom.viewer.DicomViewerMainFrame$InitRepositoriesTask.call(DicomViewerMainFrame.java:146)
    2 frames