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

Unable to compile reports with Image rotation in Jasperreport 7.x #493

Closed alban5650 closed 3 weeks ago

alban5650 commented 3 weeks ago

I am unable to compile jasper reports 7.0.1 where Image rotation is set, e.g.

<element kind="image" uuid="35d418c1-35a8-46dc-9f8f-460e9a3767d9" x="0" y="386" width="60" height="164" hImageAlign="Center">
  <expression><![CDATA["templates/reports/img/BATCH.png"]]></expression>
  <ownRotation>Left</ownRotation>
</element>

I am getting the following error when trying to compile the report:

Exception in thread "main" net.sf.jasperreports.jackson.util.JacksonRuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "ownRotation" (class net.sf.jasperreports.engine.design.JRDesignImage), not marked as ignorable (43 known properties: "vImageAlign", "removeLineWhenBlank", "positionType", "width", "printRepeatedValues", "box", "hyperlinkPageExpression", "printInFirstWholeBand", "linkType", "property", "expression", "printWhenDetailOverflows", "backcolor", "usingCache", "key", "mode", "bookmarkLevelExpression", "height", "styleExpression", "printWhenGroupChanges", "bookmarkLevel", "scaleImage", "hImageAlign", "hyperlinkAnchorExpression", "lazy", "hyperlinkTooltipExpression", "x", "y", "uuid", "hyperlinkReferenceExpression", "printWhenExpression", "onErrorType", "propertyExpression", "anchorNameExpression", "stretchType", "evaluationGroup", "forecolor", "evaluationTime", "linkTarget", "style", "hyperlinkWhenExpression", "pen", "hyperlinkParameter"])
 at [Source: (ByteArrayInputStream); line: 182, column: 36] (through reference chain: net.sf.jasperreports.engine.design.JasperDesign["detail"]->net.sf.jasperreports.engine.design.JRDesignSection["band"]->java.util.ArrayList[0]->net.sf.jasperreports.engine.design.JRDesignBand["element"]->java.util.ArrayList[26]->net.sf.jasperreports.engine.design.JRDesignImage["ownRotation"])
    at net.sf.jasperreports.jackson.util.JacksonUtil.loadXml(JacksonUtil.java:309)
    at net.sf.jasperreports.engine.xml.JacksonReportLoader.loadReport(JacksonReportLoader.java:66)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:165)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:149)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:136)
    at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:334)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:601)
    at com.xbp.jasper.CompileReports.main(CompileReports.java:25)
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "ownRotation" (class net.sf.jasperreports.engine.design.JRDesignImage), not marked as ignorable (43 known properties: "vImageAlign", "removeLineWhenBlank", "positionType", "width", "printRepeatedValues", "box", "hyperlinkPageExpression", "printInFirstWholeBand", "linkType", "property", "expression", "printWhenDetailOverflows", "backcolor", "usingCache", "key", "mode", "bookmarkLevelExpression", "height", "styleExpression", "printWhenGroupChanges", "bookmarkLevel", "scaleImage", "hImageAlign", "hyperlinkAnchorExpression", "lazy", "hyperlinkTooltipExpression", "x", "y", "uuid", "hyperlinkReferenceExpression", "printWhenExpression", "onErrorType", "propertyExpression", "anchorNameExpression", "stretchType", "evaluationGroup", "forecolor", "evaluationTime", "linkTarget", "style", "hyperlinkWhenExpression", "pen", "hyperlinkParameter"])
 at [Source: (ByteArrayInputStream); line: 182, column: 36] (through reference chain: net.sf.jasperreports.engine.design.JasperDesign["detail"]->net.sf.jasperreports.engine.design.JRDesignSection["band"]->java.util.ArrayList[0]->net.sf.jasperreports.engine.design.JRDesignBand["element"]->java.util.ArrayList[26]->net.sf.jasperreports.engine.design.JRDesignImage["ownRotation"])
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1132)
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1705)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1683)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:320)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:215)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
    at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:122)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:144)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:110)
    at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361)
    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.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.deserialize(BeanDeserializer.java:278)
    at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:131)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserializeWith(SettableBeanProperty.java:576)
    at com.fasterxml.jackson.databind.deser.impl.MergingSettableBeanProperty.deserializeAndSet(MergingSettableBeanProperty.java:80)
    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)
    ... 7 more

Jaspersoft Studio also throws the same exception: image

teodord commented 3 weeks ago

This was indeed a bug. Fixed for the next release.

Thank you, Teodor