Tomcat部署:org.apache.catalina.core.StandardContext.startInternal 一个或多个listeners启动失败

添加了实体监听之后,打包好的项目部署在Tomcat上报这样的错,是缺少什么配置吗?请赐教。具体日志如下:

Tomcat日志.txt (7.3 KB)

我把RESI api插件卸掉以后再部署就没有这个问题?是不是用这个REST api,打包部署需要进行什么配置。(以上都是本地运行没有问题,war包部署有问题)

CUBA 还是 Jmix?

CUBA

查看一下CUBA 应用程序日志文件

localhost.2022-05-12.log (28.4 KB) 是这个吗?

image
看一下 Gradle 所用的jdk 版本

另外再把 build.gradle 脱密后发一下。

image

build.gradle.txt (6.5 KB)

在 build.gradle 中显式依赖上这两个包试试:
compile(‘javax.xml.bind:jaxb-api:2.3.1’)
compile(‘org.glassfish.jaxb:jaxb-runtime:2.3.1’)

另外参考一下英文论坛的帖子:

在build.gradle中加上了那两个包,还是那样。然后我把jdk换成1.8试了一下,还是那种问题。

  • 我看到你部署环境jdk是 1.8,所以你把开发环境的jdk也设置成1.8,确切来说是是运行 gradle 的jvm版本。
    同时不要显式添加jaxb依赖,,然后编译war试试。

  • 如果还不行,那么将 jaxb 依赖添加到 server 配置试试:

https://doc.cuba-platform.com/manual-7.2/build.gradle.html

You can add dependencies via the server configuration for core, web, and portal modules (modules that have a task with the CubaDeployment type). It makes sense in some cases. For example, for the UberJar deployment, the dependency is accessed before the application starts, and the dependency is needed for all deployment options in a specific module. Then declaring separately in the module (which is necessary, for example, for the WAR deployment) and via the uberjar configuration at the project level will cause unnecessary dependency duplication for UberJar. These dependencies will be placed in the server libs by deploy, buildWar, and buildUberJar tasks.

The entitiesEnhancing configuration block is used to configure the bytecode enhancement (weaving) of entity classes. It should be included at least in the global module, but can also be declared in each module separately.

你好,我现在的部署和开发环境都是1.8,试过了还是不行。image
您说的将 jaxb 依赖添加到 server 配置,意思是各模块都添加那个包吗?那和显式添加依赖有什么不同呢?

比较奇怪…
image
有没有确认一下这几个 lib 目录没有没有 jaxb 相关的包。

你好,这个文件夹是在什么位置啊 :relaxed:

解压 war 后就是这个布局

lib文件下有这些包,image image

我试了一下,以下环境是没有问题的:
Apache Tomcat/8.5.78
Windows 10
jre1.8.0_241
项目中包含了 RestAPI addon、 Single War部署 。

建议两方面试一下:

  • 将 jaxb 相关jar放到 tomcat安装目录的lib目录下,看看能不能解决问题
  • 换个 tomcat 版本试试,看看是否和 tomcat 版本有关系。

你好,两个方法我都试过了,还是部署不成功。另外我发现web的配置文件web.xml有几处报错,不知道是不是跟这个有关系?image