ClassNotFoundException and System.setProperty

By: Julie Bé²µbé­ orlibou
ClassNotFoundException and System.setProperty
2003-01-24 07:54

I have a chart with a scriptlet.
I have a web application.

Like in the exemple I set my jasper.reports.compile.class.path

System.setProperty( "jasper.reports.compile.class.path",
context.getRealPath("/WEB-INF/lib/jasperreports.jar") +
System.getProperty("path.separator") + context.getRealPath("/WEB-INF/classes/")

I would like to have a directory report with my chart.xml and my chartScriptlet.class.

Is it possible to change "/WEB-INF/classes/" for "/WEB-INF/report" ?

I tried this, but when my .class is'nt in "/WEB-INF/classes/", I have java.lang.ClassNotFoundException.


By: Teodor Danciu - teodord
RE: ClassNotFoundException and System.setProperty
2003-01-24 08:17


The /WEB-INF/classes directory is a very special
one because the Web server will automatically
load the classes placed there when running
your Web application.
If you place the scriptlet class in other directory,
the Web server would not be able to load the class
and therefore you get the error.

It is like placing one of your servlet classes into
some other location.

The same thing for the /WEB-INF/lib directory
in which you normally place your Web application
jar files.

I hope this helps.

By: Julie Bé²µbé­ orlibou
RE: ClassNotFoundException and System.setProperty
2003-01-27 11:14
I understand.

Thank you!
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet