I'm currently trying to build spring-webmvc for version 6.0.2 with all tests passing. While the build completes successfully, I'm encountering issues with two tests that are failing:
- XlsViewTests > testXlsxStreamingView() FAILED
java.lang.InternalError at XlsViewTests.java:104 Caused by: java.lang.reflect.InvocationTargetException at XlsViewTests.java:104 Caused by: java.lang.RuntimeException at XlsViewTests.java:104
- FreeMarkerMacroTests > testAge() FAILED
freemarker.core.NonStringOrTemplateOutputException at FreeMarkerMacroTests.java:331
I am running this on a Linux system with the following configuration:
Gradle 8.10.2
Build time: 2024-09-23 21:28:39 UTC Revision: 415adb9e06a516c44b391edff552fd42139443f7
Kotlin: 1.9.24 Groovy: 3.0.22 Ant: Apache Ant(TM) version 1.10.14 compiled on August 16 2023 Launcher JVM: 17.0.8 Daemon JVM: /opt/jdk-17.0.8 (no JDK specified, using current Java home) OS: Linux 5.4.17-2136.331.7.el8uek.x86_64 amd64
I cloned the Spring Framework repository using the following command: git clone https://github.com/spring-projects/spring-framework.git -b v6.2.0 /tmp/pkgs_raw/spring-webmvc/6.2.0
Then, I navigated to the project directory: cd /tmp/pkgs_raw/spring-webmvc/6.2.0
Next, I attempted to build the project with the following commands: ./gradlew clean :spring-webmvc:build -x test or ./gradlew :spring-webmvc:build -x test
In both cases, the build was successful. However, when I try to run the tests with:
./gradlew clean :spring-webmvc:test
I encounter the following stack trace:
XlsViewTests > testXlsxStreamingView() FAILED
java.lang.InternalError at XlsViewTests.java:104 Caused by: java.lang.reflect.InvocationTargetException at XlsViewTests.java:104 Caused by: java.lang.RuntimeException at XlsViewTests.java:104
java.lang.InternalError: java.lang.reflect.InvocationTargetException
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:87)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:75)
at java.desktop/java.awt.Font.getFont2D(Font.java:526)
at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2282)
at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469)
at java.desktop/java.awt.font.TextLayout.
FreeMarkerMacroTests > testAge() FAILED
freemarker.core.NonStringOrTemplateOutputException at FreeMarkerMacroTests.java:331
freemarker.core.NonStringOrTemplateOutputException: For "${...}" content: Expected a string or something automatically convertible to string (number, date or boolean), or "template output" , but this has evaluated to a method+sequence (wrapper: f.e.b.SimpleMethodModel): ==> command.age [in template "tmp.ftl" at line 2, column 3]
Tip: Maybe using obj.something() instead of obj.something will yield the desired value
FTL stack trace ("~" means nesting-related): - Failed at: ${command.age} [in template "tmp.ftl" at line 2, column 1]
at app//freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:530)
at app//freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:406)
at app//freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:375)
at app//freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:104)
at app//freemarker.core.DollarVariable.accept(DollarVariable.java:63)
at app//freemarker.core.Environment.visit(Environment.java:344)
at app//freemarker.core.Environment.visit(Environment.java:350)
at app//freemarker.core.Environment.process(Environment.java:323)
at app//org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:447)
at app//org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:351)
at app//org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:302)
at app//org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:181)
at app//org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:314)
at app//org.springframework.web.servlet.view.freemarker.FreeMarkerMacroTests.getMacroOutput(FreeMarkerMacroTests.java:331)
at app//org.springframework.web.servlet.view.freemarker.FreeMarkerMacroTests.testAge(FreeMarkerMacroTests.java:153)
at java.base@17.0.14/java.lang.reflect.Method.invoke(Method.java:569)
at java.base@17.0.14/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base@17.0.14/java.util.ArrayList.forEach(ArrayList.java:1511)
I've tried: - doing a clean and then retry - setting the lang to utf-8 - building with jdk 21
I just want the two failing tests to pass. I would appreciate any insights or suggestions on resolving these test failures