We're updating the issue view to help you get more done. 

NPE when loading invalid stopwords file

Description

It seems that when I define an Analyzer needing a resourcefile, like a file containing the stopwords, and this file doesn't exist, a NullPointerException is thrown instead of saying that the file was not found.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [java] Caused by: org.hibernate.HibernateException: could not init listeners [java] at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205) [java] at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1983) [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845) [java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902) [java] ... 4 more [java] Caused by: java.lang.NullPointerException [java] at java.io.Reader.<init>(Reader.java:61) [java] at java.io.InputStreamReader.<init>(InputStreamReader.java:80) [java] at org.hibernate.search.util.HibernateSearchResourceLoader.getLines(HibernateSearchResourceLoader.java:63) [java] at org.apache.solr.analysis.BaseTokenStreamFactory.getWordSet(BaseTokenStreamFactory.java:109) [java] at org.apache.solr.analysis.StopFilterFactory.inform(StopFilterFactory.java:50) [java] at org.hibernate.search.impl.SolrAnalyzerBuilder.injectResourceLoader(SolrAnalyzerBuilder.java:112) [java] at org.hibernate.search.impl.SolrAnalyzerBuilder.buildAnalyzer(SolrAnalyzerBuilder.java:88) [java] at org.hibernate.search.impl.ConfigContext.buildAnalyzer(ConfigContext.java:249) [java] at org.hibernate.search.impl.ConfigContext.initLazyAnalyzers(ConfigContext.java:217) [java] at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:405) [java] at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:262) [java] at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:144) [java] at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:150) [java] at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198) [java] at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181) [java] at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194) [java] ... 7 more

Environment

None

Status

Assignee

Unassigned

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Fix versions

Affects versions

3.3.0.Final

Priority

Trivial