16

Downloaded iReport-4.6.0 for Linux and when creating a new report via the File->New... menu, the new report is not shown in the preview, but the error message cvc-complex-type.3.2.2 attribute 'uuid' is not allowed to appear in element 'jasperreport' instead.

The same error message happens even when choosing compatibility 4.5.0 in the options. The same error message happens also when opening a report file that was being produced by other users of iReport-4.6.0 (Windows).

The report files have their schema to http://jasperreports.sourceforge.net/xsd/jasperreport.xsd, but this schema file doesn't mention any uuid.

What could be the problem?

Markus Pscheidt
  • 6,853
  • 5
  • 55
  • 76
  • 1
    Odd. Choosing compatibility 4.5.0 in the options fixed it for me. Of course, I did have to make a change to the report and re-save it before it picked up on that. – ibrewster Feb 20 '13 at 19:02
  • I discovered that multiple classpath entries were the culprit, more specifically older versions of jasperreports-core-renderer.jar and jasperreports-extensions.jar together with the latest version. This situation happened when upgrading from a previous version of iReport to a newer version. At every upgrade the old versions remained and the new version were added. – Markus Pscheidt Mar 02 '13 at 12:31

11 Answers11

32

In iReport Designer, in the options window you can change compatibility mode to the version you prefer. For me if I put compatibility to jasperreport 3.5.1, when I save the report again, the uuid are all removed.

Regards

Marthym
  • 331
  • 3
  • 2
  • 3
    I'm not sure why this answer was rated down - it solved the issue for me. I chose version 4.5 rather than 3.5.1, since further research showed that the UUID was introduced with version 4.6. But this answer remains valid, and is CERTAINLY better than manually editing the files to remove the UUID every time you make a change. – ibrewster Feb 20 '13 at 18:58
  • 2
    Just to make the answer more clear we can change version @ Tools - Options - General - Compatibility - latest Version – tom Aug 12 '14 at 19:20
25

I found an answer:

I opened the JRXML file with notepad++ and did a "Search and Replace" of uuid="\w*-\w*-\w*-\w*-\w*", and selected REGULAR EXPRESSION, with empty string then all the occurrences of this wrong tag were removed.

Worked for me.

Delta
  • 537
  • 2
  • 5
  • 19
Inca
  • 274
  • 3
  • 2
  • Thanks. Does it mean that the uuid tag is there erroneously in the .jrxml files? In other words, iReport (or jasperreports) adds a uuid tag that is not valid according to its own schema definition? – Markus Pscheidt Jul 16 '12 at 20:19
  • 1
    I think that is true.. Because if you search for it, there is an ISSUE in the JASPERREPORT site about this tag, here, http://jasperforge.org/projects/ireport/tracker/view.php?id=5784.. Sorry for the late reply ... – Inca Jul 23 '12 at 13:03
  • 1
    The link to the issue has changed: http://community.jaspersoft.com/ireport-designer/issues/5784 – t3chris Oct 19 '12 at 10:22
  • hello inca ,i am having same problem. Do you mean replace uuid with \w*-w*-\w*-\w*-\w* – Krishna Shrestha Dec 15 '12 at 16:28
  • 1
    Marthym's answer below is much easier than this - and continues to work even when changes are made. While this answer does work, you have to repeat it every time you make any changes in iReport Designer. With Marthym's answer, you just set it and forget it. – ibrewster Feb 20 '13 at 19:00
  • 2
    This is not a good solution because if you modify the report all uuids are back again. – Yebach Sep 19 '14 at 08:57
3

Open report in the notpad++ and just only remove uuid and it's number.. After You will compile proper and generate report.... I have same problem and I solveby this way..

Vishal Shah
  • 641
  • 6
  • 17
2

I do not use Linux .But you create report use iReport Designer-xx. You add Same version jasperreport(jasperreport-XX) jar in your project.

Sms Kopex
  • 223
  • 2
  • 8
2

I just suggested my coworker who also run into the problem this:

sed -i 's/ uuid="[^"]*"//g' $(find * -name \*.jrxml)

