Closed anothergoodguy closed 1 year ago
JHipster has completed the sample check
.yo-rc.json
: valid
Entities JDL: valid
Application: successfully generated
Frontend check: success
Backend check: success
E2E check: success
@anothergoodguy I think you must use prod
profile: ./gradlew clean -Pprod bootJar
@qmonmert we have dev
, stage
and prod
environments. I usually duplicate dev for stage and make the needed env changes. thanks for the quick resolution. will try to test later tonight and will share you the observations, if any.
here are some observations:
./gradlew clean -Pprod bootJar
java -jar build/libs/sample-rest-0.0.1-SNAPSHOT.jar
Spring Boot 3.1.2
instead of 3.1.3, even though the gradle properties has the correct entry# Dependency versions
jhipsterDependenciesVersion=8.0.0-SNAPSHOT
# The spring-boot version should match the one managed by
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/8.0.0-SNAPSHOT
springBootVersion=3.1.3
# The hibernate version should match the one managed by
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/3.1.3 -->
hibernateVersion=6.2.7.Final
mapstructVersion=1.5.5.Final
archunitJunit5Version=1.1.0
and the result:
java -jar build/libs/sample-rest-0.0.1-SNAPSHOT.jar
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster 🤓 :: Running Spring Boot 3.1.2 :: Startup profile(s) prod ::
:: https://www.jhipster.tech ::
@anothergoodguy Did you build locally jhipster bom and generator projects?
no @DanielFran I dont have the bom project locally, I have generator locally and am using the generator by building the docker image locally.
@anothergoodguy Can you confirm this is still happening? @qmonmert confirmed that with current main branch this does not happen now...
@DanielFran I confirm, but this is strange
hey @DanielFran,
I have the commit 15970f6164
. and this is still happening with gradle, but I tried out of curiosity with maven as well, interestingly it's working fine with maven. See the results below:
Gradle outout:
java -jar build/libs/store-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
at com.sample.platform.StoreApp.main(StoreApp.java:68)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:149)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 9 more
Maven output:
java -jar target/store-0.0.1-SNAPSHOT.jar
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster 🤓 :: Running Spring Boot 3.1.3 :: Startup profile(s) dev ::
:: https://www.jhipster.tech ::
opps looks like I overlooked that the app didn't start in maven either but looks like a different issue, sharing it here thinking these might be classpath corrections:
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-09-01T22:27:50.714+05:30 ERROR 11977 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
co.elastic.clients.transport.endpoints.SimpleEndpoint.pathEncode(SimpleEndpoint.java:99)
The following method did not exist:
'java.lang.String org.apache.http.client.utils.URLEncodedUtils.formatSegments(java.lang.String[])'
The calling method's class, co.elastic.clients.transport.endpoints.SimpleEndpoint, was loaded from the following location:
jar:file:/Users/thatguy/jhipster/biskate/store-trial/target/store-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/elasticsearch-java-8.7.1.jar!/co/elastic/clients/transport/endpoints/SimpleEndpoint.class
The called method's class, org.apache.http.client.utils.URLEncodedUtils, is available from the following locations:
jar:file:/Users/thatguy/jhipster/biskate/store-trial/target/store-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/httpclient-4.5.3.jar!/org/apache/http/client/utils/URLEncodedUtils.class
The called method's class hierarchy was loaded from the following locations:
org.apache.http.client.utils.URLEncodedUtils: jar:file:/Users/thatguy/jhipster/biskate/store-trial/target/store-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/httpclient-4.5.3.jar!/
Action:
Correct the classpath of your application so that it contains compatible versions of the classes co.elastic.clients.transport.endpoints.SimpleEndpoint and org.apache.http.client.utils.URLEncodedUtils
Both errors are related to version conflicts. Which may be fixed (or caused) by transitive dependencies. jhipster main is a moving target, so is jhipster-bom main. It’s not possible to use a jhipster git commit without the matching jhipster-bom commit.
If it’s not reproducible in main using a current jhipster-bom snapshot we should close the issue.
I tested it on a setup with both bom
and geneator
latest commits and this issue is no longer present with gradle
; but I see the above mentioned classpath issue in maven still. you may take a call to close the ticket as per the program guidelines.
However there is some other classpath/aceess-restrictions issue I see on both main branch and 8.0.0-beta.2
; and I will file a separate issue ticket for it.
@anothergoodguy the original issue is not reproducible anymore. If you the elasticseach bug persists please open a new issue.
Overview of the issue
Hi I have used the attached .yo.rc.json to generate a sample app to validate 3.1.3 introduction. after building the application with
./gradlew clean -Pdev bootJar
the application wont start withjava -jar build/libs/sample-rest-0.0.1-SNAPSHOT.jar
Here is the error I get:sample-rest@0.0.1-SNAPSHOT /home/jhipster/app/biskate/tm-trial └── generator-jhipster@8.0.0-beta.2