• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

NoClassDefFoundError

 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
It's never done THAT before. Explain it to me tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic