0 Replies Latest reply on Aug 28, 2008 12:38 PM by Brian Bernstein

    NullPointerException when instantiating a POJO

    Brian Bernstein Newbie

      We are using both JBoss 4.2.2. and 4.2.3 in development of an application that employs the use of lucene.

      Occasionally, when instantiating the IndexWriter, which is a lucene POJO for add/updating documents in their index, we get this NullPointerException:

      at org.jboss.mx.loading.LoadMgr3.endLoadTask(LoadMgr3.java:508)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:541)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at com.indorsetech.beans.LuceneBean$WopThread.getIndexWriter(LuceneBean.java:407)

      The line in which the instantiation occurs is this:
      indexWriter = new IndexWriter(indexPath, new StandardAnalyzer(), false);

      All the line is doing is creating a new IndexWriter with the index path set in indexPath. The stack trace seems to suggest that this is an issue with Jboss's classloader. Has anyone else seen this when trying to use external libraries which are placed in the JBoss' library path?

      This only occurs about 10 to 20% of the time when the JBoss server is started. When it occurs, the server needs to be restart in order to resolve the issue. Additionally, when this occurs, the server hangs on shutdown and needs to be killed explicitly (SIGTERM) before it can be restarted again.

      We've never experienced this issue in JBoss version 4.0.5. It seems to have started to occur when we upgraded to version 4.2.2/4.2.3.

      Any help in troubleshooting this issue would be greatly appreciated, thank you in advance.