Jump to content

image servlet problem

- - - - -

  • Please log in to reply
3 replies to this topic

#1
commissioner

commissioner

    Newbie

  • Members
  • PipPip
  • 17 posts
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>



#2
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
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?
Wow I changed my sig!

#3
commissioner

commissioner

    Newbie

  • Members
  • PipPip
  • 17 posts
i have set the path but it seems its not working

#4
commissioner

commissioner

    Newbie

  • Members
  • PipPip
  • 17 posts
Thanks now working




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users