Jump to content

Tomcat Not finding Scriptlet Class


Recommended Posts

By: Jon French - jtfrench

Tomcat Not finding Scriptlet Class

2002-05-21 08:26

I'm running tomcat as a development web server and have had success over the past few months developing many JasperReports.

<br><br>

This morning, I made my first Scriplet by extending JRDefaultScriplet, compiled the Scriplet into my tomcat webapp directory, and added the scripletClass attribute to the JasperReport.

<br><br>

I'm using the correct fully qualified package name in the scripletClass attribute and I have verified that the .class file appears in my webapp directory in the correct folder, but I am still getting a ClassNotFoundException for my scriplet class (not JRDefaultScriplet) when I try to run the report.

<br><br>

Am I missing something? Help would be greatly appreciated. Thanks in advance.

 

 

 

 

By: Jon French - jtfrench

RE: Tomcat Not finding Scriptlet Class

2002-05-21 08:55

Thank you. Yes, when I said "webapp" directory, I should have written WEB-INF/classes. The scriplet is in this directory in the correct package folder, but still is not working.

 

Does the WEB-INF/classes directory have to be in my CLASSPATH environmental variable? Shouldn't Tomcat still be able to see everything in the WEB-INF/classes directory?

 

 

 

 

By: Jon French - jtfrench

RE:

2002-05-27 08:08

Thank you Teodor.

 

Moving the jasperreports.jar file out of the common/lib directory and into the WEB-INF/lib directory immediately solved the problem.

 

 

 

 

 

 

By: Teodor Danciu - teodord

RE2: Tomcat Not finding Scriptlet Class

2002-05-22 04:54

 

Hi,

 

If you have put the scriptlet class in the

WEB-INF/classes directory, you should also put

jasperreports.jar in the WEB-INF/lib directory

of your Web application.

Make sure the jar file is used from there and not

from the tomcat/lib directory for example.

 

I have performed some test and it worked.

However, if the jasperreports.jar is in tomcat/lib,

it will be loaded by a different class loader,

that won't be able to find your scriptlet class

in WEB-INF/classes.

 

Files in WEB-INF/lib and WEB-INF/classes are

loaded using a separate class loader by the server.

jasperreports.jar and the scriptlets must stay in the

same class loader space of a given Web application.

 

I hope this helps.

Teodor

 

 

 

 

 

By: Jennifer - r36928

RE: RE2: Tomcat Not finding Scriptlet Class

2003-03-07 08:53

Hi,

 

But if I do this, put jasperreports.jar in the WEB-INF/lib directory of my web application, and put scriptlet class under WEB-INF/class/.

 

Then I get the error ClassNotFoundException - "JasperReprot" can not be found. Seems it can be found only if I put it under /tomcat/lib/

but which will create the problem of can not find the scriptlet class? How to fix this problem? Pls help.

 

Regards,

Jennifer

 

 

 

 

 

By: Teodor Danciu - teodord

RE: RE2: Tomcat Not finding Scriptlet Class

2003-05-10 04:31

 

Hi,

 

It would be interesting to see the entire stack trace.

But before that, could it be a spelling problem?

 

ClassNotFoundException - "JasperReprot"

 

OR

 

ClassNotFoundException - "JasperReport"

 

I hope this helps.

Teodor

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Tomcat Not finding Scriptlet Class

2002-05-21 08:33

 

Hi,

 

Your scriptlet class should be available in the

CLASSPATH at runtime.

 

You can put it in the WEB-INFclasses directory

of your web application and the server will

automatically load it from there.

 

I hope it helps.

Teodor

 

 

 

 

 

By: Chonsiu - chonsiu

RE: Tomcat Not finding Scriptlet Class

2003-03-31 22:54

Hi teodord

 

For my case tomat can find scriplet class if I put them in "classes" folder, but if I put the scriplet to my package(E.g. com.chonsiu.report.script.ProductScript.java), then tomcat can't access it anymore....should I declare the scriplet class in report design with special syntax like scriptletClass="com.chonsiu.report.script.ProductScript" ? I've tried this but not working.....can u jelp me ? Thx a lot ~

 

Chonsiu

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...