bmorreal
1st November 2007, 07:40 PM
Can anyone see why I would get the following error:
java.lang.ArrayIndexOutOfBoundException: 1
at com.wallstreetwise.app.jspell.domain.JSpellIndex.e nglishChecks(JSpellIndex.java:1021)
at com.wallstreetwise.app.jspell.domain.JSpellIndex.s earch(JSpellIndex.java:777)
at com.wallstreetwise.app.jspell.domain.JSpellDiction aryLocal.checkWord(JSpellDictionaryLocal.java:217)
at com.wallstreetwise.app.jspell.domain.JSpellParser. getError(JSpellParser.java:243)
at com.harris.atep.utils.spellcheck.AlumniTodaySpellC heck.getSpellandVulgarInfo(AlumniTodaySpellCheck.j ava:108)
at com.harris.atep.service.scheduler.AlumniTodaySpell Job.executeInternal(AlumniTodaySpellJob.java:89)
at org.springframework.scheduling.quartz.QuartzJobBea n.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:2 02)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run (SimpleThreadPool.java:529)
The error originates on a call to parser.getError() as marked bellow:
<snip>
parser = new JSpellParser( jdLocal );
for (Map.Entry<String, String> fieldMap : stringMap.entrySet()) { // iterate over the 4 fields
spellErrorCount = 0;
vulgarErrorCount = 0;
suggestions = null;
String fieldValue = fieldMap.getValue();
if (null != fieldValue) {
parser.setTextString( fieldValue );
try {
JSpellErrorInfo error = parser.getError();
while ( error != null ) {
// logger.info( "error toTokenizedString= " + error.toTokenizedString());
// logger.info( "error length= " + error.getSuggestions().length);
suggestions = error.getSuggestions(); // should only be one as defined by props file
if ( (suggestions.length > 0) && (suggestions[0] != null) ) {
if ( !suggestions[0].startsWith( "*")) {
spellErrorCount++;
} else if ( suggestions[0].startsWith( "*")) {
vulgarErrorCount++;
} else {
spellErrorCount++;
}
} else {
spellErrorCount++; // why was error != null anyway?
}
error = parser.getError(); // <-- error occurs here get next error in fieldValue
suggestions = null;
}
<snip>
Any ideas? I am using JDK 1.5.0_11 and JRE 1.5
java.lang.ArrayIndexOutOfBoundException: 1
at com.wallstreetwise.app.jspell.domain.JSpellIndex.e nglishChecks(JSpellIndex.java:1021)
at com.wallstreetwise.app.jspell.domain.JSpellIndex.s earch(JSpellIndex.java:777)
at com.wallstreetwise.app.jspell.domain.JSpellDiction aryLocal.checkWord(JSpellDictionaryLocal.java:217)
at com.wallstreetwise.app.jspell.domain.JSpellParser. getError(JSpellParser.java:243)
at com.harris.atep.utils.spellcheck.AlumniTodaySpellC heck.getSpellandVulgarInfo(AlumniTodaySpellCheck.j ava:108)
at com.harris.atep.service.scheduler.AlumniTodaySpell Job.executeInternal(AlumniTodaySpellJob.java:89)
at org.springframework.scheduling.quartz.QuartzJobBea n.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:2 02)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run (SimpleThreadPool.java:529)
The error originates on a call to parser.getError() as marked bellow:
<snip>
parser = new JSpellParser( jdLocal );
for (Map.Entry<String, String> fieldMap : stringMap.entrySet()) { // iterate over the 4 fields
spellErrorCount = 0;
vulgarErrorCount = 0;
suggestions = null;
String fieldValue = fieldMap.getValue();
if (null != fieldValue) {
parser.setTextString( fieldValue );
try {
JSpellErrorInfo error = parser.getError();
while ( error != null ) {
// logger.info( "error toTokenizedString= " + error.toTokenizedString());
// logger.info( "error length= " + error.getSuggestions().length);
suggestions = error.getSuggestions(); // should only be one as defined by props file
if ( (suggestions.length > 0) && (suggestions[0] != null) ) {
if ( !suggestions[0].startsWith( "*")) {
spellErrorCount++;
} else if ( suggestions[0].startsWith( "*")) {
vulgarErrorCount++;
} else {
spellErrorCount++;
}
} else {
spellErrorCount++; // why was error != null anyway?
}
error = parser.getError(); // <-- error occurs here get next error in fieldValue
suggestions = null;
}
<snip>
Any ideas? I am using JDK 1.5.0_11 and JRE 1.5