Error occurred during initialization of boot layer java.lang.module.FindException: Module jdk.management.agent not found - spring

I am setting up my first Spring Boot application using Eclipse > New > Spring-Starter project
The project files are appearing and compiling.
I am even able to RunAs > Java project with console output.
On choosing RunAs > Spring Boot, I am getting the above error in the console:
Error occurred during initialization of boot layer java.lang.module.FindException: Module jdk.management.agent not found
My Java version is Java15, and I have also verified the same path is being used by Eclipse in About Eclispse > Installation Details > Configuration which shows
-vm C:\Program Files\Java\jdk-15.0.1\bin\server\jvm.dll
Running java --list-modules shows the management.agent module in the list shown in the command line output:
jdk.localedata#15.0.1
jdk.management#15.0.1
jdk.management.agent#15.0.1
jdk.management.jfr#15.0.1
Maven version installed is 3.3.6
I am not sure what I am missing. Any ideas?

Related

Jhipster project - error with ConfigurationMetadataAnnotationProcessor class in spring-boot app

I just start a new Jhipster project on my computer.
I have install the Open JDK 11.0.6, the last version on node and npm (node 16.15.0).
I have created the project with jhipster to test it but I have some issues to launch the backend part with spring-boot in Intellij.
When I open my project in IntelliJ and launch the Spring boot app, I got this error:
java: Supported source version 'RELEASE_6' from annotation processor 'org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor' less than -source '11'
This error comes during the compilation of the application
I put below some screen of my configuration
My java version in cmd
My java in PATH variable
Java set in project INTELLIJ as SDK
Java for the module
And to finish, before all this, a java 1.6 was install on the computer but I have cut all the way to call it (PATH & JAVA_HOME). I can't delete it totally because I'm not an administrator of my computer.
Thanks for the idea in advance,
Have a good day,

Spring boot runtime error details

I'm a beginner to spring and spring boot.I'm using command line runner to execute my application.I was facing issue that my application services stops immediately without any error when I run the application. After reviewing all files i came to know that one of autowired variable was not having #component notation in its class.After fixing it started working fine.
My question here is, is there a run time debugger in spring boot to trace these types of errors ?
inside src/main/resources/application.properties or src/main/resources/application.yml add
debug: true
run with debug using spring-boot property
java -jar /path/to/file.jar --debug
run with debug using jvm args
java -Ddebug -jar /path/to/file.jar
also you can ise IDE such Itellij IDEA (in Run Configurations) for your main class
ps: I believe, other IDEs, such as eclipse / STS or NetBeans also should have similar property
set env variable DEBUG=true and run app
5.1. unix bash: DEBUG=true java -jar /path/to/file.jar
5.2. windows cmd:
set DEBUG=true
java -jar path\to\file.jar

Springboot Strange Resource Loading Behavior

I'm working on a springboot 1.5.1 application that I'm trying to load a WSDL included in my resources directory in the wsdl directory. Depending on where my application executes I'm getting different results (command line, intellij, cloud foundry) and I can't seem to get all three to work at the same time.
I've tried several ways of locating the resource:
From prior to the migration to springboot we had this (worked in IntelliJ but not java -jar myboot.jar):
this.getClass().getResource("/wsdl/my.wsdl");
I switched it to the typically more correct version and got it to work in IntelliJ and java -jar but not Cloud Foundry:
this.getClass().getClassLoader().getResource("/wsdl/my.wsdl");
I switched it to use the Spring Resource Loader version and it worked in IntelliJ and CloudFoundry but not java -jar:
#Value("classpath:/wsdl/my.wsdl")
private Resource wsdlResource;
wsdlResource.getURL();
On the command line what I've noticed is that it seems to be thinking that BOOT-INF/classes is a JAR file (Note the ! after classes):
Caused by: javax.xml.ws.WebServiceException: Failed to access the WSDL at: jar:file:/C:/dev/redacted/build/libs/redacted.jar!/BOOT-INF/classes!/wsdl/my.wsdl. It failed with:
JAR entry BOOT-INF/classes!/wsdl/my.wsdl not found in C:\dev\redacted\build\libs\redacted.jar.
From looking at IntelliJ's URL, it's referring to the actual source folder which explains why it seems to always work.
What is causing this and how might I universally load these class path resources successfully with springboot?

Jar entry not found by running gradle generated jar

I've downloaded the source code (zip file) from the spring getting started guide: http://spring.io/guides/gs/rest-service/
Building the whole project within the folder "complete" was successful. Also running the generated jar file using Gradle (gradle run) was successful. But when I try to run it manually in the Windows command line with "java -jar build\libs\gs-rest-service-0.1.0.jar" the startup process failed with the following error:
2014-06-25 14:17:22.414 ERROR 6864 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: JAR
entry /hello/ not found in D:\gs-rest-service-master\complete\build\libs\gs-rest-service-0.1.0.jar
Apparently spring can not find the folder "hello" even though it is located within the jar (I've checked it with the command "jar -ft").
You don't say which version of Boot you're using, but it sounds like you've hit a recently reported problem in 1.1.2 that's specific to Windows. You can either drop back to 1.1.1 or wait for 1.1.3 which, given the problems with 1.1.2 on Windows, should be available in the not too distant future.

Running mule application in MuleStudio

While running mule application in MuleStudio, I see 2 options.
Run As > Mule Application
Run As > Mule Application with Maven
I always used first option which worked fine, until a point of time when I defined maven filter. Using the first option the filters were not getting resolved, so I tried to run using second option which resulted in the following error --
[12:04:57] Starting build...
Error: Could not find or load main class local
I created a test project for sharing this problem and uploaded it on github https://github.com/hshira/mule-mvn-filter
pom.xml > https://github.com/hshira/mule-mvn-filter/blob/master/pom.xml
Please suggest me, what is the right way to resolve filters in MuleStudio.
FYI ... the filtered property is resolved correctly if I build on terminal using mvn command
it could be issue with maven setup on your local machine.

Resources