aspose file tools*
The moose likes Tomcat and the fly likes developing spell checker? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "developing spell checker?" Watch "developing spell checker?" New topic
Author

developing spell checker?

kaviyazhagan kajendiran
Greenhorn

Joined: Apr 24, 2011
Posts: 4

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

Joined: Oct 27, 2005
Posts: 19670
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Sammy Starshanks
Greenhorn

Joined: Jul 21, 2012
Posts: 1
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.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: developing spell checker?