Closed GoogleCodeExporter closed 9 years ago
This is be caused by the classpath containing a filing system directory that
does not exist. This seems to be quite common, as I've seen it on a Mac and on
a linux server.
I worked around it by adding a UrlType ahead of the existing ones which returns
a Dir handler for an empty directory.
See
https://github.com/OpenGamma/OG-Platform/commit/164df45373e9e5ebbd343c878d8b1349
63ccf877
The correct fix in Reflections would be to not complain about null/not existing
at the start of SystemDir, and just return an empty iterator.
Original comment by jodastep...@gmail.com
on 13 Jul 2013 at 3:47
I am facing this same issue while trying to use
reflection.getSubTypesOf(com.google.protobuf.GeneratedMessage.class)
it fails with this stack trace:
[main] ERROR org.reflections.Reflections - could not create Vfs.Dir from url.
ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Vfs.Dir from url, no
matching UrlType was found
[file:/Users/DD025968/Documents/kepler-util-OneMore/kepler-util/kepler-console/2
]
either use fromURL(final URL url, final List<UrlType> urlTypes) or use the
static setDefaultURLTypes(final List<UrlType> urlTypes) or
addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
at org.reflections.vfs.Vfs.fromURL(Vfs.java:108)
at org.reflections.vfs.Vfs.fromURL(Vfs.java:90)
at org.reflections.Reflections.scan(Reflections.java:165)
at org.reflections.Reflections.<init>(Reflections.java:94)
at com.abc.kepler.console.util.KeplerTableUtil.addUrlsToRef(KeplerTableUtil.java:995)
at com.abc.kepler.console.util.KeplerTableUtil.findSubclasses(KeplerTableUtil.java:935)
at com.abc.kepler.console.util.KeplerTableUtil.displaySerializers(KeplerTableUtil.java:796)
at com.abc.kepler.console.util.KeplerTableUtil.handleWildcardEntry(KeplerTableUtil.java:1018)
at com.abc.kepler.console.util.KeplerTableUtil.queryClassName(KeplerTableUtil.java:589)
at com.abc.kepler.console.CreateKeplerTable.createTableInteractively(CreateKeplerTable.java:301)
at com.abc.kepler.console.CreateKeplerTable.run(CreateKeplerTable.java:198)
at com.abc.kepler.commands.Command.run(Command.java:112)
at com.abc.kepler.console.CreateKeplerTableTest.simplifiedCreateKeplerTableCommandTest_KEPLER1583(CreateKeplerTableTest.java:1407)
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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:249)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:142)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
[main] INFO org.reflections.Reflections - Reflections took 39 ms to scan 2
urls, producing 35 keys and 172 values
Could not find any associated serializers.
Please provide one or more jars enclosing serializers, separated by
commas>2013-08-13 12:05:44,233 [main] WARN org.reflections.Reflections - could
not create Dir using directory from url
file:/Users/DD025968/Documents/kepler-util-OneMore/kepler-util/kepler-console/n.
skipping.
java.lang.RuntimeException: cannot use dir null
at org.reflections.vfs.SystemDir.<init>(SystemDir.java:20)
at org.reflections.vfs.Vfs$DefaultUrlTypes$3.createDir(Vfs.java:229)
at org.reflections.vfs.Vfs.fromURL(Vfs.java:98)
at org.reflections.vfs.Vfs.fromURL(Vfs.java:90)
at org.reflections.Reflections.scan(Reflections.java:165)
at org.reflections.Reflections.<init>(Reflections.java:94)
at com.abc.kepler.console.util.KeplerTableUtil.addUrlsToRef(KeplerTableUtil.java:995)
at com.abc.kepler.console.util.KeplerTableUtil.findSubclasses(KeplerTableUtil.java:935)
at com.abc.kepler.console.util.KeplerTableUtil.displaySerializers(KeplerTableUtil.java:796)
at com.abc.kepler.console.util.KeplerTableUtil.displaySerializers(KeplerTableUtil.java:802)
at com.abc.kepler.console.util.KeplerTableUtil.handleWildcardEntry(KeplerTableUtil.java:1018)
at com.abc.kepler.console.util.KeplerTableUtil.queryClassName(KeplerTableUtil.java:589)
at com.abc.kepler.console.CreateKeplerTable.createTableInteractively(CreateKeplerTable.java:301)
at com.abc.kepler.console.CreateKeplerTable.run(CreateKeplerTable.java:198)
at com.abc.kepler.commands.Command.run(Command.java:112)
at com.abc.kepler.console.CreateKeplerTableTest.simplifiedCreateKeplerTableCommandTest_KEPLER1583(CreateKeplerTableTest.java:1407)
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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:249)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:142)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Is there a work-around on the client side? also, when is this expected to be
fixed in a reflections release?
Original comment by desai.di...@gmail.com
on 13 Aug 2013 at 5:43
I forgot to mention earlier:
I am on a mac and using reflections-0.9.8
Original comment by desai.di...@gmail.com
on 13 Aug 2013 at 5:45
Original comment by ronm...@gmail.com
on 21 Dec 2013 at 9:33
Original issue reported on code.google.com by
rodrigo....@gmail.com
on 12 Jun 2013 at 12:06