?
Solved

Cannot compile class using JSP

Posted on 2003-02-19
12
Medium Priority
?
265 Views
Last Modified: 2010-04-01
I am a student who just study JSP not more than 1 month. I have a problem which is difficult for me to tackle. The problem is:

I try to run a program. However, after running in Tomcat 4.1.18, it generates the error message. Is it the problem of missing .jar file? Or others? Please help me to solve. Thanks a lot!

********************************************************************************************************************************************************************
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 0 in the jsp file: /jsp/sample1.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\jspsmartfile\jsp\sample1_jsp.java:7: package com.jspsmart.file does not exist
import com.jspsmart.file.*;
^
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\jspsmartfile\jsp\sample1_jsp.java:42: package com.jspsmart.file does not exist
com.jspsmart.file.SmartFile mySmartFile = null;
^



An error occurred at line: 0 in the jsp file: /jsp/sample1.jsp

Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\jspsmartfile\jsp\sample1_jsp.java:44: package com.jspsmart.file does not exist
mySmartFile = (com.jspsmart.file.SmartFile) pageContext.getAttribute("mySmartFile", PageContext.PAGE_SCOPE);
^



An error occurred at line: 0 in the jsp file: /jsp/sample1.jsp

Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\jspsmartfile\jsp\sample1_jsp.java:47: package com.jspsmart.file does not exist
mySmartFile = (com.jspsmart.file.SmartFile) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.jspsmart.file.SmartFile");
^
4 errors


at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:536)
0
Comment
Question by:piglegshing
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 9

Expert Comment

by:mglxxx
ID: 7985966
The error seems to be due to a missing jar.
Do you know which jar contains the package com.jspsmart.file? Put that jar into WEB-INF\lib
directory under your context root (should
be C:\Program Files\Apache Group\Tomcat 4.1\webapps\jspsmartfile\WEB-INF\lib on your machine).
The jar needs to have the extension 'jar'. If it's a
'zip' change the file's extension to 'jar'
when you copy it to the 'lib' directory.

After a Tomcat restart you should be in business.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 7987438
download jspsmartfile if you haven't did so, from http://www.jspsmart.com/

put the downloaded jar file into
<tomcat-install-dir>\webapps\XXX\WEB-INF\lib
XXX is where your jsp page under.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7987901
step by step install/config guide to jspsmartupload:
http://www.jspsmart.com/liblocal/docs/en/jspsmartupload/help/setup.htm#Overview
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
kennethxu earned 300 total points
ID: 8009367
I think you have already downloaded jspSmartFile.zip, so

1. unzip it to a directory say "smartfiledownload"
2. copy whole dir jspsmartfile to <tomcat-install-dir>/webapps
3. (important) open DOS windows and CD to <tomcat-install-dir>/webapps/jspsmartfile, issue command "ren Web-inf WEB-INF", because tomcat4 is case sensitive.
4. start or restart your tomcat

let us know if you still have problem. thanks.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8009649
pigleshing:  The directions from jspsmart.com should work.  Hava you tried those.  They are very simple and straightforward.

CJ
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8009951
CJ, he's looking for jspsmartFILE, not jspsmartUPLOAD :)
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8009973
CJ, let's don't confuse him. I personally just tried jspsmartfile and it seems that the zip file has case problem need to be fixed during installation.

pigleshing, try out the steps I gave you and let us know if you still have problem.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8010876
your telling me that the people who developed the library don't have correct instructions.

If they didn't they would have so many complaints that they would be forced to fix the instructions.

All I am saying is, follow what they "officially" tell you to do.  If that doesn't work, that is when you try other solutions.

Why try a home made recipe when the offical one hasn't been tried yet.

CJ
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8011070
CJ, have you read the instruction? I did. the instruction is for tomcat 3.0, it also ask you to install apache web server 1.3. are you suggesting to downgrade to tomcat3 and install apache 1.3?

the FACT is tomcat 3.0 is not dir name case sensitive but 4.1 does!

I have just installed it and it is running on my tomcat 4.1.18, the only change I have to made is rename the web-inf dir to all uppercase.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8011119
CJ: in addtion, the link you provided is to doc of jspsmartUPLOAD, which is not what we are talking about.
0
 

Author Comment

by:piglegshing
ID: 8014366
You are very helpful. If you do not minded, I may have other questions to ask you. Please forgive me!!
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8017433
no problem, just post a comment.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question