NoNodeAvailableException when installing elasticsearch plugin in grails - grails

I'm developing a grails web-app (currently on my local machine) that needs to query elasticsearch on a server on my network.
I have taken the following steps:
Added the following line in BuildConfig.groovy
plugins {
...
runtime ":elasticsearch:0.0.3.4"
...
}
I have also added the following to Config.groovy:
elasticSearch {
client.mode = 'transport'
client.hosts = [
[host:'xxx.xxx.xxx.xxx', port:9200]
]
disableAutoIndex = 'true'
}
To eliminate firewall issues etc have run the query using curl and it works fine:
curl -XGET 'http://xxx.xxx.xxx.xxx:9200/_search?pretty' -d '{...}
But I am getting the following:
|Running Grails application
Error |
2014-10-23 09:17:52,278 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'searchableClassMappingConfigurator': Invocation of init method failed; nested exception is org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
Message: Error creating bean with name 'searchableClassMappingConfigurator': Invocation of init method failed; nested exception is org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by NoNodeAvailableException: None of the configured nodes are available: []
->> 273 | ensureNodesAreAvailable in org.elasticsearch.client.transport.TransportClientNodesService
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 192 | execute in ''
| 81 | execute . in org.elasticsearch.client.transport.support.InternalTransportClusterAdminClient
| 73 | execute in ''
| 118 | health . in org.elasticsearch.client.support.AbstractClusterAdminClient
| 154 | installMappings in org.grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator
| 51 | configureAndInstallMappings in ''
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
Error |
Forked Grails VM exited with error
I've read numerous other answers on here for similar errors but nothing I've tried is working. Any ideas?

Transport is done on port 9300 (not on the HTTP port 9200). Also check this port to be open then.
If it still fails, check also to use the right cluster.name. It is elasticsearch by default, so if you have not changed it in your server/cluster, there is no need for it.
Otherwise please add the new insights on your question.

Related

Grails error unable to create bean, only with scaffolding

Grails : 2.4
Java : Oracle 1.7
OS : Ubuntu 14.04
Hello Friends,
I am working on a sample project to improve my knowledge in grails. For the controller file, when I replace def index() { } with
def scaffold = EventManagment, I get an error of which the log is mentioned below. If I dont add that line, and I go on localhost page, then I don't see the web-app in action. Kindly let me know what to do. Thank you.
Controller file is /grails-2.4.0/EventMg/grails-app/controllers/com/Evenmgmt.groovy.
Log :
| Running Grails application
| Error 2014-06-15 16:47:52,353 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'com.tekdays.TekEventController': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.tekdays.TekEventController]: Constructor threw exception; nested exception is java.lang.NullPointerException
Message: Error creating bean with name 'com.tekdays.TekEventController': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.tekdays.TekEventController]: Constructor threw exception; nested exception is java.lang.NullPointerException
Line | Method
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanInstantiationException: Could not instantiate bean class [com.tekdays.TekEventController]: Constructor threw exception; nested exception is java.lang.NullPointerException
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by NullPointerException: null
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
| Error Forked Grails VM exited with error
I was able to fix the problem by a clean installation of old version of Ubuntu. Same code worked. This question for me marks as answered.

resource plugin error when upgrading from grails 2.3.8 2.4

