On Aug 14, 2008, at 7:24 AM, wschreck wrote:

Caused by: java.lang.RuntimeException: error trying to scan <jar- file>: file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3- service/target/classes/
        at
org .hibernate .ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:635)
        at
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java: 350)
        at
org .hibernate .ejb .HibernatePersistence .createContainerEntityManagerFactory(HibernatePersistence.java:126)
        at
org .apache .openejb .assembler .classic .PersistenceBuilder .createEntityManagerFactory(PersistenceBuilder.java:183)
        at
org .apache .openejb .assembler.classic.Assembler.createApplication(Assembler.java:454)
        ... 34 more
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: Das
System kann den angegebenen Pfad nicht finden
at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java: 74)
        at
org .jboss .util .file .FileProtocolArchiveBrowserFactory .create(FileProtocolArchiveBrowserFactory.java:48) at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:64)
        at
org .hibernate .ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:626)
        ... 38 more
Caused by: java.util.zip.ZipException: Das System kann den angegebenen Pfad
nicht finden
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:203)
        at java.util.jar.JarFile.<init>(JarFile.java:132)
        at java.util.jar.JarFile.<init>(JarFile.java:97)
at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java: 69)
        ... 41 more

Hibernate seems to have an issue with the URL. It seems to be trying to scan for annotations and running into trouble with the URL. I did some experimenting with our hibernate example and things worked fine with spaces in the path, so I'm not sure if that's it. Hibernate also seemed to be trying to read your target/classes/ directory as a jar file, which definitely isn't right. I did some experimenting with that and it seems to handle <jar-file> entries which are jars or directories just fine, so that rules that out.

It was definitely easy to get that error out of hibernate but only if the path did not genuinely exist.

I successfully tried the following <jar-file> formats with hibernate:

  <jar-file>myapp/</jar-file>
  <jar-file>myapp.jar</jar-file>
  <jar-file>my app.jar</jar-file>
  <jar-file>my%20app.jar</jar-file>
  <jar-file>../../../my app/</jar-file>
  <jar-file>../../../my%20app/</jar-file>

Just couldn't seem to break it unless I gave a path that didn't exist.

Try and browse to "file:///D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/ " in your web browser as a quick way to validate the path.

-David

Reply via email to