English 中文(简体)
org.xml.sax.SAXParseException with JasperReports [closed]
原标题:

Closed. This question needs debugging details. It is not currently accepting answers.


Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Closed 2 years ago.

Sorry for dummy question, but i lost my whole day to start with JasperReport. The problem is that i always receive this exception: "org.xml.sax.SAXParseException: Premature end of file." when i am trying to read .jrxml file. It is not possible to not to be well-formed, because its generated with iReport.

I asked in jasper forums, but no solution up to now. When I searched about this error in web, generally its involved with WebService technologies, but i`m running my app in local db connection without application container. Any ideas?

Thanks in advance.

问题回答

You may want to make sure your iReport installation is using an appropriate iText jar. If you are using iReport with JasperServer you will want to verify that both are using the same version of iText. The last time I saw this error in this context it turned out the JasperServer install was using an older version of iText than iReport - and it required the older version. Using the same jar for both products resolved the issue.

The version of JasperReports in your application is probably different than the one in your application.

Did you make the file with iReport and trying to open it in the same iReport or another iReport version?

Possible problems:

  • The file has been made in iReport and opened in another version.
  • The file is made with iReport then the XML source is modified outside iReport.

I hope you have an SVN where a previous version of the files exists, if so, try to compare them. Another suggestion, if the file is on a remote folder (ie. server) copy it to local folder and try.

Another guess, are you trying to compile the file with JasperReports? This is a common problem when the file is made with iReport version and the JasperReport is older or newer. Make sure the jasperreports*.jar files in the iReport directory, are the same as the ones you are using to compile in your project.

UPDATE: Take a look here at JavaForums, a missing xsd/dtd or saaj.jar could cause this problem.

check settings under
C:UsersXXXXX.ireport3.7.0configWindows2LocalComponents
maybe some configuration files is destroyed





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签