title: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
body: <p>Before asking this question, I've searched stackoverflow, but I did not get a good answer. </p>
  
  <p><a href="https://stackoverflow.com/questions/13045262/spring-hibernate-tomcat-dependency-problems">Spring + Hibernate + Tomcat Dependency problems</a></p>
  
  <p>When I debug the method:</p>
  
  <p><a href="https://stackoverflow.com/questions/13045262/spring-hibernate-tomcat-dependency-problems"><img src="https://i.stack.imgur.com/J22zo.jpg" alt="enter image description here"></a></p>
  
  <p>My issue log is below:</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (org.hibernate.type.BasicTypeRegistry).
  log4j:WARN Please initialize the log4j system properly.
  
  java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
  
     at org.hibernate.util.SimpleMRUCache.init(SimpleMRUCache.java:71)
      at org.hibernate.util.SimpleMRUCache.&lt;init&gt;(SimpleMRUCache.java:55)
      at org.hibernate.engine.query.QueryPlanCache.&lt;init&gt;(QueryPlanCache.java:76)
      at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:237)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)
      at com.ypd.a.entity.App.testHello(App.java:26)
      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.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:289)
      at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:114)
      at org.junit.jupiter.engine.descriptor.MethodTestDescriptor.lambda$invokeTestMethod$7(MethodTestDescriptor.java:212)
      at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
      at org.junit.jupiter.engine.descriptor.MethodTestDescriptor.invokeTestMethod(MethodTestDescriptor.java:208)
      at org.junit.jupiter.engine.descriptor.MethodTestDescriptor.execute(MethodTestDescriptor.java:155)
      at org.junit.jupiter.engine.descriptor.MethodTestDescriptor.execute(MethodTestDescriptor.java:63)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$0(HierarchicalTestExecutor.java:80)
      at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:76)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$0(HierarchicalTestExecutor.java:87)
      at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:76)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$0(HierarchicalTestExecutor.java:87)
      at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:76)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:51)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:129)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
      at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:59)
      at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.LRUMap
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 34 more
  </code></pre>
  
  <p>The cause by is :</p>
  
  <blockquote>
    <p>java.lang.ClassNotFoundException:
    org.apache.commons.collections.map.LRUMap</p>
  </blockquote>