You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mir Kasim Ali <mi...@gmail.com> on 2006/02/09 12:47:01 UTC

Help me

I am getting following error
*********************************************
org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
Only a type can be imported.
org.apache.commons.fileupload.DiskFileUpload resolves to a package

Generated servlet error:
Only a type can be imported. org.apache.commons.fileupload.FileItem
resolves to a package

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
DiskFileUpload cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
DiskFileUpload cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
FileItem cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
FileItem cannot be resolved to a type
WHEN I AM COMPILING THE A JSP FILE(REQESTING THE JSP FILE THROUGH BROWSER)
IN JSP I IMPORTED FOLLOWINGS
<%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@ page import="org.apache.commons.fileupload.FileItem"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>

sO PLEASE HELP ME TO GET IT WORK.IS THIS ERROR IS DUE TO
CLASS PATH.IF YES THEN PLS SUGGEST ME WHAT PATH I SET FOR IT

RE: Help me

Posted by GB Developer <gb...@globallyboundless.com>.
The error reported is: 

org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error: Only a type can be imported. 
org.apache.commons.fileupload.DiskFileUpload resolves to a package

And the JSP page is: 

<%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@ page import="org.apache.commons.fileupload.FileItem"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>


Look at the error, the part that says
"org.apache.commons.fileupload.DiskFileUpload resolves to a package" and
look at the first import statement, the one that imports
"org.apache.commons.fileupload.DiskFileUpload" and use just a smattering of
basic Java knowledge.  

Asked another way:  What do you imagine would happen if I tried to do the
following in a regular java program (or heck, a JSP):

import java.io;



This exception has nothing to do with using a single import statement vs.
multiple ones, or where you put your jar file or CLASSPATH. 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Help me

Posted by Mike Sabroff <mi...@cygnusb2b.com>.
Setting a classpath will not work as tomcat doesn't use it. At least 
that is what I have read and experienced.  putting you stuff in the 
CLASSPATH tomcat uses is a more likely scenario.
On my system I can only find it in one place:
/usr/local/server/webapps/manager/WEB-INF/lib/commons-fileupload-1.0.jar

Do you have the manager app installed?

Mir Kasim Ali wrote:
> I am getting following error
> *********************************************
> org.apache.jasper.JasperException: Unable to compile class for JSP
>
> Generated servlet error:
> Only a type can be imported.
> org.apache.commons.fileupload.DiskFileUpload resolves to a package
>
> Generated servlet error:
> Only a type can be imported. org.apache.commons.fileupload.FileItem
> resolves to a package
>
> An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
> Generated servlet error:
> DiskFileUpload cannot be resolved to a type
>
> An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
> Generated servlet error:
> DiskFileUpload cannot be resolved to a type
>
> An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
> Generated servlet error:
> FileItem cannot be resolved to a type
>
> An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
> Generated servlet error:
> FileItem cannot be resolved to a type
> WHEN I AM COMPILING THE A JSP FILE(REQESTING THE JSP FILE THROUGH BROWSER)
> IN JSP I IMPORTED FOLLOWINGS
> <%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
> <%@ page import="org.apache.commons.fileupload.FileItem"%>
> <%@ page import="java.util.List"%>
> <%@ page import="java.util.Iterator"%>
> <%@ page import="java.io.File"%>
>
> sO PLEASE HELP ME TO GET IT WORK.IS THIS ERROR IS DUE TO
> CLASS PATH.IF YES THEN PLS SUGGEST ME WHAT PATH I SET FOR IT
>   

-- 
Mike Sabroff
Web Services
Developer
mike.sabroff@cygnusb2b.com
920-568-8379


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org