-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate search - does not find directory of index!
PostPosted: Sun Sep 19, 2010 12:40 pm 
Beginner
Beginner

Joined: Sun Jan 24, 2010 3:04 am
Posts: 20
Hi,

When I start my tomcat server, I get the following exception:

Code:
org.hibernate.search.SearchException: Unable to create index directory: \\mycomputerip\C$\Devel\workspace\On\HibernateSearch\indexes for index com.mycompany.model.Company


This is quite interesting, since I DO have a folder there with this name + read/write permissions for anybody.

As well, it happens only from one computer, not on all of them!

What could be the reason?

EDIT:
I am using Windows 7 for that computer.

I saw in an answer: http://stackoverflow.com/questions/1723 ... ot-present
that Windows 7 uses virtual storing, so the access has to be different.

How can I workaround it? Since

org.hibernate.search.store.DirectoryProviderHelper.makeSanityCheckedDirectory is Hibernate class!


Top
 Profile  
 
 Post subject: Re: Hibernate search - does not find directory of index!
PostPosted: Sun Sep 19, 2010 6:03 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
could you please post the full stacktrace and Search version?

BTW if you're storing the index on a non-local drive, you likely won't get the best performance and might have issues with file locking - but of course your mileage by vary, and I have no experience with Windows 7.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate search - does not find directory of index!
PostPosted: Mon Sep 20, 2010 2:42 am 
Beginner
Beginner

Joined: Sun Jan 24, 2010 3:04 am
Posts: 20
Code:
2010-09-19 18:25:13,763 ERROR (            ContextLoader.java:219)     - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not init listeners
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:519)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.hibernate.HibernateException: could not init listeners
   at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
   at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1396)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
   at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
   ... 36 more
Caused by: org.hibernate.search.SearchException: Unable to initialize directory provider: com.sintecmedia.model.Company
   at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:132)
   at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProviders(DirectoryProviderFactory.java:86)
   at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:514)
   at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:171)
   at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:126)
   at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
   at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
   at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
   ... 44 more
Caused by: org.hibernate.search.SearchException: org.hibernate.search.SearchException: Unable to create index directory: \\mycomputerip\C$\Devel\workspace\On\HibernateSearch\indexes for index com.mycompany.model.Company
   at org.hibernate.search.store.DirectoryProviderHelper.makeSanityCheckedDirectory(DirectoryProviderHelper.java:200)
   at org.hibernate.search.store.DirectoryProviderHelper.getVerifiedIndexDir(DirectoryProviderHelper.java:183)
   at org.hibernate.search.store.FSDirectoryProvider.initialize(FSDirectoryProvider.java:63)
   at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:129)
   ... 51 more


Regarding your comment:
I have 2 servers: 1. with db + index 2. with tomcat
I have other computers for developers to check their application and they use the non local index.
do you recommend storing the index on the server with the db or the server with the tomcat?


Top
 Profile  
 
 Post subject: Re: Hibernate search - does not find directory of index!
PostPosted: Mon Sep 20, 2010 3:18 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
do you recommend storing the index on the server with the db or the server with the tomcat?

Store it on the same server as Tomcat, so all searches are performed on local disk: avoids network calls and enables buffering.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate search - does not find directory of index!
PostPosted: Mon Sep 20, 2010 3:23 am 
Beginner
Beginner

Joined: Sun Jan 24, 2010 3:04 am
Posts: 20
Thanks.

Regarding
Code:
org.hibernate.search.store.FSDirectoryProvider


I think to implement my own, declare it in
Code:
hibernate.search.default.directory_provider


and overwrite the method to adjust it to work with Windows 7.


Top
 Profile  
 
 Post subject: Re: Hibernate search - does not find directory of index!
PostPosted: Mon Sep 20, 2010 4:25 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
I think to implement my own

that's cool, and the most effective way to tackle this as you are in the best position to test it out.
It would be great if, when you're done, you could update this and tell what you had to do to get it working, so we might integrate it with Hibernate Search.
You might also want to open an issue on JIRA and attach a patch.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.