1

I am trying to deploy a new jHipster application to Tomcat using version 6.1.0. A previous app using older versions worked just fine. I changed my pom.xml to generate a war instead of a jar file. If I run the war file as "java -jar app.war" it works fine, but if I deploy the war file to Tomcat my browser shows error message related to npm.

I have tried both app.war and app.war.original. I have set my baseHref in webpack.common.js to match my context name.

Here is the browser response:

An error has occurred :-( Usual error causes You started the application from an IDE and you didn't run npm start or npm run webpack:build. You had a network error while running npm install. If you are behind a corporate proxy, it is likely that this error was caused by your proxy. Have a look at the JHipster error logs, you will probably have the cause of the error. You installed a Node.js version that doesn't work with JHipster: please use an LTS (long-term support) version, as it's the only version we support. Building the client side code again If you want to go fast, run ./mvnw to build and run everything.

If you want to have more control, so you can debug your issue more easily, you should follow the following steps:

...

Rick
  • 61
  • 3
  • Do you see any errors in the browser console? – Jon Ruddell Jul 06 '19 at 00:55
  • That was stupid of me to not look there before posting. It throws an error 404 when trying to load loading.css. The jHipster app tries to load the css with a full URL and the context name is missing. When I run the war without Tomcat, there is no context name and it works fine. It is trying to load http://servername/content/css/loading.css when it should be trying http://servername/MY_APP/content/css/loading.css. How do I fix this? – Rick Jul 07 '19 at 16:06
  • What did you configure your Base HREF to in webpack.common.js? – Jon Ruddell Jul 07 '19 at 17:13
  • Originally I hadn't changed anything in webpack.common.js. new BaseHrefWebpackPlugin({ baseHref: '/' }) I also tried setting it to: new BaseHrefWebpackPlugin({ baseHref: '/MY_APP' }) and new BaseHrefWebpackPlugin({ baseHref: '/MY_APP/' }) – Rick Jul 08 '19 at 18:41
  • Have you found the solution? – 4535992 Feb 04 '20 at 14:24

0 Answers0