0

I have used the isEmpty and isBlank methods of apache's StringUtils Class. These methods worked in a fine manner, after couple of weeks suddenly i got the error

java.lang.NoClassDefFoundError: org.apache.commons.lang3.StringUtils

I was confused why this error happened suddenly.It would be fine if anyone help me to understand this suddenly happened.

People Saying that apache might have changed the definitionin their JAR file, is it a right one,i really confused why this suddenly happened , i removed the old jar from my build path and downloaded the same version of New Jar and added it to Build path, then this issue is resloved.

It is happening in the Market Code , there's no interaction with ADT and market code

so really confused on this issue?

Sankar Ganesh PMP
  • 11,927
  • 11
  • 57
  • 90
  • here is your ans http://stackoverflow.com/questions/9857539/noclassdeffounderror-when-googleanalyticstracker-getinstance/9857669#9857669 – Akram May 16 '12 at 07:56
  • @Akki: i have added jar file in that manner only, it was recongized and worked fine , suddenly i got this exception and also i m not getting classnot found exception underrstand – Sankar Ganesh PMP May 16 '12 at 08:00
  • you might be updated you ADT if yes make sure you have a folder name libs with all the jar file your project needed – Akram May 16 '12 at 08:03
  • @It is happening in the Market Code , there's no interaction with ADT and market code, please understand – Sankar Ganesh PMP May 16 '12 at 08:04
  • when you uploaded your application recently? – Akram May 16 '12 at 08:05
  • @SankarGanesh sure that apache String Utils jar is missing. that's why this issue is coming.Add the jar and try to run again. – Ganapathy C May 16 '12 at 08:16

2 Answers2

1

This occurred to me too - after updating the Android SDK Tools. In current version (19), what you need to do is:

  1. make libs/ folder in project's root directory, and put all jars there (folder's name is fixed "libs")
  2. after this, go to project properties --> Java Build Path --> Libraries, and remove all custom jars you previously added
myself
  • 482
  • 3
  • 21
0

NoClassDefFoundError says NoClassDefFoundError is Thrown if the JVM or a ClassLoader instance tries to load in the definition of a class and no definition of the class could be found.

Maybe startup script is overriding Classpath environment variable.

prayagupa
  • 30,204
  • 14
  • 155
  • 192
  • I understand , but my Question is , it worked fine for the past 10 weeks, but i was wonder why JVM or Classloader facing this problem suddenly – Sankar Ganesh PMP May 16 '12 at 08:02