Error when viewing crystal report

Hi,

I have some problems. I try to call crystal report viewer 10 from JSP, but I some errors occured:

exception

javax.servlet.ServletException: javax/servlet/ServletContext
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoClassDefFoundError: javax/servlet/ServletContext
      com.crystaldecisions.report.web.viewer.CrystalImageCleaner.stop(Unknown Source)
      org.apache.jsp.viewReport_jsp.jspDestroy(org.apache.jsp.viewReport_jsp:37)
      org.apache.jasper.runtime.HttpJspBase.destroy(HttpJspBase.java:89)
      org.apache.jasper.servlet.JspServletWrapper.destroy(JspServletWrapper.java:379)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:134)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

FYI, I use tomcat 4.1.31
Please help me..
Thanks in advanced.

pcapplication
pcapplicationAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bloodredsunCommented:
NoClassDefFoundError is commonly caused by not having a certain jar in the classpath. In this case it appears to be the parent jar of "javax/servlet/ServletContext" which is normally servlet.jar or j2ee.jar.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bloodredsunCommented:
Make sure that you have a system variable called "CLASSPATH" as detailed here, http://www.moreservlets.com/Using-Tomcat-4.html#Set-CLASSPATH. You may also want to have a CATALINA_HOME variable also for Tomcat 4.1.x
0
pcapplicationAuthor Commented:
Hi bloodredsun,

Thx for your answer, but still have a problem
I do have set a CATALINA_HOME variable to C:\Program Files\Apache Group\Tomcat 4.1 and i do have servlet.jar in C:\Program Files\Apache Group\Tomcat 4.1\common\lib folder
should i include the servlet.jar in the classpath???

Thx a lot.


0
bloodredsunCommented:
>>should i include the servlet.jar in the classpath???
Yes. I always do. Actually I normally have a J2EE_HOME system variable that I add to the classpath.

>> i do have servlet.jar in C:\Program Files\Apache Group\Tomcat 4.1\common\lib folder
That means that Tomcat can see it but the webapp cannot. If CR requires something from that jar, it will not be able to see it there. As above, I suggest adding it to the classpath.

What about the Crystal Report viewer jars. Make sure you've imported them all including the ones from "C:\Program Files\Common Files\Crystal Decisions\2.5\java\lib\external" and remember all the jars must be in the WEB-INF/lib not the WEB-INF/lib/ext.

NoClassDefFoundError is essentially the exception thrown when it can't find the jars (it would have been so much more informative if jakarta had wrapped that exception in a more informative one like RequiredJarNotFoundError!), so that is all it is.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.