Im following the docs trying to upgrade my project from 2.3.8 to 2.4, but I am encountering these error(s)
localhost-startStop-1] ERROR resource.ResourceProcessor - Unable to load resources
Message: No signature of method: groovy.util.ConfigObject.getGrailsPlugin() is applicable
for argument types: (java.lang.String) values: [lesscss-resources]
->> 5 | run in BootstrapResources
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 46 | doCall in org.grails.plugin.resource.module.ModuleDeclarationsFactory$_getModuleDeclarations_closure2
| 41 | getModuleDeclarations in org.grails.plugin.resource.module.ModuleDeclarationsFactory
| 715 | loadModules in org.grails.plugin.resource.ResourceProcessor
| 1013 | reloadAll . . . . . . in ''
| 166 | doCall in ResourcesGrailsPlugin$_closure3
| 262 | run . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Error |
2014-06-03 13:38:16,282 [localhost-startStop-1] ERROR [localhost]. [/DocumentManagementSystem] - Exception starting filter sitemesh
Message: org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter
Line | Method
->> 59 | findClass in org.grails.plugins.tomcat.ParentDelegatingClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 425 | loadClass in java.lang.ClassLoader
| 358 | loadClass in ''
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run . . . in java.lang.Thread
Error |
2014-06-03 13:38:16,300 [localhost-startStop-1] ERROR core.StandardContext - Error filterStart
Error |
Does this sound like a plugin issue? Or something I might have skipped over in the documentation
Here is my buildconfig plugin section
plugins {
// plugins for the build system only
build ":tomcat8:8.0.5"
// plugins for the compile step
compile ":scaffolding:2.1.0"
compile ':cache:1.1.6'
// compile ":mail:1.0.5"
// compile ":ckeditor:4.4.0.0-SNAPSHOT"
compile ":searchable:0.6.7"
compile ":jquery:1.11.1"
// compile ":shiro:1.2.1"
// compile ":resources:1.2.8"
compile ':asset-pipeline:1.8.3'
// compile (":nimble:0.7"){
//
// exclude "servlet-api"
//
// }
// plugins needed at runtime but not for compilation
runtime ":hibernate:3.6.10.15" // or ":hibernate4:4.3.5.1"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
runtime ":resources:1.2.8"
New sitemesh error
Error |
2014-06-03 14:41:32,304 [localhost-startStop-1] ERROR [localhost].[/DocumentManagementSystem] - Exception starting filter sitemesh
Message: org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter
Line | Method
->> 61 | findClass in org.grails.plugins.tomcat.ParentDelegatingClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 425 | loadClass in java.lang.ClassLoader
| 358 | loadClass in ''
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run . . . in java.lang.Thread
Error |
Your web.xml may still contain references to the sitemesh filter:
http://grails.org/doc/2.4.3/guide/upgradingFrom23.html
The Sitemesh servlet filter has been removed and the GSP layout feature is now handled by GrailsLayoutView.
Rename the src/templates folder to src/templates-old, then run grails install-templates. If you previously customised your web.xml, you will need to edit the generated web.xml to make these changes again.
As it says in documentation no longer you need to use resource plugin:
As of Grails 2.4 the resources plugin has been replaced with the asset-pipeline
now you could use asset plugin instead.
use this link and you can easily upgrade your resources from 2.3.8 to 2.4.
This is an issue in the jQuery-ui plugin in JqueryUiPluginResources.groovy in the following two lines:
def appCtx = org.codehaus.groovy.grails.commons.ApplicationHolder.application.mainContext
def plugin = appCtx.pluginManager.getGrailsPlugin('jquery-ui')
The fix for this is present in the following commit: https://github.com/gpc/grails-jquery-ui/pull/13

Vaadin Grails: Can not process requests before init() has been called

I'm trying to setup the Vaadin Grails plugin, but when following the instructions from here I run into the following error when actually running the app:
| Error 2014-03-05 14:03:14,922 [http-bio-8080-exec-5] ERROR [/ria-app].[VaadinServlet 0] - Servlet.service() for servlet [VaadinServlet 0] in context with path [/ria-app] threw exception
Message: Can not process requests before init() has been called
Line | Method
->> 1292 | requestStart in com.vaadin.server.VaadinService
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1371 | handleRequest in ''
| 238 | service . . . in com.vaadin.server.VaadinServlet
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
The full stack trace is available here.
The issue is fixed in 7.1.10.2 or if you want also update Vaadin version then 7.1.11.

Does the Searchable plugin work with Grails 2.0.0? (I argue no)

When I upgrade to the project to grails 2.0 (with a fresh install of the searchable plugin), I get a Hibernate class cast exception. Does anybody else get this problem?
http://grails.org/ uses the Searchable plugin and it works with Grails 2.0.3. What issue are you running into?
Searchable is based on Compass which is being rewritten as ElasticSearch.
The ElasticSearch plugin works with Grails 2.0.
For more information see The Future of Compass & ElasticSearch.
Migrating my app from Grails 1.3.7 to 2.1.1 ran into a similar issue. I was able to resolve it by updating the Searchable plugin from 0.5.5 to 0.6.4.
Here's what the stacktrace looked like:
| Error 2012-10-05 19:02:18,691 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error executing bootstraps: org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy cannot be cast to org.hibernate.impl.SessionFactoryImpl
Message: org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy cannot be cast to org.hibernate.impl.SessionFactoryImpl
Line
| Method
->> 95 | injectLifecycle in org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 46 | injectLifecycle in org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityCollectionLifecycleInjector
| 149 | doStart . . . . in org.compass.gps.device.hibernate.HibernateGpsDevice
| 125 | start in org.compass.gps.device.AbstractGpsDevice
| 73 | start . . . . . in org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
| 166 | start in org.compass.gps.impl.AbstractCompassGps
| 144 | doCall . . . . in SearchableGrailsPlugin$_closure3
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . . . . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . . . . . in ''
^ 680 | run in java.lang.Thread
| Error 2012-10-05 19:02:18,715 [localhost-startStop-1] ERROR [localhost].[/myApp] - Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
Message: Error executing bootstraps; nested exception is java.lang.ClassCastException: org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy cannot be cast to org.hibernate.impl.SessionFactoryImpl
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 680 | run . . in java.lang.Thread
Caused by ClassCastException: org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy cannot be cast to org.hibernate.impl.SessionFactoryImpl
->> 95 | injectLifecycle in org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 46 | injectLifecycle in org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityCollectionLifecycleInjector
| 149 | doStart in org.compass.gps.device.hibernate.HibernateGpsDevice
| 125 | start in org.compass.gps.device.AbstractGpsDevice
| 73 | start . in org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
| 166 | start in org.compass.gps.impl.AbstractCompassGps
| 144 | doCall . in SearchableGrailsPlugin$_closure3
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 680 | run in java.lang.Thread
Yes me too used searchable on grails 1.3.7 , 2.0.3 and now using on 2.1.1
All i have to do was upgrade my searchable plugin to the latest one. Though I had to made some tweaks in the code but every thing was mentioned in the plugin documentation
link to documentation
Mind the imports in the controllers. As I guess the class path has been changed. And this was the only change I made.
This happends because when you upgrade to a Grails version that uses Hibernate 4.X.
This happends because there were several package and class name changes between Hiberate 3.x and 4.x, so code that works with Hibernate 3.x won't work with 4.x except in rare cases. Beyond the name changes, there were big internal changes in how things work, so code that compiles won't necessarily run. App option #1 is to downgrade to Hibernate 3.x. The config settings for that are included and commented out (BuildConfig.groovy, DataSource.groovy), so this a very quick option. Obviously not an option if you depend on a feature added in 4.x, and this just delays the real problem until you have to upgrade Hibernate.

Grails 2.0, Atmosphere-Plugin and WebSockets

I am trying to get a sample WebSocket app running on grails 2.0 with jetty 7.5 in dev mode. I generated a simple AtmosphereHandler, but whenever I try to connect via a WebSocket I get the following error message:
E
rror 2011-11-24 17:18:32,075 ["http-bio-8080"-exec-4] ERROR [/jet2].[StratosphereServlet] - Servlet.service() for servlet [StratosphereServlet] in context with path [/jet2] threw exception
Message: null
Line | Method
->> 197 | upgrade in org.eclipse.jetty.websocket.WebSocketFactory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 320 | acceptWebSocket in ''
| 78 | service . . . . in org.eclipse.jetty.websocket.WebSocketServlet
| 26 | doFilter in org.grails.plugin.resource.DevModeSanityFilter
| 886 | runTask . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 619 | run . . . . . . in java.lang.Thread
Any suggestions as to what might be the rpoblem are highly appreciated. Best wishes Peter, Switzerland
it seems the issue is with the Grails Plug In as I don't see Atmosphere classes in the stack trace. Thanks for filling the issue
https://bitbucket.org/bgoetzmann/grails-atmosphere-plugin/issue/4/grails-20-atmosphere-and-websockets

Resources