Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting error while running servlet used to upload file
i am using framework of jakarta project
i am using eclipse it shows that DiskFileUpload is deprecated so
what to do ?

the error is



java.lang.NoClassDefFoundError: org/apache/commons/fileupload/DiskFileUpload
at uploadServlet.doPost(uploadServlet.java:28)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jar required is not there in the runtime path.
Deprecation would not cause ClassNotFoundExeception.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the javadoc.The alternate method to do the required job should there.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
The jar required is not there in the runtime path.
Deprecation would not cause ClassNotFoundExeception.


Mr Rahool its not classNot foundError its about ClassDefinition

i am using eclipse if my jar file is not on class path then eclipse doesn't provide you Quick help but my eclipse is showing every Thing so problem is not about class path
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Check your class is available in your class path. At run time , your class is missing in the class path.
Or check your file name, it may be misspelled. At run time, your compiler looks for the original class

bye for now
sat
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ravindra patil:
Mr Rahool its not classNot foundError its about ClassDefinition

i am using eclipse if my jar file is not on class path then eclipse doesn't provide you Quick help but my eclipse is showing every Thing so problem is not about class path


You are right when you say its not a ClassNotFoundException. Its a NoClassDefFoundError for org/apache/commons/fileupload/DiskFileUpload. However it still is a classpath issue. Eclipse might be finding the jar in its classpath but that jar may not be present in the server's classpath where you have deployed the application
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ravindra patil:


Mr Rahool its not classNot foundError its about ClassDefinition



Oh! that was a typo.

buildpath is having the jar but at runtime its not able to find the classes.If that's a web application try putting the jar at /WEB-INF/lib folder.



[BPSouther: fixed UBB tags]
[ November 21, 2006: Message edited by: Ben Souther ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic