English 中文(简体)
ExtentReports - Java ExtentReports FreeMarker Template Error: freemarker.core._MiscTemplateException
原标题:ExtentReports - Java ExtentReports FreeMarker Template Error: freemarker.core._MiscTemplateException



SEVERE: Error executing FreeMarker template
FreeMarker template error:
Template inclusion failed (for parameter value "partials/exceptıon.ftl"):
Template not found for name "spark/partials/exceptıon.ftl".
The name was interpreted by this TemplateLoader: ClassTemplateLoader(resourceLoaderClass=com.aventstack.extentreports.ExtentReports, basePackagePath="templates/" /* relatively to resourceLoaderClass pkg */).

----
FTL stack trace ("~" means nesting-related):
    - Failed at: #include "partials/${view.toString()}...  [in template "spark/spark.spa.ftl" at line 27, column 36]
----

Java stack trace (for programmers):
----
freemarker.core._MiscTemplateException: [... Exception message was already printed; see it above ...]
    at freemarker.core.Include.accept(Include.java:164)
    at freemarker.core.Environment.visit(Environment.java:371)
    at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
    at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
    at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
    at freemarker.core.Environment.visitIteratorBlock(Environment.java:645)
    at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
    at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
    at freemarker.core.Environment.visit(Environment.java:335)
    at freemarker.core.Environment.visit(Environment.java:341)
    at freemarker.core.Environment.process(Environment.java:314)
    at freemarker.template.Template.process(Template.java:383)
    at com.aventstack.extentreports.templating.FreemarkerTemplate.processTemplate(FreemarkerTemplate.java:52)
    at com.aventstack.extentreports.templating.FreemarkerTemplate.getSource(FreemarkerTemplate.java:39)
    at com.aventstack.extentreports.templating.FreemarkerTemplate.writeTemplate(FreemarkerTemplate.java:45)
    at com.aventstack.extentreports.reporter.AbstractFileReporter.processTemplate(AbstractFileReporter.java:74)
    at com.aventstack.extentreports.reporter.ExtentSparkReporter.flush(ExtentSparkReporter.java:149)
    at com.aventstack.extentreports.reporter.ExtentSparkReporter$1.onNext(ExtentSparkReporter.java:121)
    at com.aventstack.extentreports.reporter.ExtentSparkReporter$1.onNext(ExtentSparkReporter.java:113)
    at io.reactivex.rxjava3.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:310)
    at io.reactivex.rxjava3.subjects.PublishSubject.onNext(PublishSubject.java:226)
    at com.aventstack.extentreports.ReactiveSubject.onFlush(ReactiveSubject.java:83)
    at com.aventstack.extentreports.AbstractProcessor.onFlush(AbstractProcessor.java:96)
    at com.aventstack.extentreports.ExtentReports.flush(ExtentReports.java:279)
    at com.hyr.extentreports.Deneme2.main(Deneme2.java:11)
Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "spark/partials/exceptıon.ftl".
The name was interpreted by this TemplateLoader: ClassTemplateLoader(resourceLoaderClass=com.aventstack.extentreports.ExtentReports, basePackagePath="templates/" /* relatively to resourceLoaderClass pkg */).
    at freemarker.template.Configuration.getTemplate(Configuration.java:2957)
    at freemarker.core.Environment.getTemplateForInclusion(Environment.java:3062)
    at freemarker.core.Include.accept(Include.java:162)
    ... 24 more

Eki 14, 2023 10:57:24 ÖS com.aventstack.extentreports.reporter.ExtentSparkReporter flush
SEVERE: An exception occurred
FreeMarker template error:
Template inclusion failed (for parameter value "partials/exceptıon.ftl"):
Template not found for name "spark/partials/exceptıon.ftl".
The name was interpreted by this TemplateLoader: ClassTemplateLoader(resourceLoaderClass=com.aventstack.extentreports.ExtentReports, basePackagePath="templates/" /* relatively to resourceLoaderClass pkg */).

----
FTL stack trace ("~" means nesting-related):
    - Failed at: #include "partials/${view.toString()}...  [in template "spark/spark.spa.ftl" at line 27, column 36]
----

Java stack trace (for programmers):
----
freemarker.core._MiscTemplateException: [... Exception message was already printed; see it above ...]
    at freemarker.core.Include.accept(Include.java:164)
    at freemarker.core.Environment.visit(Environment.java:371)
    at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
    at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
    at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
    at freemarker.core.Environment.visitIteratorBlock(Environment.java:645)
    at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
    at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
    at freemarker.core.Environment.visit(Environment.java:335)
    at freemarker.core.Environment.visit(Environment.java:341)
    at freemarker.core.Environment.process(Environment.java:314)
    at freemarker.template.Template.process(Template.java:383)
    at com.aventstack.extentreports.templating.FreemarkerTemplate.processTemplate(FreemarkerTemplate.java:52)
    at com.aventstack.extentreports.templating.FreemarkerTemplate.getSource(FreemarkerTemplate.java:39)
    at com.aventstack.extentreports.templating.FreemarkerTemplate.writeTemplate(FreemarkerTemplate.java:45)
    at com.aventstack.extentreports.reporter.AbstractFileReporter.processTemplate(AbstractFileReporter.java:74)
    at com.aventstack.extentreports.reporter.ExtentSparkReporter.flush(ExtentSparkReporter.java:149)
    at com.aventstack.extentreports.reporter.ExtentSparkReporter$1.onNext(ExtentSparkReporter.java:121)
    at com.aventstack.extentreports.reporter.ExtentSparkReporter$1.onNext(ExtentSparkReporter.java:113)
    at io.reactivex.rxjava3.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:310)
    at io.reactivex.rxjava3.subjects.PublishSubject.onNext(PublishSubject.java:226)
    at com.aventstack.extentreports.ReactiveSubject.onFlush(ReactiveSubject.java:83)
    at com.aventstack.extentreports.AbstractProcessor.onFlush(AbstractProcessor.java:96)
    at com.aventstack.extentreports.ExtentReports.flush(ExtentReports.java:279)
    at com.hyr.extentreports.Deneme2.main(Deneme2.java:11)
Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "spark/partials/exceptıon.ftl".
The name was interpreted by this TemplateLoader: ClassTemplateLoader(resourceLoaderClass=com.aventstack.extentreports.ExtentReports, basePackagePath="templates/" /* relatively to resourceLoaderClass pkg */).
    at freemarker.template.Configuration.getTemplate(Configuration.java:2957)
    at freemarker.core.Environment.getTemplateForInclusion(Environment.java:3062)
    at freemarker.core.Include.accept(Include.java:162)
    ... 24 more




<dependency>
            <groupId>com.aventstack</groupId>
            <artifactId>extentreports</artifactId>
            <version>5.1.1</version>
        </dependency>



public static void main(String[] args) {
        ExtentReports extent = new ExtentReports();
        ExtentSparkReporter spark = new ExtentSparkReporter("target/Spark.html");
        extent.attachReporter(spark);
        extent.createTest("MyFirstTest")
                .log(Status.PASS, "This is a logging event for MyFirstTest, and it passed!");
        extent.flush();
    }


我观看了所有大小报告安装录像,但我看不到有任何问题。 奇怪的是,当我安装一个朋友,在我自己的电脑上顺利执行“Extent Report”项目时,我也遇到同样的错误。 因此,我认为这个问题与项目无关,但你可以说出。

I added extentreports adjustments to my project in different ways, both simple and complex, but the result did not change. I created new projects, but the result did not change. I deleted everything, Java, Intellij, Maven, and reinstalled it, but the result was the same. I watched the videos exactly from start to finish and still got the same result. I saw that no one is using the "exception.ftl" file, which was stated to be missing in the error I received.

请帮助我。

问题回答

I m getting the same error too I reset Intellij and it didn t work. I even formatted my computer. It didn t happen again.

www.un.org/Depts/DGACM/index_spanish.htm Logfile中的错误:

Şub 17, 2024 10:25:54 ÖS freemarker.log._JULLoggerFactory$JULLogger error
SEVERE: Error executing FreeMarker template
FreeMarker template error:
Template inclusion failed (for parameter value "partials/exceptıon.ftl"):
Template not found for name "spark/partials/exceptıon.ftl".
The name was interpreted by this TemplateLoader: ClassTemplateLoader(resourceLoaderClass=com.aventstack.extentreports.ExtentReports, basePackagePath="templates/" /* relatively to resourceLoaderClass pkg */).

FTL st痕(“~”系指nes相关):

- Failed at: #include "partials/${view.toString()}...  [in template "spark/spark.spa.ftl" at line 27, column 36]

Java stack trace (for programmers):

freemarker.core._MiscTemplateException: [... Exception message was already printed; see it above ...]

I can t get rid of this error. Can you help?





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签