Explore all Eclipse open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Eclipse

theia

Eclipse Theia v1.24.0

che

Eclipse Che 7.45.0

jacoco

0.8.7

openj9

Eclipse OpenJ9 v0.32.0

spotbugs

SpotBugs 4.6.0

Popular Libraries in Eclipse

monaco-editor

by microsoft doticonjavascriptdoticon

star image 28702 doticonMIT

A browser based code editor

theia

by eclipse-theia doticontypescriptdoticon

star image 16718 doticonNOASSERTION

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.

che

by eclipse doticontypescriptdoticon

star image 6635 doticonEPL-2.0

The Kubernetes-Native IDE for Developer Teams

GCViewer

by chewiebug doticonjavadoticon

star image 3965 doticonNOASSERTION

Fork of tagtraum industries' GCViewer. Tagtraum stopped development in 2008, I aim to improve support for Sun's / Oracle's java 1.6+ garbage collector logs (including G1 collector)

jacoco

by jacoco doticonjavadoticon

star image 3184 doticonNOASSERTION

:microscope: Java Code Coverage Library

jersey

by jersey doticonjavadoticon

star image 2920 doticonNOASSERTION

This is no longer the active Jersey repository. Please see the README.md

jersey

by javaee doticonjavadoticon

star image 2907 doticonNOASSERTION

This is no longer the active Jersey repository. Please see the README.md

openj9

by eclipse-openj9 doticonjavadoticon

star image 2859 doticonNOASSERTION

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.

spotbugs

by spotbugs doticonjavadoticon

star image 2699 doticonLGPL-2.1

SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.

Trending New libraries in Eclipse

theia-blueprint

by eclipse-theia doticontypescriptdoticon

star image 141 doticonNOASSERTION

Eclipse Theia Blueprint is a template for building desktop-based products based on the Eclipse Theia platform, as well as to showcase Eclipse Theia capabilities. It is made up of a subset of existing Eclipse Theia features and extensions and can be easily downloaded and installed on all major operating system platforms.

sims

by rawchen doticonjavadoticon

star image 112 doticon

学生信息管理系统SIMS,Java Servlet And Jsp.

v8-code-style

by 1C-Company doticonjavadoticon

star image 109 doticonEPL-2.0

Расширение для 1C:EDT, которое помогает разрабатывать конфигурации/приложения по стандартам 1С для платформы "1С:Предприятие 8".

sims

by yoyling doticonjavadoticon

star image 107 doticon

学生信息管理系统SIMS,Java Servlet And Jsp.

aojdk-updatewatcher

by tushev doticoncsharpdoticon

star image 84 doticonMIT

Automatic update tool for AdoptOpenJDK, Eclipse Temurin™ and/or IBM® Semeru® Open Edition releases

coc-java-debug

by dansomething doticontypescriptdoticon

star image 78 doticonEPL-2.0

An extension for coc.nvim to enable Java debugging via jdt.ls

felix-dev

by apache doticonjavadoticon

star image 74 doticonApache-2.0

Apache felix

flowable-bpmn-intellij-plugin

by valb3r doticonkotlindoticon

star image 62 doticonMIT

Flowable, Activiti (6.x), Camunda BPMN engines process editor plugin for IntelliJ. Pure Kotlin (and some Java)

editor

by bridge-core doticontypescriptdoticon

star image 59 doticonGPL-3.0

Next generation of bridge., the Minecraft Add-On editor

Top Authors in Eclipse

1

eclipse

100 Libraries

star icon15895

2

ctron

12 Libraries

star icon98

3

jbosstools

12 Libraries

star icon165

4

angelozerr

12 Libraries

star icon1039

5

javaee

12 Libraries

star icon3589

6

eclipse-ee4j

11 Libraries

star icon831

7

microsoft

10 Libraries

star icon30294

8

ibmruntimes

10 Libraries

star icon177

9

de-jcup

9 Libraries

star icon123

10

eclipsesource

9 Libraries

star icon324

1

100 Libraries

star icon15895

2

12 Libraries

star icon98

3

12 Libraries

star icon165

4

12 Libraries

star icon1039

5

12 Libraries

star icon3589

6

11 Libraries

star icon831

7

10 Libraries

star icon30294

8

10 Libraries

star icon177

9

9 Libraries

star icon123

10

9 Libraries

star icon324

Trending Kits in Eclipse

No Trending Kits are available at this moment for Eclipse

Trending Discussions on Eclipse

type deduction for std::function argument types with auto adds const

Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED

Springboot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'

Pushing from Eclipse to my GitHub repository via HTTPS stopped working: "git-receive-pack not permitted" error

Spring Cloud Config Server GitHub SHA-1 error

Eclipse/Git: "You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type."

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent, On AlarmPingSender

Kubernetes use the same volumeMount in initContainer and Container

How can I specify location of AndroidManifest.xml?

Disabling "Download sources and javadoc" in eclipse

QUESTION

type deduction for std::function argument types with auto adds const

Asked 2022-Apr-08 at 14:31

I have a struct with a method called call which has a const overload. The one and only argument is a std::function which either takes a int reference or a const int reference, depending on the overload.

The genericCall method does exactly the same thing but uses a template parameter instead of a std::function as type.

1struct SomeStruct {
2    int someMember = 666;
3
4    void call(std::function<void(int&)> f) & {
5        f(someMember);
6        std::cout << "call: non const\n";
7    }
8
9    void call(std::function<void(const int&)> f) const& {
10        f(someMember);
11        std::cout << "call: const\n";
12    }
13
14
15    template <typename Functor>
16    void genericCall(Functor f) & {
17        f(someMember);
18        std::cout << "genericCall: non const\n";
19    }
20
21    template <typename Functor>
22    void genericCall(Functor f) const& {
23        f(someMember);
24        std::cout << "genericCall: const\n";
25    }
26};
27

When I now create this struct and call call with a lambda and auto & as argument the std::function always deduces a const int & despite the object not being const.

The genericCall on the other hand deduces the argument correctly as int & inside the lamdba.

1struct SomeStruct {
2    int someMember = 666;
3
4    void call(std::function<void(int&)> f) & {
5        f(someMember);
6        std::cout << "call: non const\n";
7    }
8
9    void call(std::function<void(const int&)> f) const& {
10        f(someMember);
11        std::cout << "call: const\n";
12    }
13
14
15    template <typename Functor>
16    void genericCall(Functor f) & {
17        f(someMember);
18        std::cout << "genericCall: non const\n";
19    }
20
21    template <typename Functor>
22    void genericCall(Functor f) const& {
23        f(someMember);
24        std::cout << "genericCall: const\n";
25    }
26};
27SomeStruct some;
28some.call([](auto& i) {
29    i++;  // ?? why does auto deduce it as const int & ??
30});
31some.genericCall([](auto& i) {
32    i++;  // auto deduces it correctly as int &
33});
34

I have no the slightest clue why auto behaves in those two cases differently or why std::function seems to prefer to make the argument const here. This causes a compile error despite the correct method is called. When I change the argument from auto & to int & everything works fine again.

1struct SomeStruct {
2    int someMember = 666;
3
4    void call(std::function<void(int&)> f) & {
5        f(someMember);
6        std::cout << "call: non const\n";
7    }
8
9    void call(std::function<void(const int&)> f) const& {
10        f(someMember);
11        std::cout << "call: const\n";
12    }
13
14
15    template <typename Functor>
16    void genericCall(Functor f) & {
17        f(someMember);
18        std::cout << "genericCall: non const\n";
19    }
20
21    template <typename Functor>
22    void genericCall(Functor f) const& {
23        f(someMember);
24        std::cout << "genericCall: const\n";
25    }
26};
27SomeStruct some;
28some.call([](auto& i) {
29    i++;  // ?? why does auto deduce it as const int & ??
30});
31some.genericCall([](auto& i) {
32    i++;  // auto deduces it correctly as int &
33});
34some.call([](int& i) {
35    i++; 
36});
37

