accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "michael.griffiths3@baesystems.com" <michael.griffit...@baesystems.com>
Subject Issue with classpath in unit tests
Date Thu, 18 Jun 2015 12:17:51 GMT
All,

I'm having an issue but I'm probably missing something simple. I am specifying a custom encoder
for the SummingArrayCombiner but during unit testing (using MockInstance) it cannot find the
class in my local project?

The code is below:

MockInstance instance = new MockInstance();
accumulo = instance.getConnector("user", new PasswordToken("password"));
assertTrue(accumulo.instanceOperations().testClassLoad(FixedLengthLongArrayEncoder.class.getName(),
FixedLengthLongArrayEncoder.class.getTypeName()));

The test fails due to:

java.lang.ClassNotFoundException: IO Error loading class com.baesystems.ai.np.accumulo.iterators.lists.FixedLengthLongArrayEncoder
       at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.loadClass(AccumuloVFSClassLoader.java:114)
       at org.apache.accumulo.core.client.mock.MockInstanceOperationsImpl.testClassLoad(MockInstanceOperationsImpl.java:70)
       at com.baesystems.ai.np.accumulo.aggregates.ScanTimeAggregateTest.createAccumuloInstance(ScanTimeAggregateTest.java:41)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       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.RunBefores.evaluate(RunBefores.java:24)
       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.runners.ParentRunner.run(ParentRunner.java:309)
       at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
       at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
       at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
       at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
       at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
       at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
       at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: org.apache.commons.vfs2.FileSystemException: Could not find file with URI "/lib/ext/[^.].*.jar"
because it is a relative path, and no base URI was provided.
       at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:719)
       at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:649)
       at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:605)
       at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.resolve(AccumuloVFSClassLoader.java:143)
       at org.apache.accumulo.start.classloader.vfs.AccumuloReloadingVFSClassLoader.<init>(AccumuloReloadingVFSClassLoader.java:100)
       at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.createDynamicClassloader(AccumuloVFSClassLoader.java:197)
       at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.getClassLoader(AccumuloVFSClassLoader.java:216)
       at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.loadClass(AccumuloVFSClassLoader.java:112)
       ... 31 more

Any ideas on what I'm doing wrong? For remote testing I'm aware I need to include the JAR
in Accumulo's classpath, but how is this achieved in local unit tests?

Many thanks,

Michael

Michael Griffiths
Developer
BAE Systems Applied Intelligence
___________________________________________________________

T: +44 (0) 1483 816476  |  E: michael.griffiths3@baesystems.com

BAE Systems Applied Intelligence, Surrey Research Park, Guildford, Surrey, GU2 7RQ.
www.baesystems.com/ai<http://www.baesystems.com/ai>

Please consider the environment before printing this email. This message should be regarded
as confidential. If you have received this email in error please notify the sender and destroy
it immediately. Statements of intent shall only become binding when confirmed in hard copy
by an authorised signatory. The contents of this email may relate to dealings with other companies
under the control of BAE Systems Applied Intelligence Limited, details of which can be found
at http://www.baesystems.com/Businesses/index.htm.

Mime
View raw message