[hibernate-issues] [Hibernate-JIRA] Created: (EJB-337) Entity scaning failing when path protocol is "file:" (not jar) and it contains spaces

valery gorbunov (JIRA) noreply at atlassian.com
Fri Feb 15 11:31:33 EST 2008


Entity scaning failing when path protocol is "file:" (not jar) and it contains spaces
-------------------------------------------------------------------------------------

                 Key: EJB-337
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-337
             Project: Hibernate Entity Manager
          Issue Type: Bug
          Components: EntityManager
    Affects Versions: 3.3.1.GA
         Environment: OS Linux 
Hibernate 3.2.5ga
HiberanteEM -3.3.1ga
            Reporter: valery gorbunov
            Priority: Critical


Entity scanning failed when path contains   spaces

Stack trace is:
java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
	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.FileProtocolArchiveBrowserFactoryTest.testCreate(FileProtocolArchiveBrowserFactoryTest.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
	at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:114)
	at java.util.jar.JarFile.<init>(JarFile.java:133)
	at java.util.jar.JarFile.<init>(JarFile.java:97)
	at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:69)
	... 24 more

Problem in FileProtocolArchiveBrowserFactory class

see test:


package org.jboss.util.file;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;

import junit.framework.Assert;

import org.junit.Test;

/**
 *
 * @author Valery Gorbunov <a href=mailto:vgorbunov at comodo.com.ua>vgorbunov at comodo.com.ua</a>
 */
public class FileProtocolArchiveBrowserFactoryTest {

	@Test
	public void testCreate() throws MalformedURLException, URISyntaxException {
	URI uri = new URI("file:/tmp/Path%20with%20space");
	File f = new File(uri);
	if (!f.exists()) {
		Assert.assertTrue(f.mkdir());
	}
	FileProtocolArchiveBrowserFactory factory = new FileProtocolArchiveBrowserFactory();
	Object ab = factory.create(f.toURI().toURL(), null);
	assertNotNull(ab);
	assertTrue(ab instanceof DirectoryArchiveBrowser);
	}

}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list