Jump to content
Changes to the Jaspersoft community edition download ×

Getting Started: cannot compile sample reports


atroutt

Recommended Posts

I downloaded JasperReports 3.5.2 and am following the getting started instructions. I went into the barbeque sample and successfully compiled the java source, but when I try to compile the xml report and produce the .jasper file I get an arrayoutofbounds exception.

I am running  ubuntu 8.10 64-bit

jdk: java-6-sun-1.6.0.10

ant: Apache Ant version 1.7.1

Here is the output when I run ant compile after executing ant javac in the jasperreports-3.5.2/demo/samples/barbecue directory:


Buildfile: build.xml

compile:
    [mkdir] Created dir: /opt/jasperreports/jasperreports-3.5.2/demo/samples/barbecue/build/reports
      [jrc] Compiling 1 report design files.
      [jrc] java.lang.ArrayIndexOutOfBoundsException: 3128
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8492)
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8656)
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8621)
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:7420)
      [jrc]     at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:289)
      [jrc]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
      [jrc]     at net.sf.jasperreports.engine.design.JRJdtCompiler.compileUnits(JRJdtCompiler.java:192)
      [jrc]     at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:192)
      [jrc]     at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
      [jrc]     at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135)
      [jrc]     at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:117)
      [jrc]     at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:413)
      [jrc]     at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:259)
      [jrc]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [jrc]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [jrc]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [jrc]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [jrc]     at java.lang.reflect.Method.invoke(Method.java:597)
      [jrc]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      [jrc]     at org.apache.tools.ant.Task.perform(Task.java:348)
      [jrc]     at org.apache.tools.ant.Target.execute(Target.java:357)
      [jrc]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [jrc]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
      [jrc]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      [jrc]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [jrc]     at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
      [jrc]     at org.apache.tools.ant.Main.runBuild(Main.java:758)
      [jrc]     at org.apache.tools.ant.Main.startAnt(Main.java:217)
      [jrc]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
      [jrc]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
      [jrc] File : /opt/jasperreports/jasperreports-3.5.2/demo/samples/barbecue/reports/BarbecueReport.jrxml ... FAILED.
      [jrc] Error compiling report design : /opt/jasperreports/jasperreports-3.5.2/demo/samples/barbecue/reports/BarbecueReport.jrxml
      [jrc] net.sf.jasperreports.engine.JRException: Error compiling report design.
      [jrc]     at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:233)
      [jrc]     at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
      [jrc]     at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135)
      [jrc]     at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:117)
      [jrc]     at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:413)
      [jrc]     at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:259)
      [jrc]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [jrc]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [jrc]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [jrc]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [jrc]     at java.lang.reflect.Method.invoke(Method.java:597)
      [jrc]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      [jrc]     at org.apache.tools.ant.Task.perform(Task.java:348)
      [jrc]     at org.apache.tools.ant.Target.execute(Target.java:357)
      [jrc]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [jrc]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
      [jrc]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      [jrc]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [jrc]     at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
      [jrc]     at org.apache.tools.ant.Main.runBuild(Main.java:758)
      [jrc]     at org.apache.tools.ant.Main.startAnt(Main.java:217)
      [jrc]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
      [jrc]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
      [jrc] Caused by: java.lang.ArrayIndexOutOfBoundsException: 3128
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8492)
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8656)
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8621)
      [jrc]     at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:7420)
      [jrc]     at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:289)
      [jrc]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
      [jrc]     at net.sf.jasperreports.engine.design.JRJdtCompiler.compileUnits(JRJdtCompiler.java:192)
      [jrc]     at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:192)
      [jrc]     ... 22 more

BUILD FAILED
/opt/jasperreports/jasperreports-3.5.2/demo/samples/barbecue/build.xml:32: Errors were encountered when compiling report designs.
 

---------------

I also tried other samples in the samples directory and got the same error each time. I searched for this error and was not able to find anything. Any tips would be greatly appreciated!



Post Edited by atroutt at 07/09/2009 13:59
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

Something must be wrong with the JDT compiler which does not seem to function properly in your environment.

I have tested everything on Ubuntu and it worked here. I have not tried the exact versions you have, but still, there's no sign of something wrong in our distribution.

I don't know what is wrong, but I can give you a quick fix to get passed this.

Remove the jdt-compile-3.1.1.jar file from the project's /lib folder and make sure javac.exe is in the path.

This way the JR report compilation process will use the JDK compiler and you get passed the mentioned error (hpefully).

 

I hope this helps.

Teodor

 

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