[
http://jira.jboss.com/jira/browse/JBCOMMON-29?page=comments#action_12382309 ]
Cypher Punk commented on JBCOMMON-29:
-------------------------------------
Dimitris,
It seems that your code change (JBCOMMON-19, Deal with spaces in local file URIs)
introduced this error. See the test below.
import junit.framework.TestCase;
import java.io.File;
import java.net.URL;
public class UrlTest extends TestCase {
public void test1() throws Exception {
URL url = new URL("file", "",
"/C:/Documents%20and%20Settings/Administrator");
File file = new File(url.toURI());
assertTrue(file.exists());
}
public void test2() throws Exception {
URL url = new URL("file", "",
"/C:/Documents%20and%20Settings/Administrator");
File file = new File(url.getPath());
assertTrue(file.exists());
}
}
Please add tests!
Unable to read in jarfile if application installed to location with
spaces in directory name
--------------------------------------------------------------------------------------------
Key: JBCOMMON-29
URL:
http://jira.jboss.com/jira/browse/JBCOMMON-29
Project: JBoss Common
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: common-core
Affects Versions: 2.0.4.GA
Environment: windows XP sun-jre, happens also in core-2.2.0.GA
Reporter: klaasjan elzinga
Assigned To: Dimitris Andreadis
I get an exception if the application is installed to a directory containing a space. I I
rename the directory to a name without a space, the application runs perfectly.
Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'entityManagerFactory' defined in class path resource
[loadtool/applicationContext.xml]: Invocation of init method failed; nested exception is
java.lang.RuntimeException: error trying to scan <jar-file>:
file:/C:/TIS%20FIIBLoadTool-3.0.2.SN
APSHOT/TISFIIBLoadTool-3.0.2.SNAPSHOT-jar-with-dependencies.jar
Caused by: java.lang.RuntimeException: error trying to scan <jar-file>:
file:/C:/TIS%20FIIBLoadTool-3.0.2.SNAPSHOT/TISFIIBLoadTool-3.0.2.SNAPSHOT-jar-with-dependencies.jar
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.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)
at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
...
at loadtool.Main.main(Main.java:40)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException:
C:\TIS%20FIIBLoadTool-3.0.2.SNAPSHOT\TISFIIBLoadTool-3.0.2.SNAPSHOT-jar-with-dependencies.jar
(The system cannot find th
e path specified)
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:57)
at
org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:626)
... 29 more
Caused by: java.io.FileNotFoundException:
C:\TIS%20FIIBLoadTool-3.0.2.SNAPSHOT\TISFIIBLoadTool-3.0.2.SNAPSHOT-jar-with-dependencies.jar
(The system cannot find the path specified)
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)
... 32 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira