question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClassNotFoundException running Integration Tests

See original GitHub issue

I’m submitting a …

[x] bug report
[ ] feature request

Expected Behavior

No ClassNotFoundException should be thrown at the end of running integration tests.

Current Behavior

The following exceptions are thrown at the end of running integration tests: (see stack trace/log excerpt in “Additional information” section). Please also note that the build/goal is marked as “BUILD SUCCESS” and everything seems to be fine (i.e. the integration tests have been executed successfully).

Possible Solution

A first idea is that the mentioned classes are not available in the classpath when stopping the embedded tomcat / end of build lifecycle.

Steps to Reproduce (for bugs)

  1. Create a new AIO Alfresco SDK 3 project.
  2. Run “mvn verify” in the AIO project
  3. Wait until the end
  4. Check log messages

Context

n/a

Your Environment

  • Alfresco SDK version used: 3.0 Release
  • Alfresco version used: 5.2 Enterprise/Community
  • Output of command ‘mvn -version’: Apache Maven 3.3.9

Additional information

Stack Trace/Log excerpt:

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO] 

[INFO] AIO - SDK 3.0 Beta ................................. SUCCESS [  0.864 s]

[INFO] Alfresco Platform/Repository JAR Module ............ SUCCESS [  9.461 s]

[INFO] Alfresco Share JAR Module .......................... SUCCESS [  0.659 s]

[INFO] Integration Tests Module ........................... SUCCESS [05:10 min]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 05:22 min

[INFO] Finished at: 2017-04-19T14:46:04+02:00

[INFO] Final Memory: 375M/1828M

[INFO] ------------------------------------------------------------------------

java.lang.NoClassDefFoundError: de/schlichtherle/truezip/fs/FsLockController$1Sync
	at de.schlichtherle.truezip.fs.FsLockController.sync(FsLockController.java:240)
	at de.schlichtherle.truezip.fs.archive.zip.KeyController.sync(KeyController.java:128)
	at de.schlichtherle.truezip.fs.FsDecoratingController.sync(FsDecoratingController.java:131)
	at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.sync(FsFalsePositiveArchiveController.java:480)
	at de.schlichtherle.truezip.fs.FsManager.sync(FsManager.java:105)
	at de.schlichtherle.truezip.fs.FsDefaultManager.sync(FsDefaultManager.java:190)
	at de.schlichtherle.truezip.fs.FsSyncShutdownHook$Hook.run(FsSyncShutdownHook.java:93)
Caused by: java.lang.ClassNotFoundException: de.schlichtherle.truezip.fs.FsLockController$1Sync
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	... 7 more
Exception in thread "Thread-4" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
	at org.apache.tomcat.maven.plugin.tomcat7.run.RunMojo$1.run(RunMojo.java:140)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	... 1 more
ERROR: IllegalAccessException for stop method in class org.apache.tomcat.maven.plugin.tomcat7.run.ExtendedTomcat
java.lang.reflect.InvocationTargetException
	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:498)
	at org.apache.tomcat.maven.common.run.EmbeddedRegistry.shutdownAll(EmbeddedRegistry.java:110)
	at org.apache.tomcat.maven.common.run.EmbeddedRegistry$1.run(EmbeddedRegistry.java:69)
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardServer[-1]]
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
	at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:351)
	... 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardService[Tomcat]]
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
	at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:753)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Tomcat]]
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
	at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:502)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	... 9 more
Caused by: java.lang.NoClassDefFoundError: org/apache/catalina/core/ContainerBase$StopChild
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1173)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	... 11 more
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.core.ContainerBase$StopChild
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	... 13 more

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:16

github_iconTop GitHub Comments

3reactions
eyaroslavtsevcommented, Apr 26, 2017

+1. I’ve the same thing.

2reactions
sorin-postelnicucommented, Sep 6, 2017

I am having the same problem, and it’s with an empty getting-started sample. The SDK 3.0.1 is NOT working out-of-the-box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SpringBootTest ClassNotFoundException error in integration ...
Only an issue for component classes defined in module being tested. It all works fine if the component class is from a dependency...
Read more >
Integration tests with spring boot - ClassNotFoundException
There was another pretty weird issue (before the logging configuration, namingly I had some problems with running integration tests with the ...
Read more >
Using Maven Failsafe With Spring Boot | Björn Wilmsmann
While the former plugin is intended for running integration tests the ... (see Integration Tests With Spring Boot – ClassNotFoundException).
Read more >
ClassNotFoundException when running JUnit unit tests within ...
It is fails with a 'ClassNotFoundException ' then you have this problem. After obtaining the classpath that Eclipse was using to spawn off...
Read more >
Test woes with Maven Failsafe 3.0.0-M5 - Ad Astra Per Aspera
Recently I was converting some test cases so that they would run as integration tests instead of unit tests. The maven-failsafe-plugin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found