Closed M4jor-Tom closed 2 years ago
I've seen that jhipster tryed to access https://repo.spring.io/ui/native/libs-release/org/springframework/roo/org.springframework.roo.annotations/1.2.3.RELEASE/org.springframework.roo.annotations-1.2.3.RELEASE.pom, and received a status 401.
I see this too on apps that are working so I don't think this is the problem.
Did you start MySQL since that's what you're using for production?
docker-compose -f src/main/docker/mysql.yml up -d
I cloned your repo, started MySQL, and ran ./mvnw -Pprod
. Everything worked fine for me, so I'm closing this issue. Please reopen it if this does not solve your issue.
----------------------------------------------------------
Application 'LappLi' is running! Access URLs:
Local: http://localhost:8080/
External: http://127.0.0.1:8080/
Profile(s): [prod]
----------------------------------------------------------
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
java version "16.0.1" 2021-04-20 Java(TM) SE Runtime Environment (build 16.0.1+9-24) Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
git version 2.24.1.windows.2
node: v14.17.6
npm: 6.14.15
Docker version 20.10.10, build b485636
docker-compose version 1.29.2, build 5becea4c
Overview of the issue
Building successes, but H2 startup fails upon prompting "./mvnw -Pprod".
As I've chosen mysql as a production database, it seems normal to me that the result isn't successful, but event when looking at https://www.jhipster.tech/production/#run, I don't find any instruction for setting up connection between jhipster and external (not H2, which is built-in) databases
It shows the following Exceptions:
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at com.muller.lappli.LappLiApp.main(LappLiApp.java:69) Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:257) at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.createManager(UndertowServletWebServerFactory.java:347) at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:316) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ... 6 common frames omitted Caused by: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet at tech.jhipster.config.h2.H2ConfigurationHelper.initH2Console(H2ConfigurationHelper.java:128) at com.muller.lappli.config.WebConfigurer.initH2Console(WebConfigurer.java:112) at com.muller.lappli.config.WebConfigurer.onStartup(WebConfigurer.java:51) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:235) at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory$Initializer.onStartup(UndertowServletWebServerFactory.java:506) at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:204) at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255) ... 10 common frames omitted Caused by: java.lang.ClassNotFoundException: org.h2.server.web.WebServlet at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:466) at tech.jhipster.config.h2.H2ConfigurationHelper.initH2Console(H2ConfigurationHelper.java:119) ... 19 common frames omitted
Still, "./mvnw -Pprod clean verify" shows nor failures or errors
Motivation for or Use Case
I want to test my code within a production environnement.
Reproduce the error
Related issues
Nothing found.
Suggest a Fix
Upon trying "./mvnw -Pprod -X", I've seen that jhipster tryed to access https://repo.spring.io/ui/native/libs-release/org/springframework/roo/org.springframework.roo.annotations/1.2.3.RELEASE/org.springframework.roo.annotations-1.2.3.RELEASE.pom, and received a status 401.
Maybe this is the cause of the bug.
Browsers and Operating System
Google chrome on Windows 10