TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.07k stars 404 forks source link

7.0.0 - Error "net.sf.jasperreports.engine.ExpressionReturnValue" after updating .jrxml file #480

Closed lucagaetani closed 2 months ago

lucagaetani commented 2 months ago

I use Jaspersoft Studio 7.0 and the latest snapshot for compiling settings (as suggested in https://github.com/TIBCOSoftware/jasperreports/issues/445#issuecomment-2185264548), but when i update my .jrxml file using "Update JasperReports files" it gives me this error:

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `net.sf.jasperreports.engine.ExpressionReturnValue` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: (ByteArrayInputStream); line: 690, column: 3] (through reference chain: net.sf.jasperreports.engine.design.JasperDesign["title"]->net.sf.jasperreports.engine.design.JRDesignBand["returnValue"]->java.util.ArrayList[0])

    at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)

    at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1909)

    at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:408)

    at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1354)

    at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:274)

    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:359)

    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244)

    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28)

    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)

    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314)

    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)

    at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:122)

    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)

    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314)

    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)

    at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:122)

    at com.fasterxml.jackson.dataformat.xml.deser.XmlDeserializationContext.readRootValue(XmlDeserializationContext.java:91)

    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4730)

    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3714)

    at net.sf.jasperreports.jackson.util.JacksonUtil.loadXml(JacksonUtil.java:305)

    ... 31 more

The stack trace brings me to these lines of code:

<band>
//other code
    <returnValue toVariable="bandTitle">
        <expression><![CDATA["Variable"]]></expression>
    </returnValue>
</band>
teodord commented 2 months ago

I'm not sure how you are using the latest snapshot of the library, as replacing the JAR in Jaspersoft Studio is not immediately obvious. But since I already mentioned this will be fixed in the next JSS release, opening a new tracker about the same thing is not going to make it happen sooner.

Thank you, Teodor

lucagaetani commented 2 months ago

Ok, i will wait for the new version then thanks, but i don't understand the "is not immediately obvious" for the jar being replaced into Jaspersoft Studio: isn't correct to change the "Compiler settings" of the project's properties to the latest snapshot jar i found on the jfrog that you linked in the previous issue? Thanks

teodord commented 2 months ago

The 445 issue you referred to does not say changing compiler settings solves the issue, so not sure why you tried that.

Thanks, Teodor

lucagaetani commented 2 months ago

Oh, so i misunderstood, sorry. Thanks for the answers!