• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

developing spell checker?

 
kaviyazhagan kajendiran
Greenhorn
Posts: 4
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am developing spell checker as web baesed application when run my file the below exception is throwed?

Thanks in advance

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: Failed to load built-in Java rules for language English
de.danielnaber.languagetool.JLanguageTool.getAllBuiltinRules(JLanguageTool.java:264)
de.danielnaber.languagetool.JLanguageTool.<init>(JLanguageTool.java:147)
de.danielnaber.languagetool.JLanguageTool.<init>(JLanguageTool.java:124)
NoOfStatements.doPost(NoOfStatements.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.reflect.InvocationTargetException
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:532)
de.danielnaber.languagetool.JLanguageTool.getAllBuiltinRules(JLanguageTool.java:252)
de.danielnaber.languagetool.JLanguageTool.<init>(JLanguageTool.java:147)
de.danielnaber.languagetool.JLanguageTool.<init>(JLanguageTool.java:124)
NoOfStatements.doPost(NoOfStatements.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.RuntimeException: Path /en/det_a.txt not found in class path at /rules/en/det_a.txt
de.danielnaber.languagetool.databroker.DefaultResourceDataBroker.assertNotNull(DefaultResourceDataBroker.java:233)
de.danielnaber.languagetool.databroker.DefaultResourceDataBroker.getFromRulesDirAsStream(DefaultResourceDataBroker.java:208)
de.danielnaber.languagetool.rules.en.AvsAnRule.<init>(AvsAnRule.java:59)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:532)
de.danielnaber.languagetool.JLanguageTool.getAllBuiltinRules(JLanguageTool.java:252)
de.danielnaber.languagetool.JLanguageTool.<init>(JLanguageTool.java:147)
de.danielnaber.languagetool.JLanguageTool.<init>(JLanguageTool.java:124)
NoOfStatements.doPost(NoOfStatements.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is one exception which has two backing causes. So let's go through them.

The outer most exception is this:
This one is not the main problem; it is caused by another one:
On line 252 of file JLanguageTool.java you use reflection to create a new instance of some class. This is what is actually throwing the exception. So we go deeper:
Line 59 of file AvsAnRule.java is throwing a RuntimeException, because it can't find a file (/en/det_a.txt) where it thinks there should be one. This is your own class so you know more about it, but I notice that one path starts with /rules and the other doesn't.
 
Sammy Starshanks
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a similar issue and found the key phrase "/en/det_a.txt" only here and one other site.

When I extracted the zip, the preferences in my zip program did not properly expand the directories. Try this:

Unzip the entire "standalone" version of the zip file from the http://www.languagetool.org/ website to the classpath (root) of your java project.

That worked for me. Good luck.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic