ElasticSearch plugin causing server to stop in Grails 3.1.6 - grails

I'm trying to add ElasticSearch plugin in my Grails 3.1.6 project.
I installed plugin as:
dependencies {
//..
compile 'org.grails.plugins:elasticsearch:1.0.0.2'
//..}
And configured application.yml as
elasticSearch:
client:
node: local
datastoreImpl: hibernateDatastore
But when I try to run application, i'm getting error as below:
BUILD SUCCESSFUL
Total time: 5.118 secs
|Running application...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe''
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error |
Failed to start server (Use --stacktrace to see the full trace)
Process finished with exit code 1
I'm using IntellijIdea v2016 as IDE.
Would someone please help me to figure out the error spot please.
Thanks.

This isn't related to the plugin, it's a Boot/Gradle problem caused by having a classpath that causes the process to fail because the combined length of the process command is larger than the max Windows allows. This was fixed in 3.1.2 but you have to add a small config setting to build.gradle since it's not a problem in Linux or OSX:
grails {
pathingJar = true
}
See https://github.com/grails/grails-core/issues/9125 for more info.

Related

Classpath error while configuring grails on Windows

I want to install grails on my windows 10 (x64). The grails version I have is 3.3.4, groovy version 2.4.14, JVM version 1.8.0_141. I can create an app but when I run it an error comes out:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'hello'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve org.grails:grails-gradle-plugin:3.3.4.
Required :
project :
Could not resolve org.grails:grails-gradle-plugin:3.3.4.
Could not get resource 'https://repo.grails.org/grails/core/org/grails/grails-gradle-plugin/3.3.4/grails-gradle-plugin-3.3.4.pom'.
Could not GET 'https://repo.grails.org/grails/core/org/grails/grails-gradle-plugin/3.3.4/grails-gradle-plugin-3.3.4.pom'.
Connect to repo.grails.org:443 [repo.grails.org/198.18.1.217] failed: Connection timed out: connect
Could not resolve org.grails.plugins:hibernate5:6.1.9.
Required by:
project :
Could not resolve org.grails.plugins:hibernate5:6.1.9.
Could not get resource
'https://repo.grails.org/grails/core/org/grails/plugins/hibernate5/6.1.9/hibernate5-6.1.9.pom'.
Could not GET 'https://repo.grails.org/grails/core/org/grails/plugins/hibernate5/6.1.9/hibernate5-6.1.9.pom'.
Connect to repo.grails.org:443 [repo.grails.org/198.18.1.217] failed: Connection timed out: connect
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
CONFIGURE FAILED
Total time: 1 mins 4.547 secs
Error Error initializing classpath: Connection timed out: connect (Use --stacktrace to see the full trace)
I have searched everywhere but haven't found a solution. Please help me to resolve this.
PS: Every time I try to run the app, strangely the net becomes unbelievably slow.

Grails 3.1.8 application not running

My Grails 3.1.8 application not running,
Following log found when i want to run application-
|Resolving Dependencies. Please wait...
|Running application...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\Program
Files\Java\jdk1.8.0_92\bin\java.exe''
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --
debug option to get more log output.
Error |
Failed to start server (Use --stacktrace to see the full trace)

Grails 3.2.11 plugin bintrayUpload missing grails-plugin.xml

I follow the grails 3 plugin tutorial. I create a project:
https://github.com/fabiooshiro/no-surprises
$ gradle bintrayUpload
> Configure project :
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
at build_84d0cz3ffyc3w9ul7qh3qjt2t.run(/home/ivt/investtools/no-surprises/build.gradle:17)
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
at build_84d0cz3ffyc3w9ul7qh3qjt2t.run(/home/ivt/investtools/no-surprises/build.gradle:17)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishMavenPublicationToMavenLocal'.
> Failed to publish publication 'maven' to repository 'mavenLocal'
> Invalid publication 'maven': artifact file does not exist: '/home/ivt/investtools/no-surprises/build/classes/java/main/META-INF/grails-plugin.xml'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 1s
11 actionable tasks: 2 executed, 9 up-to-date

Custom Ant Task Not Working On Build Server

I've got a custom Ant task that I'm using successfully from gradle on my local machine:
task fetchRelMod {
doLast {
println 'Fetching the RelMod'
ant.taskdef(name:'relmod',
classpath:'retrievePBSInfo.jar:hsjt400-4-9.jar',
classname:"com.myco.ant.tasks.RetrievePBSRelModString")
ant.relmod(user:project.ext.props.getProperty('fetchrelmod.username'),
password:project.ext.props.getProperty('fetchrelmod.password'),
prodCode:project.ext.props.getProperty('profile.pbs.product.code'),
branch:project.ext.props.getProperty('profile.pbs.branch'),
state:project.ext.props.getProperty('profile.pbs.relmod.selector'))
project.ext.set('iseries_relmod',ant.relmodStub)
project.ext.set('iseries_relmodAndDate', ant.relmod)
}
}
I've got the jar files sitting next to build.gradle for now, out of simplicity... they exist in the same location on the build server. Works great locally. When I run my build from my build server (either through Jenkins or going on the box and running Gradle directly), I get the following:
sudo /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle214/bin/gradle all -DisQUABuild=true
Building My App
Loading Properties files...
QUA Build. Using build-qua.props
:fetchRelMod
Fetching the RelMod
:fetchRelMod FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/workspace/MyApp/build.gradle' line: 141
* What went wrong:
Execution failed for task ':fetchRelMod'.
> taskdef class com.myco.ant.tasks.RetrievePBSRelModString cannot be found
using the classloader AntClassLoader[/var/lib/jenkins/workspace/myApp/hsjt400-4-9.jar]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.104 secs
What concerns me is that there are two jar files in the classpath and it only mentions one in the error. Does anyone have any ideas as to what might be going on?

grails db-generate-changelog error

Error run command:
grails dbm-generate-changelog changelog.groovy
command line output:
What went wrong:
Execution failed for task ':dbmGenerateGormChangelog'.
Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 14.887 secs
| Error Command [dbm-generate-gorm-changelog] error: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.0-bin.zip'. (Use --stacktrace to see the full trace)
Thank you #quindimildev. The open issue resolved my issue. The direct post that assisted me was the following: https://github.com/grails-plugins/grails-database-migration/issues/64#issuecomment-256739113
I inserted into my dependencies:
runtime "org.grails.plugins:database-migration:3.0.0.BUILD-SNAPSHOT"

Resources