Return-Path: X-Original-To: apmail-accumulo-user-archive@www.apache.org Delivered-To: apmail-accumulo-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6FE5C182EB for ; Thu, 18 Jun 2015 12:18:14 +0000 (UTC) Received: (qmail 52242 invoked by uid 500); 18 Jun 2015 12:18:14 -0000 Delivered-To: apmail-accumulo-user-archive@accumulo.apache.org Received: (qmail 52196 invoked by uid 500); 18 Jun 2015 12:18:14 -0000 Mailing-List: contact user-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@accumulo.apache.org Delivered-To: mailing list user@accumulo.apache.org Received: (qmail 52186 invoked by uid 99); 18 Jun 2015 12:18:14 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2015 12:18:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AFA03C009B for ; Thu, 18 Jun 2015 12:18:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.981 X-Spam-Level: *** X-Spam-Status: No, score=3.981 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id rSDCFzRhqE7c for ; Thu, 18 Jun 2015 12:18:06 +0000 (UTC) Received: from gwo4.mbox.net (gwo4.mbox.net [165.212.64.24]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 0CC4C4548A for ; Thu, 18 Jun 2015 12:18:06 +0000 (UTC) Received: from gwo4.mbox.net (localhost [127.0.0.1]) by gwo4.mbox.net (Postfix) with ESMTP id 3mC2N74bkrz18gTBQ for ; Thu, 18 Jun 2015 12:17:59 +0000 (UTC) X-USANET-Received: from gwo4.mbox.net [127.0.0.1] by gwo4.mbox.net via mtad (C8.MAIN.4.02J) with ESMTP id 472TFRmR20832Mo4; Thu, 18 Jun 2015 12:17:54 -0000 X-USANET-Routed: 5 gwsout-gwsd Q:gwsd X-USANET-Routed: 3 gwsout-vs Q:bmvirus X-USANET-GWS2-Tenant: baesystems.com X-USANET-GWS2-Tagid: BAES Received: from UKDC1DMZEXEV02 [206.142.223.10] by gwo4.mbox.net via smtad (C8.MAIN.4.02Q) with ESMTPS id XID235TFRmR33148Xo4; Thu, 18 Jun 2015 12:17:54 -0000 X-USANET-Source: 206.142.223.10 OUT michael.griffiths3@baesystems.com UKDC1DMZEXEV02 TLS X-USANET-MsgId: XID235TFRmR33148Xo4 Received: from UKDC1CSUEXCV01.CSU.LOCAL (10.210.13.3) by UKDC1DMZEXEV02.ukdmz.local (10.210.195.10) with Microsoft SMTP Server id 14.3.210.2; Thu, 18 Jun 2015 13:17:32 +0100 Received: from UKDC1CSUEXMV02.CSU.LOCAL ([169.254.2.57]) by UKDC1CSUEXCV01.CSU.LOCAL ([10.210.13.3]) with mapi id 14.03.0210.002; Thu, 18 Jun 2015 13:17:52 +0100 From: "michael.griffiths3@baesystems.com" To: "user@accumulo.apache.org" Subject: Issue with classpath in unit tests Thread-Topic: Issue with classpath in unit tests Thread-Index: AdCpwIlWBNCGXvENSESezlGzHrY6Xw== Date: Thu, 18 Jun 2015 12:17:51 +0000 Message-ID: <9A684651E3B11B4C8482FD873FEAA8BA40FB0F@UKDC1CSUEXMV02.CSU.LOCAL> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.8.207] Content-Type: multipart/alternative; boundary="_000_9A684651E3B11B4C8482FD873FEAA8BA40FB0FUKDC1CSUEXMV02CSU_" MIME-Version: 1.0 Received-SPF: None (UKDC1DMZEXEV02.ukdmz.local: michael.griffiths3@baesystems.com does not designate permitted sender hosts) --_000_9A684651E3B11B4C8482FD873FEAA8BA40FB0FUKDC1CSUEXMV02CSU_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable All, I'm having an issue but I'm probably missing something simple. I am specify= ing 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 =3D new MockInstance(); accumulo =3D instance.getConnector("user", new PasswordToken("password")); assertTrue(accumulo.instanceOperations().testClassLoad(FixedLengthLongArray= Encoder.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.t= estClassLoad(MockInstanceOperationsImpl.java:70) at com.baesystems.ai.np.accumulo.aggregates.ScanTimeAggregateTest.cr= eateAccumuloInstance(ScanTimeAggregateTest.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI= mpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA= ccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Frame= workMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(Reflectiv= eCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(Framewo= rkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefo= res.java:24) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4Clas= sRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4Clas= sRunner.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(JUnit4Test= Set.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JU= nit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Prov= ider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI= mpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA= ccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithAr= ray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.in= voke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(S= urefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProce= ssWhenForked(SurefireStarter.java:107) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.j= ava: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.AccumuloReloadingVFSCla= ssLoader.(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 i= nclude the JAR in Accumulo's classpath, but how is this achieved in local u= nit 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 Please consider the environment before printing this email. This message sh= ould be regarded as confidential. If you have received this email in error = please notify the sender and destroy it immediately. Statements of intent s= hall only become binding when confirmed in hard copy by an authorised signa= tory. The contents of this email may relate to dealings with other companie= s under the control of BAE Systems Applied Intelligence Limited, details of= which can be found at http://www.baesystems.com/Businesses/index.htm. --_000_9A684651E3B11B4C8482FD873FEAA8BA40FB0FUKDC1CSUEXMV02CSU_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

All,

 

I’m having an issue but I’m proba= bly missing something simple. I am specifying a custom encoder for the Summ= ingArrayCombiner but during unit testing (using MockInstance) it cannot find the class in my local project?

 

The code is below:

 

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

 

The test fails due to:

 

java.lang.ClassNotFoundException: IO Error loading class co= m.baesystems.ai.np.accumulo.iterators.lists.FixedLengthLongArrayEncoder

       at org.apache.accumulo= .start.classloader.vfs.AccumuloVFSClassLoader.loadClass(AccumuloVFSClassLoa= der.java:114)

       at org.apache.accumulo= .core.client.mock.MockInstanceOperationsImpl.testClassLoad(MockInstanceOper= ationsImpl.java:70)

       at com.baesystems.ai.n= p.accumulo.aggregates.ScanTimeAggregateTest.createAccumuloInstance(ScanTime= AggregateTest.java:41)

       at sun.reflect.NativeM= ethodAccessorImpl.invoke0(Native Method)

       at sun.reflect.NativeM= ethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

       at sun.reflect.Delegat= ingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

       at java.lang.reflect.M= ethod.invoke(Method.java:497)

       at org.junit.runners.m= odel.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

       at org.junit.internal.= runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)=

       at org.junit.runners.m= odel.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)<= /span>

       at org.junit.internal.= runners.statements.RunBefores.evaluate(RunBefores.java:24)

       at org.junit.runners.P= arentRunner.runLeaf(ParentRunner.java:271)

       at org.junit.runners.B= lockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

       at org.junit.runners.B= lockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

       at org.junit.runners.P= arentRunner$3.run(ParentRunner.java:238)

       at org.junit.runners.P= arentRunner$1.schedule(ParentRunner.java:63)

       at org.junit.runners.P= arentRunner.runChildren(ParentRunner.java:236)

       at org.junit.runners.P= arentRunner.access$000(ParentRunner.java:53)

       at org.junit.runners.P= arentRunner$2.evaluate(ParentRunner.java:229)

       at org.junit.runners.P= arentRunner.run(ParentRunner.java:309)

       at org.apache.maven.su= refire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)

       at org.apache.maven.su= refire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)

       at org.apache.maven.su= refire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)

       at sun.reflect.NativeM= ethodAccessorImpl.invoke0(Native Method)

       at sun.reflect.NativeM= ethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

       at sun.reflect.Delegat= ingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

       at java.lang.reflect.M= ethod.invoke(Method.java:497)

       at org.apache.maven.su= refire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)=

       at org.apache.maven.su= refire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110= )

       at org.apache.maven.su= refire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)=

       at org.apache.maven.su= refire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.= java:107)

       at org.apache.maven.su= refire.booter.ForkedBooter.main(ForkedBooter.java:68)

