Good afternoon! Tell me please, we are moving from version 11 of Java to 17.0.4.1. And Aspose stopped seeing getters.
We are using Aspose version 19.11.
Code example:
public class AsposeQuestion {
@Test
void test() throws Exception {
final ReportingEngine engine = new ReportingEngine();
Document doc = new Document("C:\\Temp\\in.docx");
Source source = getSource();
engine.buildReport(doc, source, "source");
try (var outputStream = new ByteArrayOutputStream()) {
doc.save(outputStream, SaveFormat.DOCX);
Path path = Paths.get("C:\\Temp\\out.docx");
Files.write(path, outputStream.toByteArray());
} catch (Exception ex) {
System.out.println(ex);
throw ex;
}
}
private Source getSource() {
return Source.builder()
.sourceName("sourceName")
.build();
}
}
@Builder
public class Source {
private String sourceName;
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
}
I also attach the in.docx filein.docx (19.0 KB)
We are getting this error:
java.lang.IllegalStateException: An error has been encountered at the end of expression ' source.getSourceName()]>'. Can not resolve method 'getSourceName' on type 'class ru.project.xxx.Source'.
In java11 version everything worked fine.
Thank you!