Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Instable fonts with Birt Runtime 2.6.0
dominik
Hi!
Since the Runtime-update to 2.6.0 we've got problems with fonts in our PDF-Reports. Fonts-sizes are sporadic and hard to reproduce bold or bigger. If I regenerate the report the result is not the same...means other characters are affected.
Our Java-application is running on a clustered IBM-Websphere (6.1.0.25) setup.
Another more critical issue is that sometimes, data is missing in the report. Complete table rows are empty or missing!? If I generate the same report by hand using the Birt-Eclipse everything is ok. So it has something to do with the runtime environment.
Does anybody already know this issue?
Thanks & Regards,
Dominik
Find more posts tagged with
Comments
dominik
Hi again!
Unfortunately this topic has been left unanswered :-/
Let's start a second attempt ;-)
Due to this is still a major issue for our project I hope that someone could give some support.
Maybe this information could help to find a solution: we don't think anymore that this has something to do with the switch of the Birt-version. Another significant modification in our architecture has been made at the same time we upgraded to Birt 2.6.0: we don't call anymore a stateless EJB directly to trigger the Birt Engine >> we trigger the pdf-creation via JMS by putting IDs into a Message Queue. So we think that this procedure may cause concurrency issues!?
Another suspicion is that the missing data issue occures only the first time the Birt Engine gets initialized after a Application server restart.
Is there someone out there facing similar problems or more preferable someone who has already solved them?
Maybe someone knows additional places where I can post my request?
Thanks & Regards,
Dominik
JasonW
Dominik,
Take a look at the org.eclipse.birt.report.engine.fonts plugin that contains a fontsConfig.xml file that has some comments on how the fonts work with PDF. On the missing data I have not seen this problem. How are you calling the engine? If you are using the API, you should only have one instance of the Engine and for every new thread you should create a new task. The task should be closed by the thread.
Jason
dominik
Jason,<br />
thanks for your reply! I will follow the hint with config-file.<br />
<br />
This is how I'm initializing the engine:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
public static synchronized IReportEngine getBirtEngine() throws EngineException {
if (birtEngine == null) {
initEngineHomePath();
EngineConfig config = new EngineConfig();
config.setLogConfig(engineHome.concat("/log"), Level.FINEST);
config.setEngineHome(engineHome);
try {
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
if (factory != null) {
birtEngine = factory.createReportEngine(config);
} else {
logger.log(Level.WARNING, "ReportEngine is null! Platform.createFactoryObject returns null, " + "maybe Report-Engine-Files are DOS-encoded, but ought to be UNIX-encoded!");
}
} catch (BirtException e) {
throw new EngineException("Birt Report Engine Platform startup failed!" + " Reports could not be generated! See for Detailed Information Report logfile.");
}
}
return birtEngine;
}
</pre>
<br />
This is how I call the engine:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
public byte[] runPdfTask(byte[] reportDesign, Long billId, boolean isCopy) {
Connection connection = null;
try {
IReportEngine engine = BirtEngine.getBirtEngine();
ByteArrayInputStream input = new ByteArrayInputStream(reportDesign);
IReportRunnable design = engine.openReportDesign(input);
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
connection = connectionRetriever.getConnection(em);
task.getAppContext().put(CONNECTION_PROPERTY, connection);
task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, PdfTaskRunnerBean.class.getClassLoader());
...
PDFRenderOption options = getOptions(os);
task.setRenderOption(options);
task.setLocale(Locale.GERMANY);
task.run();
...
task.close();
...
</pre>
<br />
I tried to follow the recommendations from the birt how to guide. Please inform me if you see something suspicious in my code ;-)<br />
<br />
Thanks & regards,<br />
Dominik
JasonW
If you are losing data my first thought would be to look at this code:
connection = connectionRetriever.getConnection(em);
task.getAppContext().put(CONNECTION_PROPERTY, connection);
Can you verify the connection before putting it into the appcontext. Everything else looked fine to me.
Jason
JasonW
Another thing to check is verify the connections are getting closed, unless you are using a connection pool. You can add a setting to the appcontext for this:
IConnectionFactory.CLOSE_PASS_IN_CONNECTION
Set it to true or false.
Jason
dominik
Thanks Jason - good points!
But the connection should not be the problem, because the missing data issue does not affect the whole pdf :-/ In all cases the header section gets correctly filled with data. The problem begins with the first table where sometimes only the first cell is filled with content and all other cells are empty!?
We obtain the connection from an OpenJpaEntityManager >> therefore we don't handle connections manually.
I would have expected to find something in the Report Engine logs, but there is nothing to find. I've already set the loglevel to finest. Is it possible to get more verbose information?
Dominik
JasonW
That is the highest level. Just so you know the default for close connection is true
IConnectionFactory.CLOSE_PASS_IN_CONNECTION. It may not make a difference but if you have a connection manager you may want to set this to false. I am not certain if this will help though.
You may also want to up the cache. This setting is:
DataEngine.MEMORY_BUFFER_SIZE - Memory per Query that is used before caching to disk. Defaults to 10 MB.
Jason
dominik
By limiting the concurrent threads to one I was able to avoid the errors. This fix seems to work properly. But I don't really understand this behaviour, because the initialization of the BirtEngine is synchronized and should be threadsafe!? Hm....<br />
<br />
Addionally I was able to collect an interesting error, which occurs during report generation:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
...
Jan 25, 2011 9:37:32 AM org.eclipse.birt.data.engine.odaconsumer.PreparedStatement doSetBigDecimal( int, BigDecimal )
SEVERE: Cannot set the decimal value (134,898) to parameter 1.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement parameter BigDecimal value.
SQL error #1: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
;
com.ibm.db2.jcc.b.si: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
at org.eclipse.birt.report.data.oda.jdbc.Statement.setBigDecimal(Statement.java:619)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setBigDecimal(OdaQuery.java:665)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetBigDecimal(PreparedStatement.java:4358)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setBigDecimal(PreparedStatement.java:3955)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3141)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:941)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:530)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:283)
...
Caused by: com.ibm.db2.jcc.b.si: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
at com.ibm.db2.jcc.b.db.a(db.java:428)
at com.ibm.db2.jcc.b.ih.setBigDecimal(ih.java:768)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.setBigDecimal(WSJdbcPreparedStatement.java:1193)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBigDecimal(DelegatingPreparedStatement.java:305)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.setBigDecimal(LoggingConnectionDecorator.java:977)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBigDecimal(DelegatingPreparedStatement.java:305)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBigDecimal(DelegatingPreparedStatement.java:305)
at org.eclipse.birt.report.data.oda.jdbc.Statement.setBigDecimal(Statement.java:614)
... 56 more
Jan 25, 2011 9:37:32 AM org.eclipse.birt.data.engine.odaconsumer.PreparedStatement retrySetParameterValue
SEVERE: Cannot set input parameter.
org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot set the decimal value (134,898) to parameter 1.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement parameter BigDecimal value.
SQL error #1: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
;
com.ibm.db2.jcc.b.si: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:54)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:108)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetBigDecimal(PreparedStatement.java:4363)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setBigDecimal(PreparedStatement.java:3955)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3141)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:941)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:530)
...
Caused by: org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement parameter BigDecimal value.
SQL error #1: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
;
com.ibm.db2.jcc.b.si: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
at org.eclipse.birt.report.data.oda.jdbc.Statement.setBigDecimal(Statement.java:619)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setBigDecimal(OdaQuery.java:665)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetBigDecimal(PreparedStatement.java:4358)
... 54 more
Caused by: com.ibm.db2.jcc.b.si: [ibm][db2][jcc][10177][11599] Invalid data conversion: Requested conversion would result in a loss of precision of 134898.
at com.ibm.db2.jcc.b.db.a(db.java:428)
at com.ibm.db2.jcc.b.ih.setBigDecimal(ih.java:768)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.setBigDecimal(WSJdbcPreparedStatement.java:1193)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBigDecimal(DelegatingPreparedStatement.java:305)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.setBigDecimal(LoggingConnectionDecorator.java:977)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBigDecimal(DelegatingPreparedStatement.java:305)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBigDecimal(DelegatingPreparedStatement.java:305)
at org.eclipse.birt.report.data.oda.jdbc.Statement.setBigDecimal(Statement.java:614)
... 56 more
Jan 25, 2011 9:37:33 AM org.eclipse.birt.report.engine.api.impl.ReportEngine
SEVERE: An error happened while running the report. Cause:
java.lang.NullPointerException
at com.ibm.ws.rsadapter.spi.CacheMap.remove(CacheMap.java:268)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.getStatement(WSRdbManagedConnectionImpl.java:2613)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2086)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2039)
at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:165)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:225)
at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:163)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1308)
...
</pre>
JasonW
By synchronizing the call to the engine it should be thread safe. Using a new thread per task should be fine. This appears to be an issue with the driver or maybe exceeding connections. Can you open a bugzilla entry for this?
Jason