Caused by: org.apache.commons.vfs2.FileSystemException: Cou= ld not find file with URI "/lib/ext/[^.].*.jar" because it is a r= elative path, and no base URI was provided.

       at org.apache.commons.= vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.jav= a:719)

       at org.apache.commons.= vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.jav= a:649)

       at org.apache.commons.= vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.jav= a:605)

       at org.apache.accumulo= .start.classloader.vfs.AccumuloVFSClassLoader.resolve(AccumuloVFSClassLoade= r.java:143)

       at org.apache.accumulo= .start.classloader.vfs.AccumuloReloadingVFSClassLoader.<init>(Accumul= oReloadingVFSClassLoader.java:100)

       at org.apache.accumulo= .start.classloader.vfs.AccumuloVFSClassLoader.createDynamicClassloader(Accu= muloVFSClassLoader.java:197)

       at org.apache.accumulo= .start.classloader.vfs.AccumuloVFSClassLoader.getClassLoader(AccumuloVFSCla= ssLoader.java:216)

       at org.apache.accumulo= .start.classloader.vfs.AccumuloVFSClassLoader.loadClass(AccumuloVFSClassLoa= der.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 class= path, but how is this achieved in local unit tests?

 

Many thanks,

 

Michael

 

Michael Griffiths
Developer
BAE Systems Applied Intelligence
__________________________= _________________________________

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

BAE Systems Appli= ed Intelligence, Surrey Research Park, Guildford, Surrey, GU2 7RQ.
www.baesystems.com/ai

 

Please consider the environment before printing this email. This message sh= ould be regarded as confidential. If you have received this email in error = please notify the sender and destroy it immediately. Statements of intent s= hall only become binding when confirmed in hard copy by an authorised signatory. The contents of this email may re= late to dealings with other companies under the control of BAE Systems Appl= ied Intelligence Limited, details of which can be found at http://www.baesy= stems.com/Businesses/index.htm. --_000_9A684651E3B11B4C8482FD873FEAA8BA40FB0FUKDC1CSUEXMV02CSU_--