jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magnus Grimsell" <magnus.grims...@idainfront.se>
Subject RE: exception in indexer when creating versionable node
Date Thu, 26 Oct 2006 09:56:32 GMT
Hi Marcel,

After I register the node types I create some nodes. The exception comes on session.save().
I also just realized that this only happens for nodes with the mix:versionable mixin.

I'll see if I can make a small and clean test case that reproduces this bug.

Thanks,
Magnus Grimsell


ALLVARLIG: Synchronous EventConsumer threw exception.
java.lang.NullPointerException
	at org.apache.jackrabbit.core.query.lucene.NodeIndexer.createDoc(NodeIndexer.java:141)
	at org.apache.jackrabbit.core.query.lucene.NodeIndexer.createDocument(NodeIndexer.java:115)
	at org.apache.jackrabbit.core.query.lucene.SearchIndex.createDocument(SearchIndex.java:459)
	at org.apache.jackrabbit.core.query.lucene.SearchIndex$2.next(SearchIndex.java:302)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.update(MultiIndex.java:322)
	at org.apache.jackrabbit.core.query.lucene.SearchIndex.updateNodes(SearchIndex.java:290)
	at org.apache.jackrabbit.core.SearchManager.onEvent(SearchManager.java:471)
	at org.apache.jackrabbit.core.observation.EventConsumer.consumeEvents(EventConsumer.java:231)
	at org.apache.jackrabbit.core.observation.ObservationDispatcher.dispatchEvents(ObservationDispatcher.java:201)
	at org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:430)
	at org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher.dispatch(DelegatingObservationDispatcher.java:123)
	at org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher.dispatchEvents(DelegatingObservationDispatcher.java:99)
	at org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:430)
	at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:657)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:747)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:325)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:301)
	at org.apache.jackrabbit.core.version.AbstractVersionManager.createVersionHistory(AbstractVersionManager.java:254)
	at org.apache.jackrabbit.core.version.VersionManagerImpl$1.run(VersionManagerImpl.java:207)
	at org.apache.jackrabbit.core.version.VersionManagerImpl$DynamicESCFactory.doSourced(VersionManagerImpl.java:579)
	at org.apache.jackrabbit.core.version.VersionManagerImpl.createVersionHistory(VersionManagerImpl.java:204)
	at org.apache.jackrabbit.core.version.XAVersionManager.createVersionHistory(XAVersionManager.java:147)
	at org.apache.jackrabbit.core.ItemImpl.initVersionHistories(ItemImpl.java:771)
	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1181)
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:817)
	
> -----Original Message-----
> From: Marcel Reutegger [mailto:marcel.reutegger@gmx.net]
> Sent: Thursday, October 26, 2006 11:36 AM
> To: dev@jackrabbit.apache.org
> Subject: Re: exception in indexer when creating versionable node
> 
> 
> Hi Magnus,
> 
> I tried to reproduce the problem you described. However I was 
> not able to do so. 
> at least not with the exception you described. What I see is 
> an error in the log 
> file, when node types are registered on a repository that was 
> started for the 
> very first time:
> 
> 26.10.2006 10:36:02 *ERROR* [main] 
> VirtualNodeTypeStateManager: Unable to index 
> new nodetype: javax.jcr.ItemNotFoundException 
> (VirtualNodeTypeStateManager.java, 
> line 159)
> 
> I've created a jira issue which might be related to the 
> behaviour you see in 
> your setup:
> 
> http://issues.apache.org/jira/browse/JCR-605
> 
> btw. what actions do you perform on the repository after you 
> register the node 
> types? Or does the NullPointerException already occur when 
> you register the node 
> types?
> 
> regards
>   marcel
> 
> Magnus Grimsell wrote:
> > I have the same problem in my unit tests where I create a 
> new repository for every test.
> > I have to restart the repository in order to get the tests to work.
> > 
> > This is my setup code:
> > 
> > File tmpDir = getTmpDir();
> > InputStream xml = 
> getResource("iipax/generic/jcr/test/repository.xml");
> > RepositoryConfig repoConf =
> > 	RepositoryConfig.create(xml, tmpDir.getAbsolutePath());
> > 
> > mRepository = RepositoryImpl.create(repoConf);
> > Session session = mRepository.login();
> > 
> > NamespaceRegistry nsReg = 
> session.getWorkspace().getNamespaceRegistry();
> > nsReg.registerNamespace(JcrFactory.NAMESPACE_PREFIX, 
> JcrFactory.NAMESPACE);
> > 
> > JackrabbitNodeTypeManager manager =
> > 	
> (JackrabbitNodeTypeManager)session.getWorkspace().getNodeTypeM
> anager();
> > InputStream nodeTypes = getNodeTypeConfig();	
> > manager.registerNodeTypes(nodeTypes, 
> JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
> > session.save();
> > session.logout();
> > 
> > // this is done to avoid NullPointerException in NodeIndexer
> > mRepository.shutdown();
> > mRepository = RepositoryImpl.create(repoConf);
> > 
> 
> 

Mime
View raw message