tag:blogger.com,1999:blog-785059744103848185.post3435612265210524839..comments2023-07-03T16:55:30.726+02:00Comments on jan blog: Eager fetching and searchable plugin in Grailsjanhttp://www.blogger.com/profile/09450549833036134264noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-785059744103848185.post-76849810803095400922009-10-22T15:50:47.178+02:002009-10-22T15:50:47.178+02:00Hi
Thanks for writing wonderfully on so many diff...Hi<br /><br />Thanks for writing wonderfully on so many different grails topics. While searchable plugin has been great to use during development and testing, deploying it with tomcat has not been easy. Tomcat would not deploy the application. Could you please take a few minutes to look at the errors and share your thoughts.<br /><br />Thank you so much.<br /><br /><br />SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener<br /><br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compassGps': Cannot resolve reference to bean 'compass' while setting bean property 'compass'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/plugins/searchable/compass/mapping/DefaultSearchableCompassClassMappingXmlBuilder$_buildClassMappingXml_closure1_closure4_closure12_closure13<br /><br />Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchableService': Cannot create inner bean '(inner bean)' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#2': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException<br /><br />Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchableService': Cannot create inner bean '(inner bean)' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#2': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException<br /> at java.security.AccessController.doPrivileged(Native Method)<br /> at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)<br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)<br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)<br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) <br /><br />Full log file is at<br />http://www.nabble.com/Tomcat-deploy-error---Searchable-plugin--td25981971.htmlSuryahttps://www.blogger.com/profile/05936339814291019984noreply@blogger.comtag:blogger.com,1999:blog-785059744103848185.post-22098478305169579472009-04-13T12:29:00.000+02:002009-04-13T12:29:00.000+02:00Hi Jan,the fetchMode is a GORM setting, and as suc...Hi Jan,<BR/><BR/>the fetchMode is a GORM setting, and as such only affects direct GORM queries. When issuing queries via the searchable plugin, the results are retrieved completely from the Lucene index rather than from the database. This is why the fetchMode has no effect on the searchable plugin (which shouldn't be a surprise actually). However, you can easily avoid having to re-fetch all the instances from the database by configuring the searchable mapping accordingly. There are two alternatives for that:<BR/><BR/>1) Map your associations as <B>searchable references</B>:<BR/><BR/>static searchable = {<BR/> publisher reference: true<BR/>}<BR/>(see <A HREF="http://www.grails.org/Searchable+Plugin+-+Mapping+-+Searchable+Reference" REL="nofollow">this</A>)<BR/><BR/>2) Map your associations as <B>searchable components</B>:<BR/><BR/>static searchable = {<BR/> publisher component: true<BR/>}<BR/>(see <A HREF="http://www.grails.org/Searchable+Plugin+-+Mapping+-+Searchable+Component" REL="nofollow">this</A>)<BR/><BR/>Both will cause the searchable plugin to include the associated class (Publisher) in the index, however there are differences wrt. which properties are searched when you issue a query. You should read the <A HREF="http://www.grails.org/Searchable+Plugin+-+Mapping+-+Compass+concepts" REL="nofollow">Compass concepts</A> docs for further details.<BR/><BR/>Hope this helps.<BR/><BR/>Cheers,<BR/>DanielDaniel Rinsernoreply@blogger.comtag:blogger.com,1999:blog-785059744103848185.post-27776755174653257812009-04-09T08:07:00.000+02:002009-04-09T08:07:00.000+02:00@JohnThanks for the advice. I will see to write so...@John<BR/>Thanks for the advice. I will see to write some post about that in coming days. Although I don't know if it will be much interesting because I was just following manual of the eApps.janhttps://www.blogger.com/profile/09450549833036134264noreply@blogger.comtag:blogger.com,1999:blog-785059744103848185.post-81289122972453455822009-04-09T02:56:00.000+02:002009-04-09T02:56:00.000+02:00Jan I read an earlier post of yours regarding your...Jan I read an earlier post of yours regarding your grails hosting for the tutorials site with eapp. I was wondering if you could elaborate more on the setup you have there. My concern about grails is JVM memory needs. your tutorial site is performs well however. are you running the DB on the same VPS? And can you discuss yout tomcat tuning? that would be a helpful post. thanksJohnnoreply@blogger.comtag:blogger.com,1999:blog-785059744103848185.post-66728677320087053072009-04-07T09:58:00.000+02:002009-04-07T09:58:00.000+02:00I think it should work.I think it should work.janhttps://www.blogger.com/profile/09450549833036134264noreply@blogger.comtag:blogger.com,1999:blog-785059744103848185.post-31919226805133053832009-04-07T04:18:00.000+02:002009-04-07T04:18:00.000+02:00Instead of iterating in a loop to reload the books...Instead of iterating in a loop to reload the books, would the new "inList" dynamic finder work?Anonymousnoreply@blogger.com