Grails 3.0.x plugin unable to run integration tests with database - grails

When I run
grails create-app some-app
and
grails create-integration-test SomeTest
with a really complicated test:
expect:
1 == 1
It works just fine. Same when I update the build.gradle
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"
/**/compile 'org.postgresql:postgresql:9.4-1201-jdbc41' /**This is new**/
runtime "org.grails.plugins:asset-pipeline"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
// Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
console "org.grails:grails-console"
}
and the application.yml
dataSource: &pg_baseline ###Only the datasource is updated###
driverClassName: org.postgresql.Driver
dialect: org.hibernate.dialect.PostgreSQLDialect
url: jdbc:postgresql://le-server:5432/LeDatabase
username: ***le superuser***
password: ***le password***
environments:
development:
dataSource:
<< : *pg_baseline
url: le-server:5432/LeDatabase_Dev
test:
dataSource:
<< : *pg_baseline
url: le-server:5432/LeDatabase_Test
to work with a PostgreSQL test database. However, if I follow the same steps but with create-plugin (--profile=plugin, or web-plugin, or not specified profile). Adding the exact same changes to build.gradle + applicatione.yml for the plugin, then running integration tests yields the sweet sweet message:
SomeTest > test something FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.factory.BeanCreationExcepti
on
Caused by: java.lang.NullPointerException
1 test completed, 1 failed
:integrationTest FAILED
In all cases, this is using the following command to run the tests:
grails test-app -integration --stacktrace
Are plugins not able to test against a live database? Do I need some other flag on my test running?

Related

Grails 3 upgrade - unable to resolve class grails.plugin.rendering.pdf.PdfRenderingService

I inherited a multi-module grails application based on Grails 2.5.4.
I installed groovy 3.0.4 and grails 3.3.11, and I completed the grails upgrade tasks base on the tutorial provided on the official website (https://docs.grails.org/3.0.x/guide/upgrading.html).
I'm dealing with tons of code adaptation but I'm bumping on a particular issue as I try to build the project, I'm facing the following issue:
C:\repo\upgraded-app\myapp-web\grails-app\services\bitt\PdfRenderingService.groovy: 9: unable to resolve class grails.plugin.rendering.pdf.PdfRenderingService
# line 9, column 1.
#Transactional
^
The code involved is the following:
import com.lowagie.text.pdf.BaseFont
import grails.transaction.Transactional
import grails.util.Environment
import org.w3c.dom.Document
import org.xhtmlrenderer.pdf.ITextRenderer
#Transactional
class PdfRenderingService extends grails.plugin.rendering.pdf.PdfRenderingService {
...
and my build.gradle file is the following:
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
}
}
version "0.1"
group "bitt.web"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
compile project(':../bitt-core')
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.grails.plugins:gsp"
compile 'org.grails.plugins:spring-security-core:3.2.3'
compile 'org.grails.plugins:spring-security-acl:3.2.1'
compile 'org.grails.plugins:grails-markdown:3.0.0'
compile 'org.grails.plugins:rendering:2.0.3'
compile 'org.grails.plugins:excel-export:2.1'
compile 'org.grails.plugins:grails-cookie:2.0.3'
compile 'org.grails.plugins:spring-security-ui:3.0.2'
compile 'org.grails.plugins:http-builder-helper:1.1.0'
compile 'org.grails.plugins:audit-logging:3.0.6'
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.postgresql:postgresql:9.4-1203-jdbc42"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-web-testing-support"
testCompile "org.grails.plugins:geb:1.1.2"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:2.47.1"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
}
assets {
minifyJs = true
minifyCss = true
includes = ["fonts/*"]
}
The code above mentioned is working fine in Grails 2... but now provokes a compilation error with Grails 3 ... any idea why ?
Thanks.
Upgrading between major Grails versions is not that easy, as Gradle config has big differences.
I suggest you use Grails Starter to get a sample app, unpack the build.gradle, gradle.properties from there, and merge your old config (mostly dependencies) into it.
Configuration has also changed from .groovy files to .yml, consider migrating them as well.

*unable to resolve class" issue when upgrading from grails 2.5.4 to grails 3.3.11

