tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Björn Wilmsmann <bjo...@wilmsmann.de>
Subject Config file not found in class path when deploying WAR
Date Mon, 28 Jan 2008 23:39:32 GMT
Hello everybody,

I have run into a rather weird problem that occurs when deploying a  
web app - which by the way is a Grails (http://grails.codehaus.org)  
app - as a WAR file in Tomcat. My app makes use of Nutch and  
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 the 'grails run-app'  
command supplied by Grails. However, when running the app under Tomcat  
from a 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 have an idea what this could possibly be caused by?

--
Best regards,
Bjoern Wilmsmann




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message