-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Bug in ZippedJarVisitor?
PostPosted: Tue Sep 13, 2005 7:06 am 
Newbie

Joined: Tue Sep 13, 2005 5:14 am
Posts: 3
Hi!

As far as I can see, there seems to be some bug in ZippedJarVisitor in the distributed version of hibernate-entitymanager.jar beta2:
The extraction of the jarFileName in the constructor does not work under linux. I packaged a .par file inside an .ejb3 file, and when Hibernate tried to "visit" the par,
an exception occurred.

Code:
public ZippedJarVisitor(URL url, boolean detectClasses, boolean detectHbm) {
      this.detectClasses = detectClasses;
      this.detectHbm = detectHbm;
      String file = url.getFile();
      jarFileName = file.substring( "file:/".length(), file.length() - "!/META-INF/persistence.xml".length() );
      unqualify();
   }


"url" has as value something like "file:/home/...", so the created substring has no leading slash. On Windows, this is fine, but on linux this is interpreted as a relative path, causing the following exception:

Code:
java.util.zip.ZipException: No such file or directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:204)
        at java.util.jar.JarFile.<init>(JarFile.java:132)
        at java.util.jar.JarFile.<init>(JarFile.java:70)
        ...


I got this Exception with JBoss-4.0.2 in combination with JBoss EJB3 RC1, Java 1.5.0_04 and Suse 9.3, and when I patched the above to

jarFileName = file.substring( "file:".length(), file.length() - "!/META-INF/persistence.xml".length() );

the bug was gone, but this solution wouldn't work on Windows anymore. Is this a bug, or is there some incompatibility that might be responsible for that behaviour?

Thanks,
Stephan
Code:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 7:04 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This should be fixed for the next release

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.