Error when viewing crystal report

Posted on 2005-04-05
Medium Priority
Last Modified: 2012-08-14

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


javax.servlet.ServletException: javax/servlet/ServletContext

root cause

java.lang.NoClassDefFoundError: javax/servlet/ServletContext
      com.crystaldecisions.report.web.viewer.CrystalImageCleaner.stop(Unknown Source)

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

Question by:pcapplication
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
  • 3
LVL 29

Accepted Solution

bloodredsun earned 2000 total points
ID: 13705245
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.
LVL 29

Expert Comment

ID: 13705273
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

Author Comment

ID: 13713476
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.

LVL 29

Expert Comment

ID: 13714730
>>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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

764 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