NPE at org.apache.commons.vfs.provider.ram.RamFileSystem.attach
---------------------------------------------------------------
Key: VFS-237
URL: https://issues.apache.org/jira/browse/VFS-237
Project: Commons VFS
Issue Type: Bug
Affects Versions: 1.0
Environment: unit test
Reporter: Adrian Cole
I get an NPE occasionally during my unit tests.
org.codehaus.cargo.util.CargoException: Failed to create folders for path
[ram:/org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest/container/webapps]
at
org.codehaus.cargo.util.VFSFileHandler.mkdirs(VFSFileHandler.java:174)
at
org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest.setUpManager(Tomcat4xStandaloneLocalConfigurationTest.java:67)
at
org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest.setUp(Tomcat4xStandaloneLocalConfigurationTest.java:62)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
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:585)
at
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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:585)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: org.apache.commons.vfs.FileSystemException: Could not determine if
file
"ram:///org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest/container/webapps"
is writeable.
at
org.apache.commons.vfs.provider.AbstractFileObject.isWriteable(AbstractFileObject.java:484)
at
org.apache.commons.vfs.provider.AbstractFileObject.createFolder(AbstractFileObject.java:819)
at
org.codehaus.cargo.util.VFSFileHandler.mkdirs(VFSFileHandler.java:170)
... 23 more
Caused by: org.apache.commons.vfs.FileSystemException: Could not resolve file
"ram:///".
at
org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:301)
at
org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:267)
at
org.apache.commons.vfs.provider.AbstractFileSystem.getRoot(AbstractFileSystem.java:242)
at
org.apache.commons.vfs.provider.AbstractFileObject.getParent(AbstractFileObject.java:493)
at
org.apache.commons.vfs.provider.AbstractFileObject.isWriteable(AbstractFileObject.java:474)
... 25 more
Caused by: java.lang.NullPointerException
at
org.apache.commons.vfs.provider.ram.RamFileSystem.attach(RamFileSystem.java:197)
at
org.apache.commons.vfs.provider.ram.RamFileObject.<init>(RamFileObject.java:61)
at
org.apache.commons.vfs.provider.ram.RamFileSystem.createFile(RamFileSystem.java:71)
at
org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:296)
... 29 more
org.apache.commons.vfs.FileSystemException: Could not determine if file
"ram:///org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest/container/webapps"
is writeable.
at
org.apache.commons.vfs.provider.AbstractFileObject.isWriteable(AbstractFileObject.java:484)
at
org.apache.commons.vfs.provider.AbstractFileObject.createFolder(AbstractFileObject.java:819)
at
org.codehaus.cargo.util.VFSFileHandler.mkdirs(VFSFileHandler.java:170)
at
org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest.setUpManager(Tomcat4xStandaloneLocalConfigurationTest.java:67)
at
org.codehaus.cargo.container.tomcat.Tomcat4xStandaloneLocalConfigurationTest.setUp(Tomcat4xStandaloneLocalConfigurationTest.java:62)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.