Jump to content
Changes to the Jaspersoft community edition download ×

ireport 2.0 oracle.sql.timestamp error


2006 IR Open Dicussion

Recommended Posts

By: halestorm - halestorm

ireport 2.0 oracle.sql.timestamp error

2006-03-01 08:58

Let me start by stating that I very new to ireport!

I have copied classes12.jar, nls_charset12.jar, and tools.jar to the ireportlib directory, but

I am unable to compile a report which uses the oracle.sql.Timstamp field type. In ireport V1.0 these fields were recognized as java.sql.timestamp and the report compiled and ran successfully. Here is the error:

it.businesslogic.ireport.ReportClassLoader@4be179 0 [Thread-2] ERROR digester.Digester - Parse Error at line 185 column 57: Attribute "class" with value "oracle.sql.TIMESTAMP" must have a value from the list "java.lang.Boolean java.lang.Byte java.util.Date java.sql.Timestamp java.sql.Time java.lang.Double java.lang.Float java.lang.Integer java.lang.Long java.lang.Short java.math.BigDecimal java.lang.Number java.lang.String ". org.xml.sax.SAXParseException: Attribute "class" with value "oracle.sql.TIMESTAMP" must have a value from the list "java.lang.Boolean java.lang.Byte java.util.Date java.sql.Timestamp java.sql.Time java.lang.Double java.lang.Float java.lang.Integer java.lang.Long java.lang.Short java.math.BigDecimal java.lang.Number java.lang.String ". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.validateDTDattribute(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1647) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:107) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:473) at java.lang.Thread.run(Thread.java:534)

 

Is this a known bug, or have I missed something in the set up? Any help would be greatly appreciated.

 

 

 

 

By: Giulio Toffoli - gt78

RE: ireport 2.0 oracle.sql.timestamp error

2006-03-01 10:36

 

It's a bug introduced in this version.

You can workaround the problem setting the right

field type by hand modifing the field.

Anyway I'll add a bug submission with a patch.

 

Stay in touch.

 

Giulio

 

 

 

 

By: Giulio Toffoli - gt78

RE: ireport 2.0 oracle.sql.timestamp error

2006-03-01 17:08

Hi halestorm,

 

the problem is not the field type but the textfield type. A field declared as oracle.sql.TIMESTAMP is ok. The problem is that iReport uses the same classtype for the textfield, and this is no good.

The best workaround in your case is using the method timestampValue() from your oracle.sql.TIMESTAMP and set the textfield expression class to java.sql.Timestamp

 

i.e.

 

$F{ACCESS_TIME}.timestampValue()

 

The new policy in iReport will be that:

/** Setter for property classExpression.

* If newClass is not in

* java.lang.Boolean

* java.lang.Byte

* java.util.Date

* java.sql.Timestamp

* java.sql.Time

* java.lang.Double

* java.lang.Float

* java.lang.Integer

* java.lang.Long

* java.lang.Short

* java.math.BigDecimal

* java.lang.Number

* java.lang.String

* the method trys to find something of similar using getSuperClass

*

* If no solution is find, the type is set to java.lang.String an optionally is possible

* change the expression with something like ""+<exp> and the textfield class is set to java.lang.String. This should be very rare...

*

*/

 

 

 

 

By: halestorm - halestorm

RE: ireport 2.0 oracle.sql.timestamp error

2006-03-02 09:23

Thanks, Giulio!

 

I am able to run the report in V2.0 now. I edited the textfield expressions as you instructed, but I also had to edit the XML directly...changing oracle.sql.TIMESTAMP to java.sql.Timestamp.

 

Again thanks for the help.

 

 

 

 

By: Giulio Toffoli - gt78

RE: ireport 2.0 oracle.sql.timestamp error

2006-03-02 11:33

Yes, the jrxml corruption was the bad effect...

 

Giulio

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...