1

I have included all the 6 jars (beanutils, lang, logging, collections, ezmorph, json-lib). Its working fine in simple struts application. But in my struts application, although I have included all jar files, its shows a NoClassDefFoundError about ListOrderedMap.

I don't know how to make my app know that class. But I have included like other required jars for different functionality.

Please help me to resolve this issue.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Manoj
  • 5,707
  • 19
  • 56
  • 86
  • 7
    That class is part of Apache Commons Collections. Check if you have the right version (3.0 or newer) of the Apache Commons Collections jar file in your classpath - if it's a web app, it should be in `WEB-INF/lib` of your war file. – Jesper Mar 07 '11 at 12:57
  • 4
    @Jesper - that can be an answer as well. – Bozho Mar 07 '11 at 13:19
  • The specified jar is in WEB-INF/lib folder. Its is working perfectly in other apps. I dont know the problem. – Manoj Mar 08 '11 at 05:27
  • I am facing the same problem, did you ever manager to solve it ? – mh377 May 31 '11 at 11:24

2 Answers2

1

Class ListOrderedMap is part of Apache Commons Collections (since version 3.0).

To be able to use it, you must have the JAR file that contains it on the classpath. The JAR file is most likely named commons-collections-3.2.1.jar (or something similar).

If you are creating a web application packaged in a WAR file, then you should put the library in the WEB-INF/lib folder inside the WAR file.

Jesper
  • 202,709
  • 46
  • 318
  • 350
0

Yes, even tho there is NOW a newer v4.x for commons-collections, the 4.x do NOT work!

So, get the older highest version from v3.x, namely: v3.2.1

If you're using maven, like I am, here's my complete working dependencies list:

  <dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<!-- <classifier>jdk15</classifier> -->
  </dependency>

  <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
  </dependency>

  <dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
   </dependency>

   <dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
   </dependency>

   <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
   </dependency>

   <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
  </dependency>

    <dependency>
<groupId>net.sf.ezmorph</groupId>
<artifactId>ezmorph</artifactId>
<version>1.0.6</version>
   </dependency>

   <dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<version>1.2.5</version>
   </dependency>
David
  • 2,253
  • 5
  • 23
  • 29