问题标签 [embedded-tomcat]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
26 浏览

spring-boot - Spring Boot 和嵌入式 Tomcat - ClassLoader 的问题?

我有一个使用带有嵌入式 Tomcat 的 Spring Boot 的休息服务项目。但是当我启动项目(使用 IntelliJ/Eclipse)时,我收到外部库抛出的错误消息“无法将 com.example.SomeClass 类型的对象分配给字段 com.example.SomeOtherClass.var1”。外部库希望通过 Java 反射将类分配给变量。我检查了值和变量是否具有相同的类。这是正确的类,但我认为该类被不同的类加载器加载了两次,我不知道为什么(如果这是原因)。将应用程序部署到独立的 Tomcat 实例时,我没有收到此错误。

这是一个例外:

pom.xml

依赖项主要由 Spring initializr 生成。我没有 web.xml。

也许有人以前遇到过这个问题并且可以帮助我。提前致谢。

0 投票
0 回答
5 浏览

spring-boot - struts2.5.26 只有文件字段在动作类上为空,其余字段正在设置

最近我从 struts2.3.35 迁移到 struts2.5.26 并且随之我从使用外部 tomcat 的 spring 迁移到 spring boot 应用程序,现在它使用嵌入式 tomcat。

因此,每当我尝试在动作类上上传文件时,即使我在动作类上有 setter 方法,也会返回 null。