Jump to content
We've recently updated our Privacy Statement, available here ×

'attribute deprecated' warnings


alchavez

Recommended Posts

Hello,

 

The application running jasper reports is generating a ton of warnings when a report is run, saying that many of the attributes are deprecated (see below for detailed error).

 

My question is, is there a good way (preferably in iReport 2.0.3 / 2.0.4) to update the reports to help prevent these warnings. I'd like to be able to update the reports to no longer use the 'deprecated' attributes.

 

Many Thanks,

alchavez

 

WARN [main] (JRBoxFactory.java:100) - The 'topBorderColor' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRBoxFactory.java:115) - The 'leftBorder' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRBoxFactory.java:124) - The 'leftBorderColor' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRBoxFactory.java:139) - The 'bottomBorder' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRBoxFactory.java:148) - The 'bottomBorderColor' attribute is deprecated. Use the <pen> tag

WARN [main] (JRBoxFactory.java:163) - The 'rightBorder' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRBoxFactory.java:172) - The 'rightBorderColor' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRBoxFactory.java:91) - The 'topBorder' attribute is deprecated. Use the <pen> tag instead.

WARN [main] (JRGraphicElementFactory.java:63) - The 'pen' attribute is deprecated. Use the <pen> tag instead.

Link to comment
Share on other sites

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Hello alchavez,

 

that's a good question:

I've also updated to the new JasperReports version and now getting these error messages. We've got about 20 reports here I would like to update so that no warnings are displayed anymore. Is there an easy way to do this? How to use these "<pen>" tags in iReport?

 

Thanks in advance for any ideas

Andreas

Link to comment
Share on other sites

Hello,

 

I have written a little script that converts a .jrxml file to the newest version, such that no deprecated warning are printed anymore. The changes are inspired by the changes that are made automatically by the jasperreports xml reader.

 

I am hesitating to use it myself at the moment, because it looks like the iReport is not ready to use these new constructs. See http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=35677&catid=9

for a topic with title 'pen nested elements in iReport 2.0.4' on this forum.

 

Unzip the attached file and run the script with a python interpreter.

 

Bart.

 

(reposted as a .zip file) [file name=convert_204.zip size=1510]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/convert_204.zip[/file]

Post edited by: bartvh, at: 2008/01/28 15:47

Link to comment
Share on other sites

Hello bartvh,

 

first thank you for your great work.

 

I tried you Python script, but when I try to generated the changed report XML file, I got following error messages:

----

30.01.2008 09:29:59 org.apache.commons.digester.Digester error

SCHWERWIEGEND: Parse Error at line 63 column 341: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)".

org.xml.sax.SAXParseException: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)".

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2048)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)

at org.apache.commons.digester.Digester.parse(Digester.java:1745)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151)

at de.absoft.util.wTAccountMaster.main(wTAccountMaster.java:41)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)".

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151)

at de.absoft.util.wTAccountMaster.main(wTAccountMaster.java:41)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Caused by: org.xml.sax.SAXParseException: The content of element type "box" must match "(pen?,topPen?,leftPen?,bottomPen?,rightPen?)".

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2048)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)

at org.apache.commons.digester.Digester.parse(Digester.java:1745)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)

... 11 more

 

Process finished with exit code 0

----

 

Do you have any idea on that?

 

I've attached the changed report XML file. Perhaps this helps.

 

Thanks in advance for your help

Andreas

http://www.ab-tools.com/English/ [file name=wTAccount.xml size=111158]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/wTAccount.xml[/file]

Link to comment
Share on other sites

Hi again,

 

well, it looks like the DTD of the jasperreports XML is more strict that I was caring for...

 

I updated the order of the pen nested elements, this should fix the parse error. I should add that I haven't tried this new version, and I am going on a ski holiday next week :) .

 

 

Bart. [file name=convert_204-f63a191f480c168c6b3faa133139f5ef.zip size=1511]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/convert_204-f63a191f480c168c6b3faa133139f5ef.zip[/file]

Link to comment
Share on other sites

  • 3 weeks later...

I didn't roll back to the previous version, because the deprecated attributes do still work, according to my experience. They only give warnings when compiling a report.

 

Still, I would like to shut up these warnings. The iReport tools has a log4j configuration to this effect. However, I am using an (automated) ant build script to compile reports, and I can't find an easy way to also use such a log4j configuration.

Link to comment
Share on other sites

  • 10 months later...

Hi, Do you have an application or

Is there any script so that I can run this on windows as well ??

I really need to convert the old jrxmls to remove the deprecated  tags,

 

they are taking up more than 20% of the log file as our application is for generating reports !!

Link to comment
Share on other sites

  • 4 months later...

I have the same problem with the deprecated tags.

I´ve read, that it might work to open the old jrxml´s and save them with a newer IReport version.

But every newer version than 2.0.4 throws me a null.pointer.exception.

 

Is there already a complete solution for the deprecated tags ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...