javaspringjndijhipstertomcat8

Starting JHipster generated app on a Tomcat server


I made web application using JHipster. Everything working correctly but when I move it to tomcat/webapps and deploy it I have some errors. After errors, my app runs correctly, so I wasn't focused on this earlier... But now when I'm trying to deploy it on linux server my app starts with several errors "CreateBeanException". I think that this errors appears because I ignored(in windows and linux) tomcat configuration in his files. Can anybody help me with it ? I'm using mysql on production.

Here is the log from tomcat.exe https://pastebin.com/LA12tiL9

Here is my context.xml from tomcat/conf

    <?xml version="1.0" encoding="UTF-8"?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
</Context>

What I should paste yet? I have default configs after install it on windows and linux. I hope somebody can help me. Thanks


Solution

  • Do you have any special need that want to deploy it on a tomcat? Because

    JHipster is a fully Open Source, widely used application generator. Easily create high-quality Spring Boot + Angular projects!

    And Spring Boot gives you an Embedded Web Server that you can use out of the box.

    So you can easy use the Embedded web-servers that JHipster -> Spring Boot: provides following JHipster steps:

    Generating a WAR file

    To package the application as a “production” WAR, type:
    
    ./mvnw -Pprod package
    
    Or when using Gradle:
    
    ./gradlew -Pprod bootRepackage
    
    This will generate two files (if your application is called “jhipster”):
    
    target/jhipster-0.0.1-SNAPSHOT.war
    target/jhipster-0.0.1-SNAPSHOT.war.original
    

    Executing the WAR file without an application server

    Instead of deploying to an application server, many people find it easier to just have an exectuable WAR file.
    
    The first WAR file generated in the previous step is such a WAR, so you can run it in “production” mode by typing (on Mac OS X or Linux):
    
    ./jhipster-0.0.1-SNAPSHOT.war
    
    If you are on Windows, use:
    
    java -jar jhipster-0.0.1-SNAPSHOT.war
    

    For more information please follow this great document by JHipster