I inherited a multi-module grails application based on Grails 2.5.4.
It's working nice and well, but I need to upgrade to 3.x.
I installed groovy 3.0.4 and grails 3.3.11, and I completed the grails upgrade tasks base on the tutorial provided on the official website (https://docs.grails.org/3.0.x/guide/upgrading.html).
As I try to build the project, I'm facing multiple *unable to resolve class" issues related to bases classes such as:
Starting a Gradle Daemon (subsequent builds will be faster)
:compileAstJava NO-SOURCE
:compileAstGroovy NO-SOURCE
:processAstResources NO-SOURCE
:astClasses UP-TO-DATE
:compileJava NO-SOURCE
:configScript
:compileGroovy
startup failed:
C:\repo\upgraded-app\myapp-core\grails-app\domain\bittt\holders\Exclusion.groovy: 5: unable to resolve class org.grails.databinding.BindingFormat
# line 5, column 1.
import org.grails.databinding.BindingFormat
^
C:\repo\upgraded-app\myapp-core\grails-app\domain\bittt\migration\CustomsLgcy.groovy: 5: unable to resolve class org.postgresql.core.Query
# line 5, column 1.
import org.postgresql.core.Query
^
C:\repo\upgraded-app\myapp-core\grails-app\services\bittt\ExclusionService.groovy: 13: unable to resolve class org.grails.web.servlet.mvc.GrailsParameterMap
# line 13, column 1.
import org.grails.web.servlet.mvc.GrailsParameterMap
^
C:\repo\upgraded-app\myapp-core\grails-app\services\bittt\NotificationService.groovy: 12: unable to resolve class org.grails.commons.GrailsApplication
# line 12, column 1.
import org.grails.commons.GrailsApplication
^
...
My myapp.core build.gradle file contains the following:
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
}
}
version "0.1"
group "myapp.core"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-plugin"
apply plugin:"org.grails.grails-plugin-publish"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.grails.plugins:gsp"
compile 'org.grails.plugins:spring-security-core:3.2.3'
compile 'org.grails.plugins:spring-security-acl:3.2.1'
compile "org.grails.plugins:phonenumbers:0.10"
console "org.grails:grails-console"
profile "org.grails.profiles:web-plugin"
provided "org.grails:grails-plugin-services"
provided "org.grails:grails-plugin-domain-class"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-web-testing-support"
testCompile "org.grails.plugins:geb:1.1.2"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:2.47.1"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
}
assets {
minifyJs = true
minifyCss = true
}
I don't really understand why I'm getting those errors as the relevant dependencies seem to be in place... anything I'm missing here ?
Thanks :)
C:\repo\upgraded-app\myapp-core\grails-app\domain\bittt\holders\Exclusion.groovy:
5: unable to resolve class org.grails.databinding.BindingFormat #
line 5, column 1. import org.grails.databinding.BindingFormat
In Grails 3.3.11, the package is grails.databinding, not org.grails.databinding (https://github.com/grails/grails-core/blob/v3.3.11/grails-databinding/src/main/groovy/grails/databinding/BindingFormat.java). The package names also changed for org.grails.web.servlet.mvc.GrailsParameterMap (https://github.com/grails/grails-core/blob/v3.3.11/grails-web-common/src/main/groovy/grails/web/servlet/mvc/GrailsParameterMap.java) and import org.grails.commons.GrailsApplication (https://github.com/grails/grails-core/blob/v3.3.11/grails-core/src/main/groovy/grails/core/GrailsApplication.java).
org.postgresql.core.Query is a separate problem. It looks like your project does not express a dependency on the postgres library, so the class isn't available to the app.

Grails - DataTables plugin doesn't exist any longer?

I tried to add --compile "org.grails.plugins:grails-datatables:0.14"-- and also
--compile "org.grails.plugins:grails-datatables:0.15" but none of them where found.
I want to use it with GRAILS-4.0.3 but it doesn't seem possible, is it abandoned in grails?
Ok, I tested with the new URL:s. Not sure if I did it correctly but it failed.
Error initializing classpath: Could not find org.grails.plugins:grails-datatables:0.15.Searched in the following locations:
file:/C:/Users/Lars/.m2/repository/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.pom
file:/C:/Users/Lars/.m2/repository/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.jar
https://repo.grails.org/grails/core/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.pom
https://repo.grails.org/grails/core/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.jar
https://repo.grails.org/grails/plugin-releases-local/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.pom
https://repo.grails.org/grails/plugin-releases-local/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.jar
It looks like I did it correct but it did not find it on the given URL.
build.gradle Looks like this in the beginning:
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2"
}
}
version "0.1"
group "test"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://repo.grails.org/grails/plugin-releases-local" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.5.Final"
compile "org.grails.plugins:gsp"
compile 'org.grails.plugins:quartz:2.0.12'
console "org.grails:grails-console"
compile "org.grails.plugins:grails-datatables:0.15"
Gradle.properties looks like this:
grailsVersion=3.3.0
gormVersion=6.1.6.RELEASE
gradleWrapperVersion=3.5
But at this link: https://mvnrepository.com/artifact/org.grails.plugins/grails-datatables/0.15
I found a repository that worked:
Note: this artifact is located at Grails Plugins repository (https://repo.grails.org/grails/plugins/)
I tried to add --compile "org.grails.plugins:grails-datatables:0.14"--
and also --compile "org.grails.plugins:grails-datatables:0.15" but
none of them where found.
You have not indicated which repositories you attempted to resolve those from, but those are available:
https://mvnrepository.com/artifact/org.grails.plugins/grails-datatables/0.14
https://mvnrepository.com/artifact/org.grails.plugins/grails-datatables/0.15
https://repo.grails.org/grails/plugins-releases-local/org/grails/plugins/grails-datatables/0.15/
https://repo.grails.org/grails/plugins-releases-local/org/grails/plugins/grails-datatables/0.14/
I want to use it with GRAILS-4.0.3 but it doesn't seem possible, is it
abandoned in grails?
As far as I know there is not a version of the plugin that is compatible with Grails 4.0.3. The plugin is of course open source (https://bitbucket.org/ben-wilson/grails-datatables/src/master/).

Grails with Vaadin 8 - 'Failed to load the widgetset"

I am a newbie in the areas in Grails and Vaadin 8, and I’m having a bit of trouble trying to add widgets to my Vaadin/Grails application.
To begin, I created a grails/Vaadin app using the me.przepiora.vaadin-grails:web-vaadin8:0.3 profile. I edited the build.gradel file, as advised and
ran the command ”gradle wrapper --gradle-version 4.0” (again, as advised by the profile setup).
Here is my build.gradle after applying the edit:
apply plugin:"com.devsoap.plugin.vaadin"
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://dl.bintray.com/macprzepiora/gradle-plugins/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.devsoap.plugin:gradle-vaadin-plugin:1.2.0.beta1-macprzepiora2"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8"
}
}
version "0.1"
group "foobar"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "com.vaadin:vaadin-spring-boot-starter:2.+"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.5.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "me.przepiora.vaadin-grails:web-vaadin8:0.3"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.8"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails:grails-web-testing-support"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
plugins {
id 'com.devsoap.plugin.vaadin' version '1.3.1'
}
assets {
minifyJs = true
minifyCss = true
}
The resulting grails/Vaadin app worked fine, displaying a button which , when pressed, displayed an error message.
I then tried to enhance the app slightly, by replacing the button with a Vaadin Tree, backup by a TreeData instance.
Unfortunately, when I did this, I got the error message:
“Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.vaadin.ui.Tree Check its component connector's #Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.”
After a google search I found something that appeared to be related at:
How do I fix 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.vaadin.addon.charts.Chart
Based on this, I added the line #Widgetset("AppWidgetset") to my GrailsUI class (the only class in my project that inherits from com.vaadin.ui.UI).
After doing this, I get a new runtime error:
“Failed to load the widgetset: ./VAADIN/widgetsets/AppWidgetset/AppWidgetset.nocache.js?1525623851485”
I feel so frustrated - it feels like i’m really close to a working application, if only I knew the magi incantation :-(

Class Cast Exception Building WAR file in Grails 3.1.11 Using asset-pipeline and bootstrap

I'm building a grails application using bootstrap and asset-pipeline. Everything works great in dev but when I build a war file I get a ClassCastException
{ viops } » gradle war
/c/VitalDev/ProfessionalServices/dev/trunk/viops :assetCompile
Processing File 1 of 164 - bower.json
Writing File Processing File 2 of 164 - data/flot-data.js Minifying
File Writing File Processing File 3 of 164 - data/morris-data.js
Minifying File Writing File Processing File 4 of 164 -
dist/css/sb-admin-2.css Minifying File Writing File Processing File 5
of 164 - dist/css/sb-admin-2.min.css Writing File Processing File 6 of
164 - dist/js/sb-admin-2.js Minifying File Writing File Processing
File 7 of 164 - dist/js/sb-admin-2.min.js Writing File Processing File
8 of 164 - gulpfile.js :assetCompile FAILED FAILURE: Build failed with
an exception.
What went wrong: Execution failed for task ':assetCompile'.
Cannot cast object '[Digest Input Stream] MD5 Message Digest from SUN,
' with class 'java.security.DigestInputStream' to class
'java.io.ByteArrayInputStream' Try: Run with --stacktrace option to
get the stack trace. Run with --info or --debug option to get more log
output.
BUILD FAILED
Here's the stacktrace:
Exception is: org.gradle.api.tasks.TaskExecutionException: Execution
failed for task ':assetCompile'. at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gra
dle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at
org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at
org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at
org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at
org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at
org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at
org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at
org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at
org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at
org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at
org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at
org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at
org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at
org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at
org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22) at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at
org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at
org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at
org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at
org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at
org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at
org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at
org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at
org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at
org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at
org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at
org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at
org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at
org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at
org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at
org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at
org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at
org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
at
org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
at
org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at
org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at
org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
at
org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.Main.doAction(Main.java:33) at
org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at
org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at
org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23) Caused by:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot
cast object '[Digest Input Stream] MD5 Message Digest from SUN, ' with
class 'java.security.DigestInputStream' to class
'java.io.ByteArrayInputStream' at
asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy:152)
at
asset.pipeline.processors.JsRequireProcessor.encapsulateModule(JsRequireProcessor.groovy:115)
at
asset.pipeline.processors.JsRequireProcessor.appendModule(JsRequireProcessor.groovy:103)
at
asset.pipeline.processors.JsRequireProcessor.this$4$appendModule(JsRequireProcessor.groovy)
at
asset.pipeline.processors.JsRequireProcessor$_process_closure1.doCall(JsRequireProcessor.groovy:62)
at
asset.pipeline.processors.JsRequireProcessor.process(JsRequireProcessor.groovy:37)
at
asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy:171)
at
asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy)
at
asset.pipeline.DirectiveProcessor.fileContents(DirectiveProcessor.groovy:307)
at
asset.pipeline.DirectiveProcessor$fileContents$0.callCurrent(Unknown
Source) at
asset.pipeline.DirectiveProcessor.loadContentsForTree(DirectiveProcessor.groovy:129)
at
asset.pipeline.DirectiveProcessor.compile(DirectiveProcessor.groovy:67)
at asset.pipeline.DirectiveProcessor$compile.call(Unknown Source) at
asset.pipeline.AssetCompiler.compile(AssetCompiler.groovy:147) at
asset.pipeline.AssetCompiler$compile.call(Unknown Source) at
asset.pipeline.gradle.AssetCompile.compile(AssetCompile.groovy:221) at
org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at
org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
at
org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 57 more Total time: 22.617 secs
build.gradle:
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
// classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.10.2"
classpath "org.grails.plugins:hibernate4:5.0.10"
classpath "org.grails.plugins:views-gradle:1.0.12"
classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.11.2'
classpath 'com.bertramlabs.plugins:less-asset-pipeline:2.11.2'
classpath 'com.bertramlabs.plugins:asset-pipeline-core:2.11.2' //Add this for some bug fixes
classpath "com.bertramlabs.plugins:asset-pipeline-grails:2.11.2"
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'log4j') {
details.useTarget "org.slf4j:log4j-over-slf4j:1.7.5"
}
if (details.requested.name == 'commons-logging') {
details.useTarget "org.slf4j:jcl-over-slf4j:1.7.5"
}
}
}
version "0.1"
group "viops"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}
dependencies {
//This top section pulls out Grails Logback logging solution and
//replaces it with log4j2
// added the new way using Log4j2, yes, spring makes it easy
compile "org.springframework.boot:spring-boot-starter-log4j2"
// changed spring-boot-autoconfigure so that it would not
// pull in the logback binding/implementation
compile('org.springframework.boot:spring-boot-autoconfigure') {
exclude group:'ch.qos.logback', module:'logback-classic'
}
compile('org.springframework.boot:spring-boot-starter-actuator') {
exclude group:'ch.qos.logback', module:'logback-classic'
}
// and finally, added the log4j2 binding/implementation
compile "org.apache.logging.log4j:log4j-api:2.5"
compile "org.apache.logging.log4j:log4j-core:2.5"
compile "org.grails:grails-core"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-codecs"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails:grails-dependencies" //
compile "org.grails.plugins:scaffolding" //
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-datasource"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-async"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:views-json"
console "org.grails:grails-console"
runtime "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.2"
// runtime "org.grails.plugins:asset-pipeline:3.0.1"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.2"
runtime 'com.bertramlabs.plugins:asset-pipeline-core:2.11.2' //Add this for some bug fixes
runtime 'com.bertramlabs.plugins:less-asset-pipeline:2.11.2'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.4'
//profile "org.grails.profiles:rest-api"
profile "org.grails.profiles:web"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-datastore-rest-client"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
assets {
minifyJs = true
minifyCss = true
excludes = ['**/*.less','bootstrap-3.3.2/**/*'] //Example Exclude GLOB pattern
includes = ['application.less','bootstrap-3.3.2/fonts/*']
}
I don't know if I'm missing something or if it's a bug. Any help would be appreciated.
Update: I'm now using 3.1.12 successfully.
I started playing with versions and combinations and wound up with only
classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.9.5
`and now it seems to work. After restricting to just this item in the classpath, I walked the version back one by one until I arrived at 2.9.5.
I still am not sure exactly which item this created a problem with or which version of which other package I'm using.

Resources