When I do the same call with a const version of the struct everything is deduced as expected. Both call and genericCall deduce a const int & here.

1struct SomeStruct {
2    int someMember = 666;
3
4    void call(std::function<void(int&)> f) & {
5        f(someMember);
6        std::cout << "call: non const\n";
7    }
8
9    void call(std::function<void(const int&)> f) const& {
10        f(someMember);
11        std::cout << "call: const\n";
12    }
13
14
15    template <typename Functor>
16    void genericCall(Functor f) & {
17        f(someMember);
18        std::cout << "genericCall: non const\n";
19    }
20
21    template <typename Functor>
22    void genericCall(Functor f) const& {
23        f(someMember);
24        std::cout << "genericCall: const\n";
25    }
26};
27SomeStruct some;
28some.call([](auto& i) {
29    i++;  // ?? why does auto deduce it as const int & ??
30});
31some.genericCall([](auto& i) {
32    i++;  // auto deduces it correctly as int &
33});
34some.call([](int& i) {
35    i++; 
36});
37const SomeStruct constSome;
38constSome.call([](auto& i) {
39    // auto deduces correctly const int & and therefore it should
40    // not compile
41    i++;
42});
43constSome.genericCall([](auto& i) {
44    // auto deduces correctly const int & and therefore it should
45    // not compile
46    i++;
47});
48

If someone could shine some light on this I would be very grateful!

For the more curious ones who want to dive even deeper, this problem arose in the pull request: https://github.com/eclipse-iceoryx/iceoryx/pull/1324 while implementing a functional interface for an expected implementation.

ANSWER

Answered 2022-Apr-08 at 13:25

The problem is that generic lambdas (auto param) are equivalent to a callable object whose operator() is templated. This means that the actual type of the lambda argument is not contained in the lambda, and only deduced when the lambda is invoked.

However in your case, by having specific std::function arguments, you force a conversion to a concrete type before the lambda is invoked, so there is no way to deduce the auto type from anything. There is no SFINAE in a non-template context.

With no specific argument type, both your call are valid overloads. Actually any std::function that can match an [](auto&) is valid. Now the only rule is probably that the most cv-qualified overload wins. You can try with a volatile float& and you will see it will still choose that. Once it choose this overload, the compilation will fail when trying to invoke.

Source https://stackoverflow.com/questions/71797023

QUESTION

Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED

Asked 2022-Mar-26 at 15:23

I have newly installed

1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14

I cloned project I work with on other workstation without issues, but cannot start any class with main method and IDEA says:

1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14Abnormal build process termination: 
15/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs=\"\" -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=-5972351880001011455 -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US -Didea.paths.selector=IntelliJIdea2021.2 -Didea.home.path=/home/pm/idea-IU-212.4746.92 -Didea.config.path=/home/pm/.config/JetBrains/IntelliJIdea2021.2 -Didea.plugins.path=/home/pm/.local/share/JetBrains/IntelliJIdea2021.2 -Djps.log.dir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/log/build-log -Djps.fallback.jdk.home=/home/pm/idea-IU-212.4746.92/jbr -Djps.fallback.jdk.version=11.0.11 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server/rfg-survey-api_cc70fc05/_temp_ -Djps.backward.ref.index.builder=true -Djps.track.ap.dependencies=false --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Dtmh.instrument.annotations=true -Dtmh.generate.line.numbers=true -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"/tmp/kotlin-idea-12426594439704512301-is-running\" -classpath /home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar org.jetbrains.jps.cmdline.Launcher /home/pm/idea-IU-212.4746.92/lib/slf4j.jar:/home/pm/idea-IU-212.4746.92/lib/idea_rt.jar:/home/pm/idea-IU-212.4746.92/lib/platform-api.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-file-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/forms_rt.jar:/home/pm/idea-IU-212.4746.92/lib/util.jar:/home/pm/idea-IU-212.4746.92/lib/annotations.jar:/home/pm/idea-IU-212.4746.92/lib/3rd-party.jar:/home/pm/idea-IU-212.4746.92/lib/kotlin-stdlib-jdk8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-connector-basic-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/jna-platform.jar:/home/pm/idea-IU-212.4746.92/lib/protobuf-java-3.15.8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders-6.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/javac2.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/aether-dependency-resolver.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-javac-extension-1.jar:/home/pm/idea-IU-212.4746.92/lib/jna.jar:/home/pm/idea-IU-212.4746.92/lib/jps-model.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-http-1.3.3.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/jasper-v2-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-reflect.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/ant/lib/ant-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-common.jar:/home/pm/idea-IU-212.4746.92/plugins/IntelliLang/lib/java-langInjection-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-constants-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/maven/lib/maven-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/gradle-java/lib/gradle-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/devkit/lib/devkit-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-common.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/javaee-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/webSphereIntegration/lib/jps/javaee-appServers-websphere-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/weblogicIntegration/lib/jps/javaee-appServers-weblogic-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/JPA/lib/jps/javaee-jpa-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-compilerPatch.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-jps-common.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-common.jar org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 34781 9f0681bb-da2a-48db-8344-900ddeb29804 /home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server
16Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
17Error: Could not create the Java Virtual Machine.
18Error: A fatal exception has occurred. Program will exit.
19

I found other comment to check Lombok works and I see it is fine.

How to fix the problem?

ANSWER

Answered 2021-Jul-28 at 07:22

You are running the project via Java 1.8 and add the --add-opens option to the runner. However Java 1.8 does not support it.

So, the first option is to use Java 11 to run the project, as Java 11 can recognize this VM option.

Another solution is to find a place where --add-opens is added and remove it. Check Run configuration in IntelliJ IDEA (VM options field) and Maven/Gradle configuration files for argLine (Maven) and jvmArgs (Gradle)

Source https://stackoverflow.com/questions/68554693

QUESTION

Springboot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'

Asked 2022-Mar-25 at 06:14

I'm trying to initiate a Springboot project using Open Jdk 15, Springboot 2.6.0, Springfox 3. We are working on a project that replaced Netty as the webserver and used Jetty instead because we do not need a non-blocking environment.

In the code we depend primarily on Reactor API (Flux, Mono), so we can not remove org.springframework.boot:spring-boot-starter-webflux dependencies.

I replicated the problem that we have in a new project.: https://github.com/jvacaq/spring-fox.

I figured out that these lines in our build.gradle file are the origin of the problem.

1compile("org.springframework.boot:spring-boot-starter-web") {
2   exclude module: "spring-boot-starter-tomcat"
3}
4compile("org.springframework.boot:spring-boot-starter-jetty")
5

Here is the build.gradle file:

1compile("org.springframework.boot:spring-boot-starter-web") {
2   exclude module: "spring-boot-starter-tomcat"
3}
4compile("org.springframework.boot:spring-boot-starter-jetty")
5plugins {
6    id 'org.springframework.boot' version '2.6.0'
7    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
8    id 'java'
9}
10
11group = 'com.example'
12version = '0.0.1-SNAPSHOT'
13sourceCompatibility = '11'
14
15repositories {
16    mavenCentral()
17}
18
19dependencies {
20    compile("org.springframework.boot:spring-boot-starter-web") {
21        exclude module: "spring-boot-starter-tomcat"
22    }
23    compile("org.springframework.boot:spring-boot-starter-jetty")
24    implementation 'org.springframework.boot:spring-boot-starter-webflux'
25    testImplementation 'org.springframework.boot:spring-boot-starter-test'
26    testImplementation 'io.projectreactor:reactor-test'
27    implementation "io.springfox:springfox-boot-starter:3.0.0"
28}
29
30test {
31    useJUnitPlatform()
32}
33
34

I issued the command gradle clean bootrun. The result is this error:

1compile("org.springframework.boot:spring-boot-starter-web") {
2   exclude module: "spring-boot-starter-tomcat"
3}
4compile("org.springframework.boot:spring-boot-starter-jetty")
5plugins {
6    id 'org.springframework.boot' version '2.6.0'
7    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
8    id 'java'
9}
10
11group = 'com.example'
12version = '0.0.1-SNAPSHOT'
13sourceCompatibility = '11'
14
15repositories {
16    mavenCentral()
17}
18
19dependencies {
20    compile("org.springframework.boot:spring-boot-starter-web") {
21        exclude module: "spring-boot-starter-tomcat"
22    }
23    compile("org.springframework.boot:spring-boot-starter-jetty")
24    implementation 'org.springframework.boot:spring-boot-starter-webflux'
25    testImplementation 'org.springframework.boot:spring-boot-starter-test'
26    testImplementation 'io.projectreactor:reactor-test'
27    implementation "io.springfox:springfox-boot-starter:3.0.0"
28}
29
30test {
31    useJUnitPlatform()
32}
33
34 gradle clean bootrun                                                                                                                                                                                                               
35
36> Task :bootRun FAILED
37
38  .   ____          _            __ _ _
39 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
40( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
41 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
42  '  |____| .__|_| |_|_| |_\__, | / / / /
43 =========|_|==============|___/=/_/_/_/
44 :: Spring Boot ::                (v2.6.0)
45
462021-11-19 09:41:06.665  INFO 16666 --- [           main] c.e.springfox.SpringFoxApplication       : Starting SpringFoxApplication using Java 15.0.2 on advance-Inspiron-5379 with PID 16666 (/home/advance/projects/spring-fox/build/classes/java/main started by advance in /home/advance/projects/spring-fox)
472021-11-19 09:41:06.666  INFO 16666 --- [           main] c.e.springfox.SpringFoxApplication       : No active profile set, falling back to default profiles: default
482021-11-19 09:41:07.294  INFO 16666 --- [           main] org.eclipse.jetty.util.log               : Logging initialized @1132ms to org.eclipse.jetty.util.log.Slf4jLog
492021-11-19 09:41:07.396  INFO 16666 --- [           main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8080
502021-11-19 09:41:07.398  INFO 16666 --- [           main] org.eclipse.jetty.server.Server          : jetty-9.4.44.v20210927; built: 2021-09-27T23:02:44.612Z; git: 8da83308eeca865e495e53ef315a249d63ba9332; jvm 15.0.2+7-27
512021-11-19 09:41:07.417  INFO 16666 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
522021-11-19 09:41:07.417  INFO 16666 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 713 ms
532021-11-19 09:41:07.474  INFO 16666 --- [           main] org.eclipse.jetty.server.session         : DefaultSessionIdManager workerName=node0
542021-11-19 09:41:07.474  INFO 16666 --- [           main] org.eclipse.jetty.server.session         : No SessionScavenger set, using defaults
552021-11-19 09:41:07.475  INFO 16666 --- [           main] org.eclipse.jetty.server.session         : node0 Scavenging every 660000ms
562021-11-19 09:41:07.480  INFO 16666 --- [           main] o.e.jetty.server.handler.ContextHandler  : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@6aa3bfc{application,/,[file:///tmp/jetty-docbase.8080.2024342829220941812/, jar:file:/home/advance/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-ui/3.0.0/1e665fbe22148f7c36fa8a08e515a0047cd4390b/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
572021-11-19 09:41:07.480  INFO 16666 --- [           main] org.eclipse.jetty.server.Server          : Started @1318ms
582021-11-19 09:41:07.920  INFO 16666 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring DispatcherServlet 'dispatcherServlet'
592021-11-19 09:41:07.920  INFO 16666 --- [           main] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
602021-11-19 09:41:07.921  INFO 16666 --- [           main] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
612021-11-19 09:41:07.931  INFO 16666 --- [           main] o.e.jetty.server.AbstractConnector       : Started ServerConnector@2643d762{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
622021-11-19 09:41:07.932  INFO 16666 --- [           main] o.s.b.web.embedded.jetty.JettyWebServer  : Jetty started on port(s) 8080 (http/1.1) with context path '/'
632021-11-19 09:41:07.934  WARN 16666 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
642021-11-19 09:41:07.949  INFO 16666 --- [           main] o.e.jetty.server.AbstractConnector       : Stopped ServerConnector@2643d762{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
652021-11-19 09:41:07.950  INFO 16666 --- [           main] org.eclipse.jetty.server.session         : node0 Stopped scavenging
662021-11-19 09:41:07.951  INFO 16666 --- [           main] o.e.j.s.h.ContextHandler.application     : Destroying Spring FrameworkServlet 'dispatcherServlet'
672021-11-19 09:41:07.951  INFO 16666 --- [           main] o.e.jetty.server.handler.ContextHandler  : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@6aa3bfc{application,/,[file:///tmp/jetty-docbase.8080.2024342829220941812/, jar:file:/home/advance/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-ui/3.0.0/1e665fbe22148f7c36fa8a08e515a0047cd4390b/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],STOPPED}
682021-11-19 09:41:07.958  INFO 16666 --- [           main] ConditionEvaluationReportLoggingListener : 
69
70Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
712021-11-19 09:41:07.970 ERROR 16666 --- [           main] o.s.boot.SpringApplication               : Application run failed
72
73org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
74        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.13.jar:5.3.13]
75        at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.13.jar:5.3.13]
76        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.13.jar:5.3.13]
77        at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
78        at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.13.jar:5.3.13]
79        at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.13.jar:5.3.13]
80        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.13.jar:5.3.13]
81        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.13.jar:5.3.13]
82        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.0.jar:2.6.0]
83        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.0.jar:2.6.0]
84        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.0.jar:2.6.0]
85        at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.0.jar:2.6.0]
86        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.0.jar:2.6.0]
87        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.0.jar:2.6.0]
88        at com.example.springfox.SpringFoxApplication.main(SpringFoxApplication.java:10) ~[main/:na]
89Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
90        at springfox.documentation.spring.web.WebMvcPatternsRequestConditionWrapper.getPatterns(WebMvcPatternsRequestConditionWrapper.java:56) ~[springfox-spring-webmvc-3.0.0.jar:3.0.0]
91        at springfox.documentation.RequestHandler.sortedPaths(RequestHandler.java:113) ~[springfox-core-3.0.0.jar:3.0.0]
92        at springfox.documentation.spi.service.contexts.Orderings.lambda$byPatternsCondition$3(Orderings.java:89) ~[springfox-spi-3.0.0.jar:3.0.0]
93        at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469) ~[na:na]
94        at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) ~[na:na]
95        at java.base/java.util.TimSort.sort(TimSort.java:220) ~[na:na]
96        at java.base/java.util.Arrays.sort(Arrays.java:1306) ~[na:na]
97        at java.base/java.util.ArrayList.sort(ArrayList.java:1721) ~[na:na]
98        at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:392) ~[na:na]
99        at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
100        at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
101        at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
102        at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
103        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) ~[na:na]
104        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
105        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
106        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
107        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
108        at springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider.requestHandlers(WebMvcRequestHandlerProvider.java:81) ~[springfox-spring-webmvc-3.0.0.jar:3.0.0]
109        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
110        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
111        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
112        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
113        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
114        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
115        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
116        at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.withDefaults(AbstractDocumentationPluginsBootstrapper.java:107) ~[springfox-spring-web-3.0.0.jar:3.0.0]
117        at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.buildContext(AbstractDocumentationPluginsBootstrapper.java:91) ~[springfox-spring-web-3.0.0.jar:3.0.0]
118        at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82) ~[springfox-spring-web-3.0.0.jar:3.0.0]
119        at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100) ~[springfox-spring-web-3.0.0.jar:3.0.0]
120        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.13.jar:5.3.13]
121        ... 14 common frames omitted
122
123
124FAILURE: Build failed with an exception.
125
126* What went wrong:
127Execution failed for task ':bootRun'.
128> Process 'command '/home/advance/.sdkman/candidates/java/15.0.2-open/bin/java'' finished with non-zero exit value 1
129
130* Try:
131Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
132
133* Get more help at https://help.gradle.org
134
135Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
136Use '--warning-mode all' to show the individual deprecation warnings.
137See https://docs.gradle.org/6.9.1/userguide/command_line_interface.html#sec:command_line_warnings
138
139BUILD FAILED in 2s
1405 actionable tasks: 5 executed
141

Does anyone have an idea how to solve it?

ANSWER

Answered 2022-Feb-08 at 12:36

This problem's caused by a bug in Springfox. It's making an assumption about how Spring MVC is set up that doesn't always hold true. Specifically, it's assuming that MVC's path matching will use the Ant-based path matcher and not the PathPattern-based matcher. PathPattern-based matching has been an option for some time now and is the default as of Spring Boot 2.6.

As described in Spring Boot 2.6's release notes, you can restore the configuration that Springfox assumes will be used by setting spring.mvc.pathmatch.matching-strategy to ant-path-matcher in your application.properties file. Note that this will only work if you are not using Spring Boot's Actuator. The Actuator always uses PathPattern-based parsing, irrespective of the configured matching-strategy. A change to Springfox will be required if you want to use it with the Actuator in Spring Boot 2.6 and later.

Source https://stackoverflow.com/questions/70036953

QUESTION

Pushing from Eclipse to my GitHub repository via HTTPS stopped working: "git-receive-pack not permitted" error

Asked 2022-Mar-25 at 03:18

I recently did a push to my GitHub repository for a few weeks ago. I got a main from GitHub that GitHub is soon quitting regular authorization and going to replace it with another authorization method.

So today I push a new update to my GitHub repository and got the message:

1git-receive-pack not permitted
2

That's leads to two questions:

  1. Has EGit stopped working now?
  2. I have Eclipse 2021-03, how can I fix this issue so I can do a push?

ANSWER

Answered 2021-Aug-20 at 07:52

Since August 13, 2021, GitHub does not support authentication via HTTPS with your GitHub account password for security reasons anymore. Instead, in Eclipse, when pushing to a GitHub repository or when fetching from a private repository, you will get a git-upload-pack not permitted on 'https://github.com...' error.

As solution, use either

  • a GitHub specific Personal access tokens as password instead of your previously used GitHub account password or
  • SSH with an SSH key of which the private and public key is on your local machine and configured in Eclipse and the public key is uploaded to your GitHub account instead.
Personal access token (GitHub specific)

enter image description here

  1. Go to your GitHub account to Settings > Developer settings > Personal access tokens website:
    1. Click the Generate new token button in the upper right
      • Enter a Note, e.g. GitHub repo token
      • Choose Expiration, e.g. No expiration
      • Tick the checkbox repo
    2. Click the Generate token button at the bottom
    3. Copy the generated token to the clipboard
  2. In Eclipse, in the Git Repositories view:
    1. Right-click the Remotes sub-node for GitHub (origin or the name you have chosen when you have cloned the repository) and choose Configure Push...
    2. Click the Change... button to change the URI in the upper right
    3. Replace the password with with the copied generated GitHub token
    4. Click Finish and Save to apply the changes
SSH
  1. Create an SSH key (skip this step when you already have one):
    1. In Eclipse, in the preferences General > Network Connections > SSH2 tab Key Management hit the Generate RSA Key... button
    2. Hit Save Private Key... and choose a location, preferably the subfolder .ssh of your user home directory
  2. Upload public key to your GitHub account:
    1. For a new created key, copy the string shown in the Key Management tab to the clipboard; for an existing key add it in the preferences General > Network Connections > SSH2 tab General and copy the content of the public key file <name>.pub
    2. Go to your GitHub account settings to the SSH and GPG keys section and hit the New SSH key button
    3. Paste the copied public key into the Key field
  3. Change HTTPS to SSH URLs of already cloned repositories:
    1. In Eclipse, in the Git Repositories view right-click the repository and choose Properties and click the Open button
    2. In the text editor of the config file change the remote URL as follows:

      HTTPS (old; does not work for push anymore):
1git-receive-pack not permitted
2url = <b>https</b><b>://</b>github.com<b>/</b>&lt;username&gt;/&lt;repo&gt;.git

SSH (new):
1git-receive-pack not permitted
2url = <b>https</b><b>://</b>github.com<b>/</b>&lt;username&gt;/&lt;repo&gt;.giturl = <b>git@</b>github.com<b>:</b>&lt;username&gt;/&lt;repo&gt;.git

Source https://stackoverflow.com/questions/68790276

QUESTION

Spring Cloud Config Server GitHub SHA-1 error

Asked 2022-Mar-22 at 03:13
Context

This is regarding a Spring Cloud Config Server hobby project (with @EnableConfigServer).

Yesterday, the application could be started.

Today, the application failed to start because of a Git communication error.

From GitHub's official blog post, it is mentioned that SHA-1 is no longer supported starting from 15 March 2022. And that explains the results I'm getting these 2 days.

March 15, 2022

Changes made permanent.

We’ll permanently stop accepting DSA keys. RSA keys uploaded after the cut-off point above will work only with SHA-2 signatures (but again, RSA keys uploaded before this date will continue to work with SHA-1). The deprecated MACs, ciphers, and unencrypted Git protocol will be permanently disabled.

Even if I didn't delete the existing SSH key, it still failed to start today. But anyway, now the only key under the "Deploy keys" section of the repository settings is an SSH key that was added after the March 15, 2022 cut off date.


Dependency versions

Dependency Management:

Dependency Version
spring-cloud-dependencies Hoxton.SR12

Dependency:

Dependency Version
spring-cloud-config-server (Managed)

Spring application configurations

application.yml:

1spring:
2  cloud:
3    config:
4      server:
5        git:
6          ignore-local-ssh-settings: true
7          uri: git@github.com:xxx/xxx.git
8          private-key: |
9                        -----BEGIN RSA PRIVATE KEY-----
10                        (omitted)
11                        -----END RSA PRIVATE KEY-----
12

Additional information

The involved repo is a GitHub private repo configured with an SSH key under the "Deploy keys" settings section.

I have been generating the SSH key pairs according to the Spring Cloud Config official documentation.


Error

From the console log, I see:

ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

This comes from JGit as a org.eclipse.jgit.errors.NoRemoteRepositoryException.


Question and my attempt to fix the issue

I tried upgrading the Spring Cloud dependency management version to the latest available in Maven repository, i.e. 2021.0.1, as it uses a newer version of JGit.

However, I'm still facing the same error.

If I just switch to GitLab with the exact same configurations, it just works regardless of the Spring Cloud dependency version and the JGit version.

What else can I do if I want to use GitHub?

ANSWER

Answered 2022-Mar-16 at 14:07

I have a same problem.

See https://github.com/spring-cloud/spring-cloud-config/issues/2061

For right now, I have a dirty workaround: use https uri, username and password(maybe personal secret token).

1spring:
2  cloud:
3    config:
4      server:
5        git:
6          ignore-local-ssh-settings: true
7          uri: git@github.com:xxx/xxx.git
8          private-key: |
9                        -----BEGIN RSA PRIVATE KEY-----
10                        (omitted)
11                        -----END RSA PRIVATE KEY-----
12spring:
13  cloud:
14    config:
15      server:
16        git:
17          uri: https://github.com/org/repo
18          username: ...
19          password: ...
20

Source https://stackoverflow.com/questions/71489256

QUESTION

Eclipse/Git: &quot;You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.&quot;

Asked 2022-Mar-18 at 13:27

I created a public key in Git using ssh-keygen which was successfully created as .ssh/id_rsa.pub.

enter image description here

I then uploaded it to GitHub in my SSH Keys, and "Authorized" its SSO feature. Everything is uploaded now.

enter image description here

When cloning a repository in Eclipse, I get the following message enter image description here

ANSWER

Answered 2022-Mar-18 at 13:27

I had to generate an ECDSA key, not an RSA key. Not sure why, but none of the RSA options worked for me, including the default.

1ssh-keygen -t ecdsa -b 256 -m PEM
2

I got this from https://stackoverflow.com/a/71502531/1005607

Then I uploaded it to GitHub (after deleting my old key first), updated my Eclipse SSH2 private key to point to id_ecdsa. Now I can clone repositories.

Source https://stackoverflow.com/questions/71500791

QUESTION

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent, On AlarmPingSender

Asked 2022-Feb-20 at 16:06
Problem

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. I got it after updating target SDK to 31. the error always come after AlarmPingSender. But i dont know any class that used AlarmPingSender.

1
22021-10-31 10:43:04.990 17031-17341/com.app.mobile D/AlarmPingSender: Register alarmreceiver to MqttServiceMqttService.pingSender.com.app.mobile-2e24ccbde048f2e91635651784
32021-10-31 10:43:04.993 17031-17341/com.app.mobile E/AndroidRuntime: FATAL EXCEPTION: MQTT Rec: com.app.mobile-2e24ccbde048f2e91635651784
4    Process: com.app.mobile, PID: 17031
5    java.lang.IllegalArgumentException: com.app.mobile: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
6    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
7        at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
8        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
9        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
10        at org.eclipse.paho.android.service.AlarmPingSender.start(AlarmPingSender.java:76)
11        at org.eclipse.paho.client.mqttv3.internal.ClientState.connected(ClientState.java:1150)
12        at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:987)
13        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:118)
14        at java.lang.Thread.run(Thread.java:920)
15
16
What I Already done
  • Upgrade WorkManager to 2.7.0
  • set AllProject to force use WorkManager to 2.7.0
  • change all existing PendingIntent to use FLAG_IMMUTABLE
  • there's old code that still use gcm and disable it
  • Updating all Firebase package (some said its because of later version of analytics)
Library Used
  • OneSignal
  • Qiscus
  • Firebase
  • WorkManager

ANSWER

Answered 2021-Oct-31 at 07:02

Possible solution

Upgrade google analytics to firebase analaytics. Hope it'll solve your problems.Also upgrade all the library what're you using.

For me below solutions solve the problem.

Add PendingIntent.FLAG_IMMUTABLE to your pending intents.

Here is an example -

PendingIntent pendingIntent = PendingIntent.getActivity(this, alarmID, notificationIntent, PendingIntent.FLAG_IMMUTABLE);

For further information follow this link - https://developer.android.com/reference/android/app/PendingIntent#FLAG_IMMUTABLE

Source https://stackoverflow.com/questions/69783824

QUESTION

Kubernetes use the same volumeMount in initContainer and Container

Asked 2022-Jan-21 at 15:23

I am trying to get a volume mounted as a non-root user in one of my containers. I'm trying an approach from this SO post using an initContainer to set the correct user, but when I try to start the configuration I get an "unbound immediate PersistentVolumneClaims" error. I suspect it's because the volume is mounted in both my initContainer and container, but I'm not sure why that would be the issue: I can see the initContainer taking the claim, but I would have thought when it exited that it would release it, letting the normal container take the claim. Any ideas or alternatives to getting the directory mounted as a non-root user? I did try using securityContext/fsGroup, but that seemed to have no effect. The /var/rdf4j directory below is the one that is being mounted as root.

Configuration:

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81

kubectl get pvc

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81NAME                       STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS    AGE
82triplestore-data-storage   Bound    triplestore-data-storage-dir   10Gi       RWX            local-storage   13s
83

kubectl get pv

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81NAME                       STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS    AGE
82triplestore-data-storage   Bound    triplestore-data-storage-dir   10Gi       RWX            local-storage   13s
83NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                              STORAGECLASS    REASON   AGE
84triplestore-data-storage-dir   10Gi       RWX            Delete           Bound    default/triplestore-data-storage   local-storage            17s
85

kubectl get events

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81NAME                       STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS    AGE
82triplestore-data-storage   Bound    triplestore-data-storage-dir   10Gi       RWX            local-storage   13s
83NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                              STORAGECLASS    REASON   AGE
84triplestore-data-storage-dir   10Gi       RWX            Delete           Bound    default/triplestore-data-storage   local-storage            17s
85LAST SEEN   TYPE      REASON              OBJECT                             MESSAGE
8621s         Warning   FailedScheduling    pod/triplestore-6d6876f49-2s84c    0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
8719s         Normal    Scheduled           pod/triplestore-6d6876f49-2s84c    Successfully assigned default/triplestore-6d6876f49-2s84c to docker-desktop
883s          Normal    Pulled              pod/triplestore-6d6876f49-2s84c    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
893s          Normal    Created             pod/triplestore-6d6876f49-2s84c    Created container take-data-dir-ownership
903s          Normal    Started             pod/triplestore-6d6876f49-2s84c    Started container take-data-dir-ownership
912s          Warning   BackOff             pod/triplestore-6d6876f49-2s84c    Back-off restarting failed container
9246m         Normal    Pulled              pod/triplestore-6d6876f49-9n5kt    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
9379s         Warning   BackOff             pod/triplestore-6d6876f49-9n5kt    Back-off restarting failed container
9421s         Normal    SuccessfulCreate    replicaset/triplestore-6d6876f49   Created pod: triplestore-6d6876f49-2s84c
9521s         Normal    ScalingReplicaSet   deployment/triplestore             Scaled up replica set triplestore-6d6876f49 to 1
96

kubectl describe pods/triplestore-6d6876f49-tw8r8

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81NAME                       STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS    AGE
82triplestore-data-storage   Bound    triplestore-data-storage-dir   10Gi       RWX            local-storage   13s
83NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                              STORAGECLASS    REASON   AGE
84triplestore-data-storage-dir   10Gi       RWX            Delete           Bound    default/triplestore-data-storage   local-storage            17s
85LAST SEEN   TYPE      REASON              OBJECT                             MESSAGE
8621s         Warning   FailedScheduling    pod/triplestore-6d6876f49-2s84c    0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
8719s         Normal    Scheduled           pod/triplestore-6d6876f49-2s84c    Successfully assigned default/triplestore-6d6876f49-2s84c to docker-desktop
883s          Normal    Pulled              pod/triplestore-6d6876f49-2s84c    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
893s          Normal    Created             pod/triplestore-6d6876f49-2s84c    Created container take-data-dir-ownership
903s          Normal    Started             pod/triplestore-6d6876f49-2s84c    Started container take-data-dir-ownership
912s          Warning   BackOff             pod/triplestore-6d6876f49-2s84c    Back-off restarting failed container
9246m         Normal    Pulled              pod/triplestore-6d6876f49-9n5kt    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
9379s         Warning   BackOff             pod/triplestore-6d6876f49-9n5kt    Back-off restarting failed container
9421s         Normal    SuccessfulCreate    replicaset/triplestore-6d6876f49   Created pod: triplestore-6d6876f49-2s84c
9521s         Normal    ScalingReplicaSet   deployment/triplestore             Scaled up replica set triplestore-6d6876f49 to 1
96Name:         triplestore-6d6876f49-tw8r8
97Namespace:    default
98Priority:     0
99Node:         docker-desktop/192.168.65.4
100Start Time:   Mon, 17 Jan 2022 10:17:20 -0500
101Labels:       app=demo
102              pod-template-hash=6d6876f49
103              role=triplestore
104Annotations:  &lt;none&gt;
105Status:       Pending
106IP:           10.1.2.133
107IPs:
108  IP:           10.1.2.133
109Controlled By:  ReplicaSet/triplestore-6d6876f49
110Init Containers:
111  take-data-dir-ownership:
112    Container ID:  docker://89e7b1e3ae76c30180ee5083624e1bf5f30b55fd95bf1c24422fabe41ae74408
113    Image:         eclipse/rdf4j-workbench:amd64-3.5.0
114    Image ID:      docker-pullable://registry.com/publicrepos/docker_cache/eclipse/rdf4j-workbench@sha256:14621ad610b0d0269dedd9939ea535348cc6c147f9bd47ba2039488b456118ed
115    Port:          &lt;none&gt;
116    Host Port:     &lt;none&gt;
117    Command:
118      chown
119      -R
120      100:65533
121      /var/rdf4j
122    State:          Waiting
123      Reason:       CrashLoopBackOff
124    Last State:     Terminated
125      Reason:       Error
126      Exit Code:    1
127      Started:      Mon, 17 Jan 2022 10:22:59 -0500
128      Finished:     Mon, 17 Jan 2022 10:22:59 -0500
129    Ready:          False
130    Restart Count:  6
131    Environment:    &lt;none&gt;
132    Mounts:
133      /var/rdf4j from storage (rw)
134      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-s8wdv (ro)
135Containers:
136  triplestore:
137    Container ID:
138    Image:          eclipse/rdf4j-workbench:amd64-3.5.0
139    Image ID:
140    Port:           8080/TCP
141    Host Port:      0/TCP
142    State:          Waiting
143      Reason:       PodInitializing
144    Ready:          False
145    Restart Count:  0
146    Requests:
147      cpu:        100m
148      memory:     200Mi
149    Environment:  &lt;none&gt;
150    Mounts:
151      /var/rdf4j from storage (rw)
152      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-s8wdv (ro)
153Conditions:
154  Type              Status
155  Initialized       False
156  Ready             False
157  ContainersReady   False
158  PodScheduled      True
159Volumes:
160  storage:
161    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
162    ClaimName:  triplestore-data-storage
163    ReadOnly:   false
164  kube-api-access-s8wdv:
165    Type:                    Projected (a volume that contains injected data from multiple sources)
166    TokenExpirationSeconds:  3607
167    ConfigMapName:           kube-root-ca.crt
168    ConfigMapOptional:       &lt;nil&gt;
169    DownwardAPI:             true
170QoS Class:                   Burstable
171Node-Selectors:              &lt;none&gt;
172Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
173                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
174Events:
175  Type     Reason            Age                    From               Message
176  ----     ------            ----                   ----               -------
177  Warning  FailedScheduling  6m24s                  default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
178  Normal   Scheduled         6m13s                  default-scheduler  Successfully assigned default/triplestore-6d6876f49-tw8r8 to docker-desktop
179  Normal   Pulled            4m42s (x5 over 6m12s)  kubelet            Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
180  Normal   Created           4m42s (x5 over 6m12s)  kubelet            Created container take-data-dir-ownership
181  Normal   Started           4m42s (x5 over 6m12s)  kubelet            Started container take-data-dir-ownership
182  Warning  BackOff           70s (x26 over 6m10s)   kubelet            Back-off restarting failed container
183
Solution

As it turns out the problem was that the initContainer wasn't running as root, it was running as the default user of the container, and so didn't have the permissions to run the chown command. In the linked SO comment, this was the first comment to the answer, with the response being that the initContainer ran as root - this has apparently changed in newer versions of kubernetes. There is a solution though, you can set the securityContext on the container to run as root, giving it permission to run the chown command, and that successfully allows the volume to be mounted as a non-root user. Here's the final configuration of the initContainer.

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81NAME                       STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS    AGE
82triplestore-data-storage   Bound    triplestore-data-storage-dir   10Gi       RWX            local-storage   13s
83NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                              STORAGECLASS    REASON   AGE
84triplestore-data-storage-dir   10Gi       RWX            Delete           Bound    default/triplestore-data-storage   local-storage            17s
85LAST SEEN   TYPE      REASON              OBJECT                             MESSAGE
8621s         Warning   FailedScheduling    pod/triplestore-6d6876f49-2s84c    0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
8719s         Normal    Scheduled           pod/triplestore-6d6876f49-2s84c    Successfully assigned default/triplestore-6d6876f49-2s84c to docker-desktop
883s          Normal    Pulled              pod/triplestore-6d6876f49-2s84c    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
893s          Normal    Created             pod/triplestore-6d6876f49-2s84c    Created container take-data-dir-ownership
903s          Normal    Started             pod/triplestore-6d6876f49-2s84c    Started container take-data-dir-ownership
912s          Warning   BackOff             pod/triplestore-6d6876f49-2s84c    Back-off restarting failed container
9246m         Normal    Pulled              pod/triplestore-6d6876f49-9n5kt    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
9379s         Warning   BackOff             pod/triplestore-6d6876f49-9n5kt    Back-off restarting failed container
9421s         Normal    SuccessfulCreate    replicaset/triplestore-6d6876f49   Created pod: triplestore-6d6876f49-2s84c
9521s         Normal    ScalingReplicaSet   deployment/triplestore             Scaled up replica set triplestore-6d6876f49 to 1
96Name:         triplestore-6d6876f49-tw8r8
97Namespace:    default
98Priority:     0
99Node:         docker-desktop/192.168.65.4
100Start Time:   Mon, 17 Jan 2022 10:17:20 -0500
101Labels:       app=demo
102              pod-template-hash=6d6876f49
103              role=triplestore
104Annotations:  &lt;none&gt;
105Status:       Pending
106IP:           10.1.2.133
107IPs:
108  IP:           10.1.2.133
109Controlled By:  ReplicaSet/triplestore-6d6876f49
110Init Containers:
111  take-data-dir-ownership:
112    Container ID:  docker://89e7b1e3ae76c30180ee5083624e1bf5f30b55fd95bf1c24422fabe41ae74408
113    Image:         eclipse/rdf4j-workbench:amd64-3.5.0
114    Image ID:      docker-pullable://registry.com/publicrepos/docker_cache/eclipse/rdf4j-workbench@sha256:14621ad610b0d0269dedd9939ea535348cc6c147f9bd47ba2039488b456118ed
115    Port:          &lt;none&gt;
116    Host Port:     &lt;none&gt;
117    Command:
118      chown
119      -R
120      100:65533
121      /var/rdf4j
122    State:          Waiting
123      Reason:       CrashLoopBackOff
124    Last State:     Terminated
125      Reason:       Error
126      Exit Code:    1
127      Started:      Mon, 17 Jan 2022 10:22:59 -0500
128      Finished:     Mon, 17 Jan 2022 10:22:59 -0500
129    Ready:          False
130    Restart Count:  6
131    Environment:    &lt;none&gt;
132    Mounts:
133      /var/rdf4j from storage (rw)
134      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-s8wdv (ro)
135Containers:
136  triplestore:
137    Container ID:
138    Image:          eclipse/rdf4j-workbench:amd64-3.5.0
139    Image ID:
140    Port:           8080/TCP
141    Host Port:      0/TCP
142    State:          Waiting
143      Reason:       PodInitializing
144    Ready:          False
145    Restart Count:  0
146    Requests:
147      cpu:        100m
148      memory:     200Mi
149    Environment:  &lt;none&gt;
150    Mounts:
151      /var/rdf4j from storage (rw)
152      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-s8wdv (ro)
153Conditions:
154  Type              Status
155  Initialized       False
156  Ready             False
157  ContainersReady   False
158  PodScheduled      True
159Volumes:
160  storage:
161    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
162    ClaimName:  triplestore-data-storage
163    ReadOnly:   false
164  kube-api-access-s8wdv:
165    Type:                    Projected (a volume that contains injected data from multiple sources)
166    TokenExpirationSeconds:  3607
167    ConfigMapName:           kube-root-ca.crt
168    ConfigMapOptional:       &lt;nil&gt;
169    DownwardAPI:             true
170QoS Class:                   Burstable
171Node-Selectors:              &lt;none&gt;
172Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
173                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
174Events:
175  Type     Reason            Age                    From               Message
176  ----     ------            ----                   ----               -------
177  Warning  FailedScheduling  6m24s                  default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
178  Normal   Scheduled         6m13s                  default-scheduler  Successfully assigned default/triplestore-6d6876f49-tw8r8 to docker-desktop
179  Normal   Pulled            4m42s (x5 over 6m12s)  kubelet            Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
180  Normal   Created           4m42s (x5 over 6m12s)  kubelet            Created container take-data-dir-ownership
181  Normal   Started           4m42s (x5 over 6m12s)  kubelet            Started container take-data-dir-ownership
182  Warning  BackOff           70s (x26 over 6m10s)   kubelet            Back-off restarting failed container
183initContainers:
184  - name: take-data-dir-ownership
185    image: eclipse/rdf4j-workbench:amd64-3.5.0
186    securityContext:
187      runAsUser: 0
188    command:
189      - chown
190      - -R
191      - 100:65533
192      - /var/rdf4j
193    volumeMounts:
194      - name: storage
195        mountPath: /var/rdf4j
196

ANSWER

Answered 2022-Jan-21 at 08:43

1 pod has unbound immediate PersistentVolumeClaims. - this error means the pod cannot bound to the PVC on the node where it has been scheduled to run on. This can happen when the PVC bounded to a PV that refers to a location that is not valid on the node that the pod is scheduled to run on. It will be helpful if you can post the complete output of kubectl get nodes -o wide, kubectl describe pvc triplestore-data-storage, kubectl describe pv triplestore-data-storage-dir to the question.

The mean time, PVC/PV is optional when using hostPath, can you try the following spec and see if the pod can come online:

1apiVersion: v1
2kind: PersistentVolume
3metadata:
4  name: triplestore-data-storage-dir
5  labels:
6    type: local
7spec:
8  capacity:
9    storage: 10Gi
10  accessModes:
11    - ReadWriteMany
12  storageClassName: local-storage
13  volumeMode: Filesystem
14  persistentVolumeReclaimPolicy: Delete
15  hostPath:
16    path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
17    type: DirectoryOrCreate
18---
19kind: PersistentVolumeClaim
20apiVersion: v1
21metadata:
22  name: triplestore-data-storage
23spec:
24  accessModes:
25    - ReadWriteMany
26  resources:
27    requests:
28      storage: 1Gi
29  storageClassName: local-storage
30  volumeName: &quot;triplestore-data-storage-dir&quot;
31---
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35  name: triplestore
36  labels:
37    app: demo
38    role: triplestore
39spec:
40  selector:
41    matchLabels:
42      app: demo
43      role: triplestore
44  replicas: 1
45  template:
46    metadata:
47      labels:
48        app: demo
49        role: triplestore
50    spec:
51      containers:
52        - name: triplestore
53          image: eclipse/rdf4j-workbench:amd64-3.5.0
54          imagePullPolicy: Always
55          ports:
56            - name: http
57              protocol: TCP
58              containerPort: 8080
59          resources:
60            requests:
61              cpu: 100m
62              memory: 200Mi
63          volumeMounts:
64            - name: storage
65              mountPath: /var/rdf4j
66      initContainers:
67        - name: take-data-dir-ownership
68          image: eclipse/rdf4j-workbench:amd64-3.5.0
69          command:
70            - chown
71            - -R
72            - 100:65533
73            - /var/rdf4j
74          volumeMounts:
75            - name: storage
76              mountPath: /var/rdf4j
77      volumes:
78        - name: storage
79          persistentVolumeClaim:
80            claimName: &quot;triplestore-data-storage&quot;
81NAME                       STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS    AGE
82triplestore-data-storage   Bound    triplestore-data-storage-dir   10Gi       RWX            local-storage   13s
83NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                              STORAGECLASS    REASON   AGE
84triplestore-data-storage-dir   10Gi       RWX            Delete           Bound    default/triplestore-data-storage   local-storage            17s
85LAST SEEN   TYPE      REASON              OBJECT                             MESSAGE
8621s         Warning   FailedScheduling    pod/triplestore-6d6876f49-2s84c    0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
8719s         Normal    Scheduled           pod/triplestore-6d6876f49-2s84c    Successfully assigned default/triplestore-6d6876f49-2s84c to docker-desktop
883s          Normal    Pulled              pod/triplestore-6d6876f49-2s84c    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
893s          Normal    Created             pod/triplestore-6d6876f49-2s84c    Created container take-data-dir-ownership
903s          Normal    Started             pod/triplestore-6d6876f49-2s84c    Started container take-data-dir-ownership
912s          Warning   BackOff             pod/triplestore-6d6876f49-2s84c    Back-off restarting failed container
9246m         Normal    Pulled              pod/triplestore-6d6876f49-9n5kt    Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
9379s         Warning   BackOff             pod/triplestore-6d6876f49-9n5kt    Back-off restarting failed container
9421s         Normal    SuccessfulCreate    replicaset/triplestore-6d6876f49   Created pod: triplestore-6d6876f49-2s84c
9521s         Normal    ScalingReplicaSet   deployment/triplestore             Scaled up replica set triplestore-6d6876f49 to 1
96Name:         triplestore-6d6876f49-tw8r8
97Namespace:    default
98Priority:     0
99Node:         docker-desktop/192.168.65.4
100Start Time:   Mon, 17 Jan 2022 10:17:20 -0500
101Labels:       app=demo
102              pod-template-hash=6d6876f49
103              role=triplestore
104Annotations:  &lt;none&gt;
105Status:       Pending
106IP:           10.1.2.133
107IPs:
108  IP:           10.1.2.133
109Controlled By:  ReplicaSet/triplestore-6d6876f49
110Init Containers:
111  take-data-dir-ownership:
112    Container ID:  docker://89e7b1e3ae76c30180ee5083624e1bf5f30b55fd95bf1c24422fabe41ae74408
113    Image:         eclipse/rdf4j-workbench:amd64-3.5.0
114    Image ID:      docker-pullable://registry.com/publicrepos/docker_cache/eclipse/rdf4j-workbench@sha256:14621ad610b0d0269dedd9939ea535348cc6c147f9bd47ba2039488b456118ed
115    Port:          &lt;none&gt;
116    Host Port:     &lt;none&gt;
117    Command:
118      chown
119      -R
120      100:65533
121      /var/rdf4j
122    State:          Waiting
123      Reason:       CrashLoopBackOff
124    Last State:     Terminated
125      Reason:       Error
126      Exit Code:    1
127      Started:      Mon, 17 Jan 2022 10:22:59 -0500
128      Finished:     Mon, 17 Jan 2022 10:22:59 -0500
129    Ready:          False
130    Restart Count:  6
131    Environment:    &lt;none&gt;
132    Mounts:
133      /var/rdf4j from storage (rw)
134      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-s8wdv (ro)
135Containers:
136  triplestore:
137    Container ID:
138    Image:          eclipse/rdf4j-workbench:amd64-3.5.0
139    Image ID:
140    Port:           8080/TCP
141    Host Port:      0/TCP
142    State:          Waiting
143      Reason:       PodInitializing
144    Ready:          False
145    Restart Count:  0
146    Requests:
147      cpu:        100m
148      memory:     200Mi
149    Environment:  &lt;none&gt;
150    Mounts:
151      /var/rdf4j from storage (rw)
152      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-s8wdv (ro)
153Conditions:
154  Type              Status
155  Initialized       False
156  Ready             False
157  ContainersReady   False
158  PodScheduled      True
159Volumes:
160  storage:
161    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
162    ClaimName:  triplestore-data-storage
163    ReadOnly:   false
164  kube-api-access-s8wdv:
165    Type:                    Projected (a volume that contains injected data from multiple sources)
166    TokenExpirationSeconds:  3607
167    ConfigMapName:           kube-root-ca.crt
168    ConfigMapOptional:       &lt;nil&gt;
169    DownwardAPI:             true
170QoS Class:                   Burstable
171Node-Selectors:              &lt;none&gt;
172Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
173                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
174Events:
175  Type     Reason            Age                    From               Message
176  ----     ------            ----                   ----               -------
177  Warning  FailedScheduling  6m24s                  default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
178  Normal   Scheduled         6m13s                  default-scheduler  Successfully assigned default/triplestore-6d6876f49-tw8r8 to docker-desktop
179  Normal   Pulled            4m42s (x5 over 6m12s)  kubelet            Container image &quot;eclipse/rdf4j-workbench:amd64-3.5.0&quot; already present on machine
180  Normal   Created           4m42s (x5 over 6m12s)  kubelet            Created container take-data-dir-ownership
181  Normal   Started           4m42s (x5 over 6m12s)  kubelet            Started container take-data-dir-ownership
182  Warning  BackOff           70s (x26 over 6m10s)   kubelet            Back-off restarting failed container
183initContainers:
184  - name: take-data-dir-ownership
185    image: eclipse/rdf4j-workbench:amd64-3.5.0
186    securityContext:
187      runAsUser: 0
188    command:
189      - chown
190      - -R
191      - 100:65533
192      - /var/rdf4j
193    volumeMounts:
194      - name: storage
195        mountPath: /var/rdf4j
196apiVersion: apps/v1
197kind: Deployment
198metadata:
199  name: triplestore
200  labels:
201    app: demo
202    role: triplestore
203spec:
204  selector:
205    matchLabels:
206      app: demo
207      role: triplestore
208  replicas: 1
209  template:
210    metadata:
211      labels:
212        app: demo
213        role: triplestore
214    spec:
215      containers:
216      - name: triplestore
217        image: eclipse/rdf4j-workbench:amd64-3.5.0
218        imagePullPolicy: IfNotPresent
219        ports:
220        - name: http
221          protocol: TCP
222          containerPort: 8080
223        resources:
224          requests:
225            cpu: 100m
226            memory: 200Mi
227        volumeMounts:
228        - name: storage
229          mountPath: /var/rdf4j
230      initContainers:
231      - name: take-data-dir-ownership
232        image: eclipse/rdf4j-workbench:amd64-3.5.0
233        imagePullPolicy: IfNotPresent
234        securityContext:
235          runAsUser: 0
236        command:
237          - chown
238          - -R
239          - 100:65533
240          - /var/rdf4j
241        volumeMounts:
242          - name: storage
243            mountPath: /var/rdf4j
244      volumes:
245        - name: storage
246          hostPath:
247            path: /run/desktop/mnt/host/d/workdir/k8s-data/triplestore
248            type: DirectoryOrCreate
249

Source https://stackoverflow.com/questions/70717175

QUESTION

How can I specify location of AndroidManifest.xml?

Asked 2021-Dec-30 at 05:36

I'm porting a module from Eclipse to Android Studio/Gradle, and need to specify the locations of my sources, resources, and manifest:

1sourceSets {
2    main {
3        manifest {
4            srcFile './AndroidManifest.xml'
5        }
6        java {
7            srcDirs = [&quot;src&quot;]
8        }
9        resources {
10            srcDirs = [&quot;resource&quot;]
11        }
12    }
13}       
14

Android Studio/Gradle seems perfectly happy with my java and resources entries, but balks at my manifest entry:

1sourceSets {
2    main {
3        manifest {
4            srcFile './AndroidManifest.xml'
5        }
6        java {
7            srcDirs = [&quot;src&quot;]
8        }
9        resources {
10            srcDirs = [&quot;resource&quot;]
11        }
12    }
13}       
14No signature of method: build_b4wnchd9ct4a5qt388vbbtbpz.sourceSets() is applicable for argument types: (build_b4wnchd9ct4a5qt388vbbtbpz$_run_closure2) values: [build_b4wnchd9ct4a5qt388vbbtbpz$_run_closure2@35290d54]
15

All of my googling and searching SO suggests that this should have worked.

Arctic Fox, 2020.3.1. Not sure which version of Gradle came with it.

ANSWER

Answered 2021-Dec-30 at 05:36

Ahh, figured it out. Leaving here in case someone else has the same question.

Add an android.sourceSets.manifest.srcFile entry to your module's build.gradle file:

1sourceSets {
2    main {
3        manifest {
4            srcFile './AndroidManifest.xml'
5        }
6        java {
7            srcDirs = [&quot;src&quot;]
8        }
9        resources {
10            srcDirs = [&quot;resource&quot;]
11        }
12    }
13}       
14No signature of method: build_b4wnchd9ct4a5qt388vbbtbpz.sourceSets() is applicable for argument types: (build_b4wnchd9ct4a5qt388vbbtbpz$_run_closure2) values: [build_b4wnchd9ct4a5qt388vbbtbpz$_run_closure2@35290d54]
15android {
16    ...
17    sourceSets {
18        main {
19            manifest {
20                srcFile './AndroidManifest.xml'
21            }
22        }
23    }
24}
25

or simply:

1sourceSets {
2    main {
3        manifest {
4            srcFile './AndroidManifest.xml'
5        }
6        java {
7            srcDirs = [&quot;src&quot;]
8        }
9        resources {
10            srcDirs = [&quot;resource&quot;]
11        }
12    }
13}       
14No signature of method: build_b4wnchd9ct4a5qt388vbbtbpz.sourceSets() is applicable for argument types: (build_b4wnchd9ct4a5qt388vbbtbpz$_run_closure2) values: [build_b4wnchd9ct4a5qt388vbbtbpz$_run_closure2@35290d54]
15android {
16    ...
17    sourceSets {
18        main {
19            manifest {
20                srcFile './AndroidManifest.xml'
21            }
22        }
23    }
24}
25android {
26    ...
27    sourceSets.main.manifest.srcFile './AndroidManifest.xml'
28}
29

My biggest mistake was not putting the sourceSets directive inside the android directive.

Source https://stackoverflow.com/questions/70501858

QUESTION

Disabling &quot;Download sources and javadoc&quot; in eclipse

Asked 2021-Dec-22 at 16:57

I'm using Eclipse 20210312-0638

I have unchecked "Download artifact sources" and "Download artifact javadoc" from preferences (First picture). It's still downloading them (2nd picture). Is there any other configuration that I should change?

enter image description here

enter image description here

ANSWER

Answered 2021-Sep-21 at 10:05

I've managed to stop this by clicking on the red square button near the end of the line with "Download sources and javadoc" progression bar in "Progress" tab. This red button appears for a fraction of a second, so you have to be quick with clicking it.

Source https://stackoverflow.com/questions/68729615

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Eclipse

Tutorials and Learning Resources are not available at this moment for Eclipse

Share this Page

share link

Get latest updates on Eclipse