Note that there are some explanatory texts on larger screens.

plurals
  1. POJBEHAVE-JXL : java.lang.ArrayIndexOutOfBoundsException: 39181
    text
    copied!<p>JXL VERSION = 2.6.12 </p> <p>JBEHAVE VERSION: 3.6.8</p> <p>EXCEL :MS EXCEL 2007</p> <p>I am reading excel in my Jbehave step class from class path as below and getting ArrayIndexOutOfBoundsException. The same code is working in standalone java code</p> <blockquote> <p>Workbook workbook = null; InputStream stream =this.getClass().getClassLoader().getResourceAsStream("test.xls"); workbook = Workbook.getWorkbook(stream); Sheet sheet = workbook.getSheet(0); Cell a1 = sheet.getCell(0,0);</p> </blockquote> <p>However If I use File System path to read excel in Jbehave Project, I am able to load and read the content from the sheet in excel</p> <blockquote> <p>workbook = Workbook.getWorkbook(new File("test.xls "));</p> </blockquote> <p>Below is the stack trace:</p> <blockquote> <p>java.lang.ArrayIndexOutOfBoundsException: 39181 at jxl.read.biff.Record.(Record.java:79) at jxl.read.biff.File.next(File.java:181) at jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:569) at jxl.Workbook.getWorkbook(Workbook.java:271) at jxl.Workbook.getWorkbook(Workbook.java:253) at org.teststepgiven.steps.Test.test(Test.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:537) at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:477) at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:457) at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:421) at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:297) at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:211) at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:172) at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229) at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload