Highlighted

Error during build -> commons-io sling-mock

tim-schwalbe-NZ

05-02-2018

Hello I don't know which can cause this issue during build. May I have to close something? inputstream? some of the mocking stuff?

my Test:

@Test
public void testDoGetForEnglishPressReleaseWithReleaseImage() throws IOException, WCMException {

  context.requestPathInfo().setSelectorString("en");
  context.requestPathInfo().setExtension("xml");
  Class clazz = RssFeedServletTest.class;
  InputStream inputStream = clazz.getResourceAsStream(

   "/servlets/rss/result-release-en.txt");
  String rssFeedExpected = FileReader.readFromInputStream(inputStream);

  rssFeedServlet.doGet(context.request(), context.response());

  assertThat(context.response().getStatus()).isEqualTo(HttpStatus.SC_OK);
  String result = context.response().getOutputAsString();
  assertThat(result).isEqualToNormalizingNewlines(rssFeedExpected);

}

stacktrace:

:52:44 java.lang.RuntimeException: Unable to invoke method 'deactivate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository

14:52:44 at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:320)

14:52:44 at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:142)

14:52:44 at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84)

14:52:44 at org.apache.sling.testing.mock.osgi.MockOsgi.deactivate(MockOsgi.java:216)

14:52:44 at org.apache.sling.testing.mock.osgi.MockBundleContext.shutdown(MockBundleContext.java:438)

14:52:44 at org.apache.sling.testing.mock.osgi.MockOsgi.shutdown(MockOsgi.java:315)

14:52:44 at org.apache.sling.testing.mock.osgi.context.OsgiContextImpl.tearDown(OsgiContextImpl.java:56)

14:52:44 at org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:222)

14:52:44 at io.wcm.testing.mock.aem.context.AemContextImpl.tearDown(AemContextImpl.java:79)

14:52:44 at io.wcm.testing.mock.aem.junit.AemContext.access$200(AemContext.java:48)

14:52:44 at io.wcm.testing.mock.aem.junit.AemContext$1.after(AemContext.java:162)

14:52:44 at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50)

14:52:44 at org.junit.rules.RunRules.evaluate(RunRules.java:20)

14:52:44 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

14:52:44 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)

14:52:44 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

14:52:44 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

14:52:44 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

14:52:44 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

14:52:44 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

14:52:44 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

14:52:44 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

14:52:44 at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

14:52:44 at org.junit.runner.JUnitCore.run(JUnitCore.java:115)

14:52:44 at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:81)

14:52:44 at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:69)

14:52:44 at org.testng.TestRunner$1.run(TestRunner.java:682)

14:52:44 at org.testng.TestRunner.runWorkers(TestRunner.java:1005)

14:52:44 at org.testng.TestRunner.privateRunJUnit(TestRunner.java:713)

14:52:44 at org.testng.TestRunner.run(TestRunner.java:614)

14:52:44 at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)

14:52:44 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)

14:52:44 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)

14:52:44 at org.testng.SuiteRunner.run(SuiteRunner.java:254)

14:52:44 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

14:52:44 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

14:52:44 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)

14:52:44 at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

14:52:44 at org.testng.TestNG.run(TestNG.java:1057)

14:52:44 at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)

14:52:44 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:212)

14:52:44 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)

14:52:44 at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)

14:52:44 at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)

14:52:44 at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)

14:52:44 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

14:52:44 Caused by: java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.closeQuietly(Ljava/io/Closeable;)V

14:52:44 at org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.shutdown(RepositoryImpl.java:325)

14:52:44 at org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository.deactivate(OakMockSlingRepository.java:92)

14:52:44 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

14:52:44 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

14:52:44 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

14:52:44 at java.lang.reflect.Method.invoke(Method.java:498)

14:52:44 at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:311)

14:52:44 at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeLifecycleMethod(OsgiServiceUtil.java:142)

14:52:44 at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:84)

14:52:44 at org.apache.sling.testing.mock.osgi.MockOsgi.deactivate(MockOsgi.java:216)

14:52:44 at org.apache.sling.testing.mock.osgi.MockBundleContext.shutdown(MockBundleContext.java:438)

14:52:44 at org.apache.sling.testing.mock.osgi.MockOsgi.shutdown(MockOsgi.java:315)

14:52:44 at org.apache.sling.testing.mock.osgi.context.OsgiContextImpl.tearDown(OsgiContextImpl.java:56)

14:52:44 at org.apache.sling.testing.mock.sling.context.SlingContextImpl.tearDown(SlingContextImpl.java:222)

14:52:44 at io.wcm.testing.mock.aem.context.AemContextImpl.tearDown(AemContextImpl.java:79)

14:52:44 at io.wcm.testing.mock.aem.junit.AemContext.access$200(AemContext.java:48)

14:52:44 at io.wcm.testing.mock.aem.junit.AemContext$1.after(AemContext.java:162)

14:52:44 at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50)

14:52:44 at org.junit.rules.RunRules.evaluate(RunRules.java:20)

14:52:44 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

14:52:44 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)

14:52:44 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

14:52:44 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

14:52:44 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

14:52:44 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

14:52:44 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

14:52:44 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

14:52:44 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

14:52:44 at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

14:52:44 at org.junit.runner.JUnitCore.run(JUnitCore.java:115)

14:52:44 at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:81)

14:52:44 at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:69)

14:52:44 at org.testng.TestRunner$1.run(TestRunner.java:682)

14:52:44 at org.testng.TestRunner.runWorkers(TestRunner.java:1005)

14:52:44 at org.testng.TestRunner.privateRunJUnit(TestRunner.java:713)

14:52:44 at org.testng.TestRunner.run(TestRunner.java:614)

14:52:44 at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)

14:52:44 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)

14:52:44 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)

14:52:44 at org.testng.SuiteRunner.run(SuiteRunner.java:254)

14:52:44 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

14:52:44 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

14:52:44 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)

14:52:44 at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

14:52:44 at org.testng.TestNG.run(TestNG.java:1057)

14:52:44 at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)

14:52:44 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:212)

14:52:44 at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)

14:52:44 at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)

14:52:44 at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)

14:52:44 at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)

14:52:44 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Replies

Highlighted

tim-schwalbe-NZ

05-02-2018

I don't know it do run locally and does build also in another pipeline.

the error occurs building on jenkins an artifact and fails with this message. It's a build process out of my control so I am not really able to reproduce it.