I am getting this error while deploying a new version.
Build tool: gradle
Although the same code with a different version that was deployed some time back is working well. The exceptions are as below. On local env code is working fine.
org.eclipse.jetty.servlet.BaseHolder doStart: (BaseHolder.java:101)
java.lang.ClassNotFoundException: com.google.apphosting.utils.remoteapi.RemoteApiServlet
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at com.google.apphosting.runtime.ApplicationClassLoader.findClass(ApplicationClassLoader.java:135)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:95)
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp(AppEngineWebAppContext.java:175)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doStart(AppEngineWebAppContext.java:120)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:240)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:178)
at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:120)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:747)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:710)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:680)
at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:872)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:270)
at java.lang.Thread.run(Thread.java:748)
build.gradle file is as below: I am sharing the main module file. Other build.gradle file are just the supporting files.
/*
configurations {
compile.exclude group: 'com.google.http-client'
}
*/
configurations.runtime {
exclude group: 'com.ibm.websphere', module: 'uow'
exclude group: 'org.apache.geronimo.specs', module: 'geronimo-servlet_2.5_spec'
exclude group: 'javax.servlet', module: 'jsp-api'
exclude group: 'com.sun', module: 'tools'
exclude group: 'ant', module: 'ant'
exclude group: 'com.wadpam', module: 'docrest-doclet'
exclude group: 'com.wadpam', module: 'docrest-api'
}
dependencies {
compile ('com.goldengekko:user-service:1.0.5') {
transitive = true
}
compile ('com.goldengekko:security-support:1.0.2') {
transitive = true
}
compile 'javax.servlet:servlet-api:3.0'
compile("com.goldengekko:user-security-mgmt:2.1.112") {
//exclude module: 'appengine-gcs-client'
exclude module: 'docrest-doclet'
exclude module: 'commons-dbcp'
exclude module: 'spring-jdbc'
exclude module: 'log4j'
exclude group: 'javax.mail', module: 'mail'
exclude module: "geronimo-jpa_3.0_spec"
exclude group: "javax.activation", module: "activation"
exclude group: "javax.servlet", module: "servlet-api"
exclude group: 'com.google.http-client:google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
exclude group: 'com.goldengekko', module: 'gae-support'
//changing = true //for snapshot
}
compile('com.goldengekko:gae-support:2.0.24') {
transitive = true
exclude group: 'com.goldengekko', module: 'core-server'
exclude group: 'com.google.http-client:google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
exclude group: 'com.google.appengine.tools', module: 'appengine-gcs-client'
}
compile('com.google.appengine.tools:appengine-gcs-client:0.5') {
transitive = true
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
exclude group: 'com.google.api-client', module: 'google-api-client-appengine'
}
compile('com.google.api-client:google-api-client-appengine:1.23.0')
compile ('com.google.http-client:google-http-client-jackson2:1.19.0')
compile ('com.google.http-client:google-http-client:1.19.0')
compile ('com.google.code.gson:gson:1.5')
compile('net.sf.mardao:mardao-gae:2.3.3') {
transitive = true
}
compile('com.goldengekko:core-server:1.0.57') {
transitive = true
}
runtime 'org.springframework.social:spring-social-facebook:1.1.0.M1'
compile ('com.goldengekko:crud-support:1.0.2') {
transitive = true
}
compile ('com.goldengekko.android:networking:1.9') {
transitive = true
}
compile('com.goldengekko:mobile-push-support:1.1.7') {
transitive = false
}
compile('com.wadpam.gaelic:gaelic-oauth2-provider:1.0.8') {
transitive = true
}
compile ('com.wadpam.gaelic:gaelic-domain:1.0.8') {
transitive = true
}a
compile ('com.wadpam.gaelic:gaelic-appengine:1.0.8') {
transitive = true
}
/*
compile ('com.fasterxml.jackson.core:jackson-annotations:2.5.4') {
transitive = true
}
compile ('com.fasterxml.jackson.core:jackson-databind:2.5.4') {
transitive = true
} */
runtime ('cglib:cglib:2.2.2') {
transitive = true
}
compile ('com.google.appengine:appengine-api-1.0-sdk:1.9.60') {
transitive = true
}
compile ('com.google.appengine:appengine-api-labs:1.9.60') {
transitive = true
}
compile group: 'commons-collections', name: 'commons-collections', version: '3.2.1'
//providedCompile('javax.servlet:servlet-api:2.5') { transitive=false}
compile('org.springframework:spring-core:4.0.9.RELEASE') {
force = true
transitive = true
}
compile ('org.springframework:spring-tx:4.0.9.RELEASE') {
force = true
transitive = false
}
compile ('commons-lang:commons-lang:2.6') {
force = true
transitive = false
}
compile ('org.springframework:spring-webmvc:4.0.9.RELEASE') {
force = true
transitive = true
}
compile ('com.ibm.websphere:com.springsource.com.ibm.websphere.uow:6.0.2.17') {
force = true
transitive = true
}
compile ('org.springframework:spring-oxm:4.0.9.RELEASE') {
transitive = true
}
compile ('org.apache.axis:axis:1.4') {
transitive = true
}
compile ('javax.xml:jaxrpc-api:1.1') {
transitive = true
}
compile ('commons-discovery:commons-discovery:0.4') {
transitive = true
}
compile ('wsdl4j:wsdl4j:1.6.2') {
transitive = true
}
compile ('net.sf.ehcache:ehcache:1.6.2') {
transitive = true
}
compile ('org.codehaus.groovy:groovy-all:1.7.2') {
transitive = true
}
compile ('commons-io:commons-io:2.4') {
transitive = true
}
compile ('commons-fileupload:commons-fileupload:1.3') {
transitive = true
}
compile 'org.osgeo:proj4j:0.1.0'
compile 'uk.co.jemos.podam:podam:3.3.2.RELEASE'
compile 'net.sf.opencsv:opencsv:2.2'
compile 'org.springframework.ws:spring-ws:1.5.9'
compile 'com.amazonaws:aws-java-sdk-sns:1.10.26'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.3'
runtime ('org.springframework.social:spring-social-twitter:1.1.0.M1') {
transitive = true
}
runtime('org.springframework.social:spring-social-salesforce:1.0') {
transitive = true
}
runtime('com.goldengekko.social:spring-social-gaelic:1.0')
runtime('com.goldengekko:core-domain:1.0.3')
runtime('org.springframework.social:spring-social-core:1.1.4.RELEASE') {
transitive = true
}
runtime('org.springframework.social:spring-social-facebook:1.1.1.RELEASE') {
transitive = true
}
runtime('org.springframework.social:spring-social-google:1.0.0.M2') {
transitive = true
exclude group: 'com.google.http-client', module: 'google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
}
compileOnly 'com.goldengekko:docrest-doclet:3.0.7'
compile 'net.sf.opencsv:opencsv:2.0'
compile 'org.projectlombok:lombok:1.18.4'
}
This error is due to the old SDK,
here you can download the most updated version of it.
Related
In my Gradle project, I have a dependency for SQLite.
Here is my build.gradle:
import groovy.sql.Sql
buildscript {
ext{
osPackageVersion = "3.4.0"
kotlin_version = '1.2.41'
requery_version = '1.5.1'
sqlite_jdbc = '3.7.2'
rxkotlin_version = '2.2.0'
sqlDirPath = "src" + File.separator + "main" + File.separator + "Resources" + File.separator + "TestAppDbInit.sql"
}
repositories {
mavenCentral()
jcenter()
maven{
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "edu.sc.seis.gradle:launch4j:2.4.4"
classpath group: 'org.jooq', name: 'jooq-meta-extensions', version: '3.11.2'
classpath 'org.jooq:jooq-codegen:3.11.2'
classpath 'org.xerial:sqlite-jdbc:3.7.2'
}
}
plugins {
id 'java'
id 'nu.studer.jooq' version '3.0.1'
}
group 'org.wycliffeassociates.translationrecorder'
apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'
apply plugin: 'edu.sc.seis.launch4j'
sourceCompatibility = 1.8
configurations {
sqllite
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io'}
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://mvnrepository.com/artifac/'}
maven { url "https://dl.bintray.com/kotlin/exposed" }
maven { url "https://dl.bintray.com/dua3/public" }
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
compile "no.tornado:tornadofx:1.7.16"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "com.github.thomasnield:rxkotlinfx:2.2.2"
compile "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
compile 'org.jooq:jooq:3.11.2'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: "$sqlite_jdbc"
jooqRuntime group: 'org.jooq', name: 'jooq-meta-extensions', version: '3.11.2'
jooqRuntime 'org.xerial:sqlite-jdbc:3.7.2'
sqllite 'org.xerial:sqlite-jdbc:3.7.2'
kapt "io.requery:requery-processor:$requery_version"
compile "com.squareup.retrofit2:retrofit:2.0.0"
compile "com.squareup.retrofit2:converter-moshi:2.0.0"
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.google.dagger:dagger:2.16'
kapt 'com.google.dagger:dagger-compiler:2.16'
implementation 'com.github.WycliffeAssociates:8woc2018-common:dev-SNAPSHOT'
compile 'com.github.WycliffeAssociates:jdenticon-kotlin:-SNAPSHOT'
compile 'de.jensd:fontawesomefx-commons:9.1.2-jpms'
compile 'de.jensd:fontawesomefx-materialicons:2.2.0-9.1.2-jpms'
compile 'de.jensd:fontawesomefx-icons525:4.2.0-9.1.2-jpms'
compile 'com.github.afester.FranzXaver:Examples:0.1'
compile 'com.jfoenix:jfoenix:8.0.5' // Java 8
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.mockito:mockito-core:2.+"
testCompile "org.mockito:mockito-core:2.+"
testCompile 'org.powermock:powermock-module-junit4:2.+'
testCompile 'org.powermock:powermock-module-junit4-rule:2.+'
testCompile 'org.powermock:powermock-api-mockito2:2.+'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
URLClassLoader loader = GroovyObject.class.classLoader
configurations.sqllite.each { File file ->
loader.addURL(file.toURL())
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
I try to run the build for the project, and I get the following error:
Caused by: org.gradle.api.InvalidUserDataException: Cannot change strategy of configuration ':sqllite' after it has been resolved.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.preventIllegalMutation(DefaultConfiguration.java:896)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:867)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultCachePolicy.eachModule(DefaultCachePolicy.java:161)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultCachePolicy.cacheChangingModulesFor(DefaultCachePolicy.java:121)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.cacheChangingModulesFor(DefaultResolutionStrategy.java:190)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.cacheChangingModulesFor(DefaultResolutionStrategy.java:186)
at org.gradle.api.artifacts.ResolutionStrategy$cacheChangingModulesFor.call(Unknown Source)
at build_2rl70kyg6ax354v7xbsnpa8n1$_run_closure8.doCall(C:\Users\dipinton\8woc2018-jvm\build.gradle:114)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:155)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106)
at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:167)
at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:158)
at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:174)
at org.gradle.api.DomainObjectCollection$all.call(Unknown Source)
at build_2rl70kyg6ax354v7xbsnpa8n1.run(C:\Users\dipinton\8woc2018-jvm\build.gradle:113)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
... 99 more
It's my impression that this error I'm receiving has to do with the fact that I have 2 configurations blocks. One for configuring my SQLite module, and another for handling the resolution strategy of all modules. These two closures seem to be conflicting with one another.
Does anyone have any suggestions on how to remove the conflict between these two closures?
This working with addUrl on the copy of configuration:
def sqliteCopy = configurations.sqlite.copy()
sqliteCopy.each {File file ->
loader.addURL(file.toURI().toURL())
}
instead of:
configurations.sqllite.each { File file ->
loader.addURL(file.toURL())
}
or downgrade com.android.tools.build:gradle to 3.1.4 version.
I am using gretty as my container for building my spring project . But when i issue the command gradle clean or gradle jettyRun ,i am getting the following problem
Cannot add task ':jettyRun' as a task with that name already exists.
PFB my build.gradle file
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
apply plugin: 'jetty' //too old, Jetty6, use gretty
apply plugin: 'org.akhikhl.gretty'
apply plugin: 'idea'
apply plugin: 'jacoco' //code coverage
def springVersion = "4.2.4.RELEASE"
def jdkVersion = 1.8
def junitVersion = "4.12"
def logbackVersion = "1.1.3"
def jclOverSlf4jVersion = "1.7.14"
def jstlVersion = "1.2"
def hamcrestVersion = "1.3"
def servletApiVersion = "3.1"
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
repositories {
mavenLocal()
mavenCentral()
}
task wrapper(type: Wrapper) {
gradleVersion = '2.10'
}
configurations.all {
exclude group: "commons-logging", module: "commons-logging"
}
dependencies {
compile 'org.slf4j:jcl-over-slf4j:' + jclOverSlf4jVersion
compile 'ch.qos.logback:logback-classic:' + logbackVersion
compile 'org.springframework:spring-webmvc:' +springVersion
compile 'javax.servlet:jstl:' + jstlVersion
compile 'org.springframework:spring-test:' + springVersion
//exclude the build in hamcrest
testCompile('junit:junit:' + junitVersion) {
exclude group: 'org.hamcrest'
}
testCompile 'org.hamcrest:hamcrest-library:' + hamcrestVersion
//include in compile only, exclude in the war
providedCompile 'javax.servlet:javax.servlet-api:' + servletApiVersion
}
//Gretty
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.akhikhl.gretty:gretty:+'
}
}
gretty {
//port = 9000
contextPath = 'loanSharks'
servletContainer = 'jetty9'
}
//For Eclipse IDE only
eclipse {
wtp {
component {
//define context path, default to project folder name
contextPath = 'loanSharks'
}
}
}
jacoco {
toolVersion = "0.7.5+"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
Even removes plugin: 'jetty', but I am being still with the error:
Execution failed for task ':jettyRun'.
Cannot call TaskInputs.property(String, Object) on task ':jettyRun' after task has started execution.
I want to be able to have different subprojects inside my main project. For example:
-- my-project/
- Gruntfile.js
- subproject1/
- index.html
- scss/
- main.scss
- subproject2/
- index.html
- scss/
- main.scss
I want to be able to modify a file in subproject1 without triggering subproject2 tasks.
As of right now I'm configuring my gruntfile like so:
watch: {
subproject1: {
files: ['subproject1/*.html', 'subproject1/scss/**/*.scss'],
tasks: ['sass', 'premailer:subproject1']
},
subproject2: {
files: ['subproject2/*.html', 'subproject2/scss/**/*.scss'],
tasks: ['sass', 'premailer:subproject2']
}
},
premailer: {
subproject1: {
options: {
css: 'subproject1/css/main.css',
verbose: false
},
files: [
{
'subproject1/dist/index.html' : 'subproject1/index.html'
}
]
},
subproject2: {
options: {
css: 'subproject2/css/main.css',
verbose: false
},
files: [
{
'subproject2/dist/index.html' : 'subproject2/index.html'
}
]
},
}
Is there a way to dynamically specify to grunt what task to run depending on file modified (eg, I modify folder/index.html, then run premailer:folder) or is this the only way to achieve it ?
You can check all folders in your main folder inside your Gruntfile, using the grunt.file methods (docs here), create an array of subproject names and then using forEach to create your task dynamically.
Something like this should go:
/*global module:false*/
module.exports = function(grunt) {
var mycwd = "./";
var tempFileList = grunt.file.expand(
{ filter: function (src) {
if (grunt.file.isDir(src) == true) {
return true;
}
return false;
} },
[ mycwd + "!(Gruntfile.js|node_modules|package.json)" ] // structure to analyse
);
// I create an empty array to put all elements in, once cleaned.
var fileList = [];
tempFileList.forEach(function(url){
var cwd = url;
cwd = cwd.replace(mycwd, "");
fileList.push(cwd);
})
var watchObject = {};
var premailerObject = {};
fileList.forEach(function(name) {
watchObject[name] = {
files: [name + '/*.html', name + '/scss/**/*.scss'],
tasks: ['sass', 'premailer:' + name]
};
var filesObject = {};
filesObject[name+'/css/main.css'] = name + '/index.html';
premailerObject[name] = {
options: { css: name + '/css/main.css', verbose: false },
files: [ filesObject ]
};
});
var configObject = {
watch: watchObject,
premailer: premailerObject
};
// just to check the final structure
console.log(configObject);
grunt.initConfig(configObject);
};
I am having trouble using grunt-cssc in my Foundation 5 framework.
Error:
Running "cssc:build" <cssc> task
Warning: cannot read property 'type' of undefined use --force to continue.
My Code:
cssc: {
build: {
files: {
'css/app.css': 'css/app.css'
}
}
},
It was most probably conflicting with libsass or something else from Foundation side.
I solved it by adding options and setting "sortDeclarations", "consolidateViaSelectors", "consolidateMediaQueries" to false.
cssc: {
build: {
options: {
sortSelectors: true,
lineBreaks: true,
sortDeclarations:true,
consolidateViaDeclarations:false,
consolidateViaSelectors:false,
consolidateMediaQueries:false,
},
files: {
'css/app.css': 'css/app.css'
}
}
},
I want to use Qbs to compile an existing project. This project already contains a code-transformation-tool (my_tool) that is used heavily in this project.
So far I have (simplified):
import qbs 1.0
Project {
Application {
name: "my_tool"
files: "my_tool/main.cpp"
Depends { name: "cpp" }
}
Application {
name: "my_app"
Group {
files: 'main.cpp.in'
fileTags: ['cpp_in']
}
Depends { name: "cpp" }
Rule {
inputs: ["cpp_in"]
Artifact {
fileName: input.baseName
fileTags: "cpp"
}
prepare: {
var mytool = /* Reference to my_tool */;
var cmd = new Command(mytool, input.fileName, output.fileName);
cmd.description = "Generate\t" + input.baseName;
cmd.highlight = "codegen";
return cmd;
}
}
}
}
How can I get the reference to my_tool for the command?
This answer is based on an email from Qbs author Joerg Bornemann who allowed me to cite it here.
The property usings of Rule allows to add artifacts from products dependencies to the inputs.
In this case we are interested in "application" artifacts.
The list of applications could then be accessed as input.application.
Application {
name: "my_app"
Group {
files: 'main.cpp.in'
fileTags: ['cpp_in']
}
Depends { name: "cpp" }
// we need this dependency to make sure that my_tool exists before building my_app
Depends { name: "my_tool" }
Rule {
inputs: ["cpp_in"]
usings: ["application"] // dependent "application" products appear in inputs
Artifact {
fileName: input.completeBaseName
fileTags: "cpp"
}
prepare: {
// inputs["application"] is a list of "application" products
var mytool = inputs["application"][0].fileName;
var cmd = new Command(mytool, [inputs["cpp_in"][0].fileName, output.fileName]);
cmd.description = "Generate\t" + input.baseName;
cmd.highlight = "codegen";
return cmd;
}
}
}
Unfortunately the usings property in a Rule is deprecated since QBS 1.5.0. At the moment I have the same requirement. Using a product artifact in a non multiplex Rule.
The problem with a multiplex Rule is, if a single file in the input set changes, all input artifacts will be re-processed. Which is rather time consuming in my case.