Hello everybody,

I have run into a rather weird problem that occurs when deploying a Grails (http://grails.codehaus.org/) app as a WAR file in Tomcat. My app instantiates a NutchDocumentAnalyzer during startup as a Spring resource. The Nutch classes and config files are loaded from a JAR inside the lib directory of the app. All of this works fine when running the app via 'grails run-app'. However, when running the app under Tomcat via the WAR file generated by 'grails war' I get the following stacktrace (excerpt):

Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.nutch.analysis.NutchDocumentAnalyzer]: Constructor threw exception; nested exception is java.lang.NullPointerException at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:98) at org .springframework .beans .factory .support .SimpleInstantiationStrategy .instantiate(SimpleInstantiationStrategy.java:87) at org .springframework .beans .factory .support .ConstructorResolver.autowireConstructor(ConstructorResolver.java:233)
        ... 63 more
Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:61)
        at java.io.BufferedReader.<init>(BufferedReader.java:76)
        at java.io.BufferedReader.<init>(BufferedReader.java:91)
        at org.apache.nutch.analysis.CommonGrams.init(CommonGrams.java:152)
        at org.apache.nutch.analysis.CommonGrams.<init>(CommonGrams.java:52)
at org.apache.nutch.analysis.NutchDocumentAnalyzer $ContentAnalyzer.<init>(NutchDocumentAnalyzer.java:64) at org .apache .nutch .analysis.NutchDocumentAnalyzer.<init>(NutchDocumentAnalyzer.java:55) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun .reflect .NativeConstructorAccessorImpl .newInstance(NativeConstructorAccessorImpl.java:39) at sun .reflect .DelegatingConstructorAccessorImpl .newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:83)
        ... 65 more

This is caused by the common-terms.utf8 file not being found in line 152 of org.apache.nutch.analysis.CommonGrams. However, this file is located on the root level of the nutch.jar in the lib directory that also contains the classes themselves. I have also tried copying the file to TOMCAT/webapps/MY_APP/WEB-INF/classes, TOMCAT/webapps/MY_APP/ WEB-INF/ and TOMCAT/webapps/MY_APP/WEB-INF/lib, all to no avail.

Does anybody know what this could possibly be caused by?

--
Best regards,
Bjoern Wilmsmann



Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to