Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

image servlet problem

servlet

  • Please log in to reply
3 replies to this topic

#1 commissioner

commissioner

    CC Newcomer

  • Just Joined
  • PipPip
  • 17 posts

Posted 02 April 2011 - 01:08 PM

Hi everyone, am developing servlet image upload app. when i run the programm, it displays an error below though i have apache common filesupoad and common i.o at my apache lib. what do i do, Is it that my command prompt cannot compile the code. here is the error
C:\Tomcat 6.0\webapps\test\WEB-INF\classes>javac ServletImage.java
ServletImage.java:6: package org.apache.commons.fileupload.servlet does not exis
t
import org.apache.commons.fileupload.servlet.ServletFileUpload;
                                            ^
ServletImage.java:7: package org.apache.commons.fileupload.disk does not exist
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
                                         ^
ServletImage.java:8: package org.apache.commons.fileupload does not exist
import org.apache.commons.fileupload.*;
^
ServletImage.java:16: cannot find symbol
symbol  : variable ServletFileUpload
location: class ServletImage
                boolean isMultipart = ServletFileUpload.isMultipartContent(reque
st);
                                      ^
ServletImage.java:21: cannot find symbol
symbol  : class FileItemFactory
location: class ServletImage
                        FileItemFactory factory = new DiskFileItemFactory();
                        ^
ServletImage.java:21: cannot find symbol
symbol  : class DiskFileItemFactory
location: class ServletImage
                        FileItemFactory factory = new DiskFileItemFactory();
                                                      ^
ServletImage.java:22: cannot find symbol
symbol  : class ServletFileUpload
location: class ServletImage
                        ServletFileUpload upload = new ServletFileUpload(factory
);
                        ^
ServletImage.java:22: cannot find symbol
symbol  : class ServletFileUpload
location: class ServletImage
                        ServletFileUpload upload = new ServletFileUpload(factory
);
                                                       ^
ServletImage.java:28: cannot find symbol
symbol  : class FileUploadException
location: class ServletImage
                        } catch (FileUploadException e) {
                                 ^
ServletImage.java:33: cannot find symbol
symbol  : class FileItem
location: class ServletImage
                                FileItem item = (FileItem) itr.next();
                                ^
ServletImage.java:33: cannot find symbol
symbol  : class FileItem
location: class ServletImage
                                FileItem item = (FileItem) itr.next();
                                                 ^
11 errors

C:\Tomcat 6.0\webapps\cyberworld\WEB-INF\classes>

  • 0

#2 ZekeDragon

ZekeDragon

    CC Leader

  • Retired Mod
  • PipPipPipPipPipPipPip
  • 1263 posts

Posted 02 April 2011 - 02:58 PM

This indicates that your Java Compiler cannot locate in any of it's CLASSPATH folders the file org\apache\commons\fileupload\servlet\ServletFileUpload.class and the other imports as well. Are you sure that your class paths have been properly set? Where in your file system are the class files located?
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#3 commissioner

commissioner

    CC Newcomer

  • Just Joined
  • PipPip
  • 17 posts

Posted 04 April 2011 - 03:29 PM

i have set the path but it seems its not working
  • 0

#4 commissioner

commissioner

    CC Newcomer

  • Just Joined
  • PipPip
  • 17 posts

Posted 04 April 2011 - 03:51 PM

Thanks now working
  • 0





Also tagged with one or more of these keywords: servlet

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download