org.xml.sax.SAXNotSupportedException

By: Lindomar - bahia
org.xml.sax.SAXNotSupportedException
2002-09-10 08:00
Hi everyone!

I'm trying to use jasperreports in my application in tomcat.
Is it possible?
Well, if yes, i can't generate files pdfs, because the exception to occur when file is compiling
******
org.xml.sax.SAXNotSupportedException: Feature: http://xml.org/sax/features/validation
at org.xml.sax.helpers.ParserAdapter.setFeature(ParserAdapter.java:198)
at dori.jasper.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:320)
at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:286)
at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.j
ava:49)
...
NESTED BY :
dori.jasper.engine.JRException: Feature: http://xml.org/sax/features/validation
...
*****
String file1=JasperManager.compileReportToFile(fileName);

I checked the value of fileName, it's ok, in fileName has the full path. (c:\tomcat\...\myfile.xml)

Any idea?

Thanks.



By: nay - nay
RE: org.xml.sax.SAXNotSupportedException
2002-09-10 08:08
Hi

Try to set this propertty before compiling a new pdf ....
System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
Nay


By: Teodor Danciu - teodord
RE: org.xml.sax.SAXNotSupportedException
2002-09-10 08:10

Hi,

You are using an XML parser that does not support
validating the files against specified DTD files.
It simply does not support this feature,
maybe because it is an older version.

What XML parser are you using?

Upgrade to a newer version of your parser,
if it is the case.

I hope this helps.
Teodor



By: Lindomar - bahia
RE: org.xml.sax.SAXNotSupportedException
2002-09-10 13:47
Thanks Nay and Teodor!
I only set the propertty that was sad.
I have the new version Teodor.

I have now a problem with classpath in tomcat (and my computer too), because the solution for the exception that is generate is to resolve with setting the classpath ( I think).

When i put this command in DOS prompt, work.
****
c:\jasperreports>java -classpath ./;jasperreports.jar;%JAVA_HOME%/lib/tools.jar;commons-beanutils.jar;commons-collections.jar;commons-digester.jar;xerces.jar;iText-0.81.jar;mssql4.jar -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser <myclass> <myparams>
***

But if only put this, don't work.

*****
c:\jasperreports>java -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser <myclass> <myparams>
*****

Is gererate the following exception, that is same generate in tomcat:
*****
dori.jasper.engine.JRException: Errors were encountered when compiling report de
sign:
listaprodutos.java:54: Class java.util.Map not found in type declaration.
*****

I see the classpath in my computer, and the jar files are in classpath.
And in tomcat the jar files are in tomcat\lib and tomcat\webapps\myapp\web-inf\lib

I don't know more what to do...

Another idea?

Thanks again.



By: Teodor Danciu - teodord
RE: org.xml.sax.SAXNotSupportedException
2002-09-10 23:07

Hi,

It seems that the rt.jar file is not found when
compiling the report expressions class at runtime.
This is unusual since the rt.jar is part of the default
system classpath and does not need to be
specified explicitly.

What version of JDK are you using?

Thank you,
Teodor



By: Lindomar - bahia
RE: org.xml.sax.SAXNotSupportedException .
2002-09-11 06:14
Hi Teodor, i'm using j2sdk 1.3.1, but had the version 1.4 (for some tests), however i unistalled.


By: Teodor Danciu - teodord
RE: org.xml.sax.SAXNotSupportedException .
2002-09-11 06:42

Hi,

Make sure the JAVA_HOME environment variable on your machine is correct.

I hope this helps.
Teodor



By: Lindomar - bahia
RE:org.xml.sax.SAXNotSupportedException
2002-09-11 08:19
It s ok.
I run a class test, for example, the hello world, it s works.
***
c:\>java hello
Hi!
****
I checked carefully the classpath, i can t see problem.
I will unistall and install again the java.
What do you think?
2001 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:26am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback
randomness