Jump to content
Changes to the Jaspersoft community edition download ×

SAXParseException Sometimes, but not everywhere


greddin

Recommended Posts

We have a bunch of reports that have been created over the course of a year and a half in various versions of iReport. We used to compile them in iReport and deliver them with our web application. We're switching to a model where we compile them with Ant and store them in a directory separate to the web app. The ant script uses the Jar files in the WEB-INF/lib directory of an installed web app to compile the reports - less than ideal situation which we will remedy in the next release series of our app :-)

 

I created the process on my box and ran the Ant script and it worked fine (using Jasper Reports 2.0.0). When I moved the system over to the development server it started throwing SAXParseExceptions. The classpath was exactly the same as what I'm using on my box. On our production server which uses Jasper 1.3.4 the system worked. On the QA (which is the same box as DEV, but different Tomcat instance) it failed. QA has the exact same classpath as PROD. The only difference is that it's on the same box as DEV. Both boxes are Linux and use the same JVM version: 1.5_07 from Sun.

 

Here's the odd thing: The SAXParseExceptions are correct. The XML created by various versions of iReport is hosed in some places. So why does it work anywhere? It doesn't seem to have anything to do with the version of Jasper reports being used to compile the reports. The only variant seems to be the box it is running on. Here's the list of exceptions I'm getting:

 

Code:

org.xml.sax.SAXParseException: Attribute value "Cell Style" of type NMTOKEN must be a name token.
org.xml.sax.SAXParseException: Attribute "calculation" with value "DistinctCount" must have a value from the list "Nothing Count Sum Average Lowest Highest StandardDeviation Variance System First ".
org.xml.sax.SAXParseException: Element type "sortField" must be declared.

 

As I said it appears those exceptions are correct. Any idea why this works anywhere or why it fails only on this one machine?

 

Thanks,

Greg

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Thanks for your response, but I don't see how that could be. Here is how I set my classpath in the Ant script:

 

Code:
<path id="runtime.classpath">
<pathelement location="${tomcat.home}/common/lib/mysql-connector-java-3.1.10-bin.jar"/>

<fileset dir="${lib.dir}">
<include name="**/*.jar">
</include>
</fileset>

<pathelement path="${webapp.home}/WEB-INF/classes"/>
</path>

 

and here is the snippet where I call the jrc task:

 

Code:
[code]<taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask">
<classpath refid="runtime.classpath"/>
</taskdef>

<jrc destdir="${target.dir}">
<src>
<fileset dir="${jasper.src.dir}">
<include name="**/*.jrxml"/>
</fileset>
</src>
<classpath refid="runtime.classpath"/>
</jrc>

 

Here are all the JAR files that end up included in that (same war file deployed on QA and PROD - ant script works on PROD, but not QA). The WEB-INF/classes directory is also included, but it only includes our application classes. To the best of my knowledge there is nothing else in the classpath.

 

Code:
[code]mysql-connector-java-3.1.10-bin.jar
PSE_Lite-1.0.0.jar
activation-1.1.jar
antlr-2.7.6rc1.jar
asm-1.5.3.jar
asm-attrs-1.5.3.jar
cglib-2.1_3.jar
commons-beanutils-1.7.0.jar
commons-chain-1.1.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-digester-1.7.jar
commons-el-1.0.jar
commons-fileupload-1.0.jar
commons-lang-2.1.jar
commons-logging-1.0.jar
commons-validator-1.3.1.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
el-api-1.0.jar
el-ri-1.0.jar
gateKeeper-1.0.0.jar
hibernate-3.1.3.jar
itext-1.3.1.jar
jasperreports-1.3.4.jar
jcommon-1.0.0.jar
jdtcore-3.1.0.jar
jfreechart-1.0.1.jar
jsf-facelets-1.1.10.jar
jstl-1.1.2.jar
jta-1.0.1B.jar
log4j-1.2.13.jar
mail-1.4.jar
myfaces-api-1.1.0.jar
myfaces-impl-1.1.5.jar
oro-2.0.8.jar
poi-2.0-final-20040126.jar
portlet-api-1.0.jar
rhino-1.0.0.jar
scripting-1.0.0.jar
shale-application-1.0.4.jar
shale-core-1.0.4.jar
shale-remoting-1.0.4.jar
standard-1.1.2.jar
tagHandlers-0.9.jar
tomahawk-1.1.6.jar
xml-apis-1.3.02.jar

 

There is no global $CLASSPATH set on either box.

 

Thanks,

Greg

Link to comment
Share on other sites

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...