I don’t normally use sed(1)-i but she’s on GNU/Linux so it wasn’t a problem here. The more professional Unix way of solving this is:

find * -name \*.jrxml -print0 | while IFS= read -d '' -r file; do
    ed -s "$file" <<-'EOF'
        1,$g/ uuid="[^"]*"/s///g
        w
        q
    EOF
done

(These four spaces are tabs, otherwise it won’t work, and you need mksh(1) or another shell that can read NUL-separated input.)

You could also use Perl:

find * -name \*.jrxml -print0 | xargs -0 perl -pi -e 's/ uuid="[^"]*"//g'

Or something like that, anyway, depending on your needs, your xargs(1), etc. ;-)

mirabilos
  • 5,123
  • 2
  • 46
  • 72
  • Thank you. I publish my reports on JasperReports Server and I submit the export of the whole repository to a version control system (SVN, CVS, ...). To avoid any useless differences between different versions of the same file, I develop a script to remove useless properties and some other stuff from the exported files. I added this line of code to my script (it excludes binary files): find "$1" -name "*.data" -print | xargs file | grep text | cut -d: -f1 | xargs sed -i 's/ uuid="[^"]*"//g' – Federico Cattozzi Apr 10 '14 at 16:05
  • @FedericoCattozzi you're welcome, glad I could help you. Note that `find`/`xargs`/`grep` as you use it has problems with special chars and colons in filenames, and `file`'s output is not guaranteed to be stable, and `sed -i` is an unportable GNUism. But if it works on your system, no worries. (Feel free to upvote, though ;) – mirabilos Apr 10 '14 at 19:48
2

If you're using ireport 4.6 or greater, the best way to solve the issue with uuid is, use the similar ireport 4.6 or greater, as the uuid attribute is newly introduce from version 4.6. otherwise If you remove the uuid manually from the jrxml file, the uuid will again be placed in corresponding tags on the next compilation...

soft
  • 71
  • 1
  • 1
  • 3
1

This problem occurred in my case because of duplicated class path entries, more specifically entries from older versions of jasperreports-core-renderer.jar and jasperreports-extensions.jar (in Options -> Classpath).

These duplicated entries appeared after importing settings during an upgrade of iReport. Apparently this is due to a bug in iReport due to which old versions are not removed from the classpath.

So either avoid the import of settings from previous versions or manually remove outdated .jars.

Markus Pscheidt
  • 6,853
  • 5
  • 55
  • 76
1

I have a good easy solution.

I am supporting reports on Jasper Server 4.5, with Jasper Studio 5.5

  1. In Jasper Studio, delete the server reference if there is one.
  2. Recreate the connection. When you create the server connection, go to "Advanced Settings > Jasper Server Library Version" and select your server version from the list.
  3. Open your report, check that the uuid tags have been removed, Deploy
1

In my case I just removed uuid="63f04b11-4b7e-4cf1-99b5-a5ec6db799d6" I generated a sample report for testing it worked perfectly

So you can try by removing uuid=" "

Akitha_MJ
  • 3,882
  • 25
  • 20
1

You can always set the Compability to an older version, It worked for me.

Tools > Options > iReport > General > Compability

enter image description here

After this go to xaml and change any thing and save again then run report to remove all uuid .

Abd Abughazaleh
  • 4,615
  • 3
  • 44
  • 53
1

Strictly speaking this fix is only for Jaspersoft Studio, however this question is the first result when searching for the attribute 'uuid' is not allowed error.

For Jasper Server version <= 4.5.0 and Jaspersoft Studio 6.11:

  1. Right click on the jrxml file in the Project Explorer -> Properties -> Jaspersoft Studio -> Compatibility -> Source .jrxml Version -> JasperReports 4.5.0
  2. Right click on the server in the Repository Explorer -> Edit JasperReports Server Connection -> Advanced Settings -> JasperReports Library Version -> JasperReports 4.5.0

The second step is important if you are using Jaspersoft Studio to publish to the server.

Oliver Olding
  • 41
  • 1
  • 8