-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gradle quarkusBuild has error : SRCFG00035: Failed to load resource #16429
Comments
/cc @evanchooly, @glefloch, @quarkusio/devtools |
@ixre, I just tested with a simple project generated from |
I have same error code.
I needed to add symlink from project to |
@rpr13 have you a reproducer? it looks like you are using gradle 7.0, have the same issue with gradle 6.8.3 ? |
Hi, I don't know what reproducer is. Same thing happened on gradle 6.8.3. |
just a sample project that fails with this error. |
I have this import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "test"
version = "1.0.0"
plugins {
kotlin("jvm") version "1.4.32"
id("io.quarkus") version "1.13.2.Final"
}
repositories {
mavenCentral()
}
val coroutinesVersion = "1.4.3"
val quarkusPlatformVersion = "1.13.2.Final"
val influxDbClientJavaVersion = "2.1.0"
val influxDbJavaVersion = "2.21"
val sshdVersion = "2.6.0"
val joolVersion = "0.9.14"
dependencies {
implementation(platform(kotlin("bom")))
implementation(kotlin("reflect"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
// implementation(platform("io.quarkus:quarkus-bom:${quarkusPlatformVersion}"))
implementation(platform("io.quarkus:quarkus-universe-bom:${quarkusPlatformVersion}"))
implementation("io.quarkus:quarkus-kotlin")
implementation("io.quarkus:quarkus-resteasy-jsonb")
implementation("io.quarkus:quarkus-hibernate-orm-panache-kotlin")
implementation("io.quarkus:quarkus-jdbc-mariadb")
implementation("io.quarkus:quarkus-jdbc-mysql")
implementation("io.quarkus:quarkus-smallrye-openapi")
implementation("io.quarkus:quarkus-oidc")
implementation("io.quarkus:quarkus-scheduler")
implementation("io.quarkus:quarkus-quartz")
implementation("com.influxdb:influxdb-client-java:${influxDbClientJavaVersion}")
implementation("org.influxdb:influxdb-java:${influxDbJavaVersion}")
implementation("org.apache.sshd:sshd-core:${sshdVersion}")
implementation("org.amqphub.quarkus:quarkus-qpid-jms")
// https://github.com/jOOQ/jOOL
implementation("org.jooq:jool:${joolVersion}")
testImplementation("io.quarkus:quarkus-junit5")
testImplementation("io.rest-assured:rest-assured")
testImplementation("io.rest-assured:kotlin-extensions")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "11"
}
tasks.wrapper { distributionType = Wrapper.DistributionType.ALL } |
Oh TEST=test |
Thanks I will test with that. |
Experiencing similar problems as described in #16429 (comment), but with
|
Issue was introduced from [x80486@uplink:~/somewhere/kotlin-quarkus]$ ./gradlew -Dquarkus.package.type=fast-jar --stacktrace clean quarkusBuild
...
Caused by: java.lang.IllegalStateException: SRCFG00035: Failed to load resource
at io.smallrye.config.AbstractLocationConfigSourceLoader.addConfigSource(AbstractLocationConfigSourceLoader.java:209)
at io.smallrye.config.AbstractLocationConfigSourceLoader.addConfigSource(AbstractLocationConfigSourceLoader.java:201)
at io.smallrye.config.AbstractLocationConfigSourceLoader.access$300(AbstractLocationConfigSourceLoader.java:49)
at io.smallrye.config.AbstractLocationConfigSourceLoader$ConfigSourcePathConsumer.accept(AbstractLocationConfigSourceLoader.java:290)
at io.smallrye.config.AbstractLocationConfigSourceLoader$ConfigSourcePathConsumer.accept(AbstractLocationConfigSourceLoader.java:279)
at io.smallrye.common.classloader.ClassPathUtils.lambda$consumeAsPath$0(ClassPathUtils.java:102)
at io.smallrye.common.classloader.ClassPathUtils.processAsPath(ClassPathUtils.java:140)
at io.smallrye.common.classloader.ClassPathUtils.consumeAsPath(ClassPathUtils.java:101)
at io.smallrye.config.AbstractLocationConfigSourceLoader.tryFileSystem(AbstractLocationConfigSourceLoader.java:100)
at io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:81)
at io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:65)
at io.smallrye.config.DotEnvConfigSourceProvider.getConfigSources(DotEnvConfigSourceProvider.java:45)
at io.quarkus.runtime.configuration.ConfigUtils.configBuilder(ConfigUtils.java:105)
at io.quarkus.runtime.configuration.ConfigUtils.configBuilder(ConfigUtils.java:64)
at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:146)
at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:101)
at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:394)
... 124 more
Caused by: java.nio.file.NoSuchFileException: /home/x80486/.gradle/daemon/7.0/.env
at io.smallrye.common.classloader.ClassPathUtils.readStream(ClassPathUtils.java:205)
at io.smallrye.common.classloader.ClassPathUtils.consumeStream(ClassPathUtils.java:158)
at io.smallrye.config.common.utils.ConfigSourceUtil.urlToMap(ConfigSourceUtil.java:64)
at io.quarkus.runtime.configuration.ConfigUtils$BuildTimeDotEnvConfigSourceProvider.loadConfigSource(ConfigUtils.java:181)
at io.smallrye.config.DotEnvConfigSourceProvider.loadConfigSource(DotEnvConfigSourceProvider.java:30)
at io.smallrye.config.AbstractLocationConfigSourceLoader.addConfigSource(AbstractLocationConfigSourceLoader.java:206)
... 140 more I tested all those versions one by one 😅 ... |
@radcortez have you already seen this? I don't why it tries to load a |
Hum, the files are optional. So this shouldn't happen. Let me have a look. |
To clarify, in my case I have a When I delete |
Hum, it seems this is caused by the Gradle Daemon setting the default directory and later in the execution modifying the When we introduced the new config loader, we call |
I think we may be able to fix this if we construct a valid URI with the |
Hopefully #16777 will fix this. |
Any suggestions how to workaround this in the meantime? I have a build that has just started throwing this despite not changing anything. |
Hi @brianmcgee, Which Quarkus version are you using? Did you update between not observing the issue and when experiencing the issue? Do you have an |
@radcortez I'm using 1.13.2.Final. I haven't changed the version and I'm using an application.yaml in the |
I was able to resolve my issue. Here's what happened. I have a multi module project and one of the sub modules was failing to build. I had added a In this instance I can work around having the |
Are you able to try this out with This was fixed in #16429, but apparently the automatic link pull request failed. |
Hi @radcortez , same issue here while executing Quarkusbuild Quarkus 2.7.5.Final Error: /Users/developer/.gradle/daemon/7.4.1/config/application.yml
Current code public static class InClassPath extends ApplicationYamlConfigSourceLoader implements ConfigSourceProvider {
@Override
public List<ConfigSource> getConfigSources(final ClassLoader classLoader) {
List<ConfigSource> configSources = new ArrayList<>();
configSources.addAll(loadConfigSources("application.yaml", 255, classLoader));
configSources.addAll(loadConfigSources("application.yml", 255, classLoader));
return configSources;
}
@Override
protected List<ConfigSource> tryFileSystem(final URI uri, final int ordinal) {
return new ArrayList<>();
}
}
public static class InFileSystem extends ApplicationYamlConfigSourceLoader implements ConfigSourceProvider {
@Override
public List<ConfigSource> getConfigSources(final ClassLoader classLoader) {
List<ConfigSource> configSources = new ArrayList<>();
configSources.addAll(loadConfigSources("config/application.yaml", 265, classLoader));
configSources.addAll(loadConfigSources("config/application.yml", 265, classLoader));
return configSources;
}
@Override
protected List<ConfigSource> tryClassPath(final URI uri, final int ordinal, final ClassLoader classLoader) {
return new ArrayList<>();
}
} Original fixed version, @Override
public List<ConfigSource> getConfigSources(final ClassLoader classLoader) {
return loadConfigSources("config/application.properties", classLoader);
return loadConfigSources(
Paths.get(System.getProperty("user.dir"), "config", "application.properties").toUri().toString(),
classLoader);
} |
@baivoom can you please provide a reproducer? Thanks! |
Hi @radcortez here is the reproduce , I am using IntelliJ. I found the error is caused by a |
I found a different but very similar issue: #36767 (because of the presence of an empty |
Since upgrading from to 1.13.x, run below command
Gradle made a error: SRCFG00035: Failed to load resource, full stacktrace is:
My system jdk version :
when I use
adoptjdk15-openj9
or downgrade quarkus version to1.12.2.Final
, it' all fine.The text was updated successfully, but these errors were encountered: