在 Tomcat 服务器上启动 JHipster 生成的应用程序

Starting JHipster generated app on a Tomcat server

我使用 JHipster 制作了 Web 应用程序。一切正常,但是当我将它移动到 tomcat/webapps 并部署它时,我遇到了一些错误。出现错误后,我的应用程序运行正常,所以我之前没有关注这个...但是现在当我尝试将它部署在 linux 服务器上时,我的应用程序开始出现几个错误 "CreateBeanException"。我认为出现此错误是因为我在他的文件中忽略了(在 windows 和 linux 中)tomcat 配置。有人可以帮我吗? 我在生产中使用 mysql。

这是来自 tomcat.exe 的日志 https://pastebin.com/LA12tiL9

这是我来自 tomcat/conf

的 context.xml
    <?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>

我该贴什么了? 在 windows 和 linux 上安装后,我有默认配置。 我希望有人能帮助我。 谢谢

您是否有任何特殊需要想要将其部署在 tomcat 上? 因为

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

并且 Spring Boot 为您提供了一个 嵌入式 Web 服务器,您可以开箱即用。

因此您可以轻松使用 JHipster -> Spring 引导的嵌入式 Web 服务器:提供以下 JHipster 步骤:

正在生成 WAR 文件

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

在没有应用程序服务器的情况下执行 WAR 文件

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

如需更多信息,请关注 JHipster

的这篇精彩文档