Jump to content
Changes to the Jaspersoft community edition download ×

java.lang.ArrayIndexOutOfBoundsException: -2


maxence.dewil

Recommended Posts

Hello all,

 

I have a compilation problem.

 

The report compilation works fine in IREPORT 1.2.7 but when I try to compile from my java code the following exception is thrown.

 

Caused by: java.lang.ArrayIndexOutOfBoundsException: -2

at org.eclipse.jdt.internal.compiler.parser.Parser.consumeBinaryExpression(Parser.java:1325)

 

I spent hours to find a solution.. I don't know what to do. My application runs on WebSphere 5.1.11 and IBM JDK 1.4. I tried the BSH compiler but it does not work anymore, even in IREPORT..

 

I have attached the full stack trace. Thx in advance for your responses.

 

 

 

[file name=StackTrace.txt size=1524]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/StackTrace.txt[/file]

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

This is an error comming from the JDT compiler.

What exactly is the version of the JDT jar you are using?

Are you using the one we ship with the JR distribution?

As for the BSH compiler, what exactly is the problem with it? As you probably saw, we now ship it as a separate source file in one of the samples, and no longer as part of the library. Are you sure you run the latest version of the report compiler?

 

If JDT and BSH do not work, then you might try simply remove the jars from the classpath and let JR use the plain Java compiler that comes with your IBM JDK.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

Hi,

 

1. jdt-compiler-3.1.1.jar (included in jasperreports-1.2.7-project.zip) .

 

2. When I try to compile my jrxml with BSH (bsh-1.3.0.jar & jr-bsh-compiler.jar):

java.lang.NoSuchMethodError: net.sf.jasperreports.engine.JRExpression.getName()Ljava/lang/String; at net.sf.jasperreports.engine.design.JRBshGenerator.generateMethod(JRBshGenerator.java:363)

 

3. Now I am using the Java compiler, it works but slowly.

 

Max

Link to comment
Share on other sites

Hi,

 

2) If you take a look at the current JRBshGenerator class on our SVN repository, you can see that line 363 does not correspond to what you have in the exception stack trace. So the cause of the BSH not working might be a version mismatch.

http://www.jasperforge.org/integration/viewcvs/viewcvs.cgi/trunk/jasperreports/demo/samples/beanshell/src/net/sf/jasperreports/compilers/JRBshGenerator.java?root=jasperreports&system=exsy1002&view=markup

 

As for 1), I don't see what could be wrong. Maybe if you could attach here some of your files.

 

Thank you,

Teodor

Link to comment
Share on other sites

  • 2 years later...

hi, I am facing the same problem but with all this my problem is still not solved ,Please suggest me....

here are the logs details: -

[5/13/09 16:49:27:531 IST] 00000039 SystemErr     R java.lang.ArrayIndexOutOfBoundsException: -2
 at org.eclipse.jdt.internal.compiler.parser.Parser.consumeBinaryExpression(Parser.java:1325)
 at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5961)
 at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8491)
 at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8656)
 at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8621)
 at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:7420)
 at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:289)
 at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
 at net.sf.jasperreports.engine.design.JRJdtCompiler.compileUnits(JRJdtCompiler.java:192)
 at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:192)
 at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
 at com.iflex.fcat.reports.Jasper.JasperReportsEngine.loadConfig(JasperReportsEngine.java:237)
 at com.iflex.fcat.reports.BaseReportsEngine.execute(BaseReportsEngine.java:206)

 at com.iflex.fcat.admin.FAdminAlertSummaryReportGenerateBean.executeReport(FAdminAlertSummaryReportGenerateBean.java:440)
 at com.iflex.fcat.admin.FAdminAlertSummaryReportGenerateBean.doProcess(FAdminAlertSummaryReportGenerateBean.java:255)

 

[5/13/09 16:49:27:547 IST] 00000039 SystemErr     R net.sf.jasperreports.engine.JRException: Error compiling report design.
 at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:233)
 at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
 at com.iflex.fcat.reports.Jasper.JasperReportsEngine.loadConfig(JasperReportsEngine.java:237)
 at com.iflex.fcat.reports.BaseReportsEngine.execute(BaseReportsEngine.java:206)
 at com.iflex.fcat.admin.FAdminAlertSummaryReportGenerateBean.executeReport(FAdminAlertSummaryReportGenerateBean.java:440)
 at com.iflex.fcat.admin.FAdminAlertSummaryReportGenerateBean.doProcess(FAdminAlertSummaryReportGenerateBean.java:255)
 

Please help ASAP...

Link to comment
Share on other sites

mayur_7786
Wrote:

[5/13/09 16:49:27:531 IST] 00000039 SystemErr     R java.lang.ArrayIndexOutOfBoundsException: -2
 at org.eclipse.jdt.internal.compiler.parser.Parser.consumeBinaryExpression(Parser.java:1325)

Do you have aspectjtools.jar on your application's classpath?  This seems to be one of the causes of this error, as stated here.

Regards,

Lucian

Link to comment
Share on other sites

Thanks Lucian,

You are right This aspectjtools.jar was there in my applications classpath and I have removed it,and the problem is solved,Very very thanks to you. I was Fighting since 2 weeks for the problem :) and finally able to solve with your help. Thanks for the help...

Regards,

Mayur

 



Post Edited by mayur_7786 at 05/21/2009 06:44
Link to comment
Share on other sites

hi Lucian,

You are right I was using aspectjtools.jar in my applications classpath, I have removed it and my problem is solved.Thanks for your suggestion.

I was fighting since 2-weeks for the same problem and with your help I am able to solve the problem.

Thanks Very Much... :)

 

Regards,

Mayur

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