Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » helper = null
helper = null [message #119143] Fri, 27 January 2006 20:26 Go to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

On the 2.0 release, I am getting a NullPointerException upon call to
engine.openReportDesign(path). Looking at the BIRT source, it is
helper.openReportDesign( designName ). Indeed, "helper = null".

Now, I have no idea what "helper" is. Am I supposed to set this or is this
a BIRT bug?
Re: helper = null [message #119159 is a reply to message #119143] Fri, 27 January 2006 20:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zhai.actuate.com

Does this happen for all reports or only for some particular reports? Is
the report location you specified correct? Does it need some encoding? How
do you run this code? Did you get any error log?

Helper is a property inside engine class. user not suppose to set it
directly. It could be null if the engine init process failed.
Re: helper = null [message #119187 is a reply to message #119159] Fri, 27 January 2006 20:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

One report only. (I only have web access to group, so I will include XML
here)
(This report was working under 1.0.1 - it only broke when I upgraded -- I
am on 2.0 now)

----------EmployeeEfficiency.rptdesign ----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Written by Eclipse BIRT 1.0 -->
<report xmlns=" http://www.eclipse.org/birt/2005/design" version="2">
<property name="createdBy">Eclipse BIRT Designer Version 1.0.1 Build
&lt;20050729-0746></property>
<property name="units">in</property>
<text-property name="title">Employee Efficiency Report</text-property>
<method
name="initialize">< ![CDATA[importPackage(Packages.com.labcorp.cels.pla.domain.a ccount);
importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion);
importPackage(Packages.com.labcorp.cels.pla.domain.person);
importPackage(Packages.com.labcorp.cels.pla.domain.person.em ployee);
importPackage(Packages.com.labcorp.cels.pla.domain.specimen) ;
importPackage(Packages.com.labcorp.cels.pla.domain.specimen. container);
importPackage(Packages.com.labcorp.cels.pla.domain.testing);
importPackage(Packages.com.labcorp.cels.pla.domain.testing.p rotocol);
importPackage(Packages.com.labcorp.cels.pla.domain.testing.p rotocol.result);
importPackage(Packages.com.labcorp.cels.pla.domain.reporting );

report = new
EmployeeEfficiencyReport(params["department"],params["dateRange "]);
department = report.getDepartment();
dateRange = report.getDateRange();]]></method>
<parameters>
<scalar-parameter name="department">
<text-property name="displayName">Department</text-property>
<property name="hidden">true</property>
<property name="dataType">string</property>
<property name="allowBlank">false</property>
<property name="allowNull">true</property>
<property name="format">Unformatted</property>
<property name="controlType">text-box</property>
</scalar-parameter>
<scalar-parameter name="dateRange">
<text-property name="displayName">Date Range</text-property>
<property name="hidden">true</property>
<property name="dataType">string</property>
<property name="allowBlank">false</property>
<property name="allowNull">true</property>
<property name="format">Unformatted</property>
<property name="controlType">text-box</property>
</scalar-parameter>
</parameters>
<data-sources>
<script-data-source name="Employee Efficiency Source">
<method name="open"><![CDATA[obj = new Object();]]></method>
<method name="close"><![CDATA[obj = null;]]></method>
</script-data-source>
</data-sources>
<data-sets>
<script-data-set name="Employee Set">
<property name="dataSource">Employee Efficiency
Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">employeeName</property>
<property name="dataType">string</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">employeeName</property>
</structure>
</list-property>
<method name="open"><![CDATA[iEmployees =
department.getEmployees().iterator();]]></method>
<method name="fetch"><![CDATA[if( !iEmployees.hasNext() ) {
return( false ); //done
}
nextEmployee = iEmployees.next();
categories = department.getActivityCategories();

row[ "employeeName" ] = nextEmployee.getFullName() + "";

return( true );]]></method>
</script-data-set>
<script-data-set name="Category Set">
<property name="dataSource">Employee Efficiency
Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">categoryName</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">activities</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">categoryName</property>
</structure>
<structure>
<property name="columnName">activities</property>
</structure>
</list-property>
<method name="open"><![CDATA[iCategory =
categories.iterator();]]></method>
<method name="fetch"><![CDATA[if( !iCategory.hasNext() ) {
return( false ); //done
}
nextCategory = iCategory.next();
//activities = nextCategory.getActivities();
row["activities"] = nextCategory.getActivities();
row[ "categoryName" ] = nextCategory.getName() + "";

return( true );]]></method>
</script-data-set>
<script-data-set name="Activity Set">
<property name="dataSource">Employee Efficiency
Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">activityName</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">targetVolume</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">dailyVolume</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">targetObject</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">activityName</property>
</structure>
<structure>
<property name="columnName">targetVolume</property>
</structure>
<structure>
<property name="columnName">targetObject</property>
</structure>
<structure>
<property name="columnName">dailyVolume</property>
</structure>
</list-property>
<method name="open"><![CDATA[iActivities =
activities.iterator();]]></method>
<method name="fetch"><![CDATA[if( !iActivities.hasNext() ) {
return( false ); //done
}
nextActivity = iActivities.next();

row[ "activityName" ] = nextActivity.getName() + "";
productivity = nextEmployee.calculateEfficiencyFor(nextActivity,
dateRange);
row[ "targetVolume" ] = productivity.get(0) + "";
row[ "targetObject" ] = productivity.get(1) + "";
row[ "dailyVolume" ] = productivity.get(2) + "";

return( true );]]></method>
</script-data-set>
</data-sets>
<page-setup>
<simple-master-page name="Simple MasterPage">
<property name="orientation">auto</property>
<page-footer>
<text>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new
Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table>
<property name="pageBreakAfter">always</property>
<property name="height">4.208in</property>
<property name="width">7.708in</property>
<property name="dataSet">Employee Set</property>
<column>
<property name="width">7.708in</property>
</column>
<header>
<row>
<cell>
<property name="paddingLeft">10pt</property>
<grid>
<property name="marginTop">0pt</property>
<property name="marginBottom">5pt</property>
<property name="width">100%</property>
<column/>
<column/>
<column/>
<row>
<cell>
<label>
<property
name="textAlign">right</property>
<text-property name="text">
</text-property>
</label>
</cell>
<cell>
<label>
<property
name="fontStyle">italic</property>
<property
name="textAlign">right</property>
<text-property name="text">Printed
Date:</text-property>
</label>
</cell>
<cell>
<text>
<property
name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of format="MM/dd/yyyy">new
Date()</value-of>]]></text-property>
</text>
</cell>
</row>
</grid>
<label>
<text-property name="text"> </text-property>
</label>
</cell>
</row>
</header>
<group>
<property name="groupName">EmployeeGroup</property>
<property name="interval">none</property>
<property name="sortDirection">asc</property>
<expression name="keyExpr">row["employeeName"]</expression>
<header>
<row>
<cell>
<label>
<property name="fontSize">larger</property>
<property name="fontWeight">bold</property>
<property
name="textAlign">center</property>
<text-property name="text">Employee
Summary Efficiency</text-property>
</label>
<grid>
<property name="width">100%</property>
<column>
<property
name="width">3.333in</property>
</column>
<column>
<property
name="width">4.291in</property>
</column>
<row>
<cell>
<label>
<property
name="textAlign">right</property>
<text-property name="text">for
</text-property>
</label>
</cell>
<cell>
<data>
<property
name="fontFamily">Arial</property>
<property
name="fontWeight">bold</property>
<property
name="fontStyle">italic</property>
<property
name="color">#0000FF</property>
<expression
name="valueExpr">row["employeeName"]</expression>
</data>
</cell>
</row>
</grid>
<grid>
<property name="marginTop">5pt</property>
<property name="marginLeft">10pt</property>
<property
name="marginBottom">0pt</property>
<property
name="marginRight">30pt</property>
<property name="height">0.395in</property>
<property name="width">5.458in</property>
<column>
<property
name="width">2.395in</property>
</column>
<column>
<property
name="width">1.333in</property>
</column>
<column>
<property
name="width">0.291in</property>
</column>
<column>
<property
name="width">1.437in</property>
</column>
<row>
<property
name="height">0.395in</property>
<cell>
<label>
<property
name="fontWeight">bold</property>
<property
name="textAlign">right</property>
<text-property
name="text">From:</text-property>
</label>
</cell>
<cell>
<data>
<property
name="backgroundColor">#FFFFFF</property>
<property
name="textUnderline">underline</property>
<property
name="paddingLeft">5pt</property>
<property
name="textAlign">left</property>
<expression
name="valueExpr">report.getFormattedStartingDate()</expression >
</data>
</cell>
<cell>
<label>
<property
name="fontWeight">bold</property>
<property
name="textAlign">right</property>
<text-property
name="text">To:</text-property>
</label>
</cell>
<cell>
<data>
<property
name="backgroundColor">#FFFFFF</property>
<property
name="textUnderline">underline</property>
<property
name="paddingLeft">5pt</property>
<expression
name="valueExpr">report.getFormattedEndingDate()</expression >
</data>
</cell>
</row>
</grid>
</cell>
</row>
</header>
<footer>
<row>
<cell/>
</row>
</footer>
</group>
<detail>
<row>
<cell>
<property name="paddingLeft">10pt</property>
<table>
<property name="marginTop">5pt</property>
<property name="height">1.906in</property>
<property name="width">7.354in</property>
<property name="dataSet">Category
Set</property>
<column/>
<column>
<property name="width">3.729in</property>
</column>
<column>
<property name="width">0.729in</property>
</column>
<column>
<property name="width">0.895in</property>
</column>
<header>
<row>
<property
name="backgroundColor">#C0C0C0</property>
<cell>
<property
name="colSpan">2</property>
<property
name="rowSpan">1</property>
<property
name="backgroundColor">#FFFFFF</property>
</cell>
<cell>
<property
name="backgroundColor">#FFFFFF</property>
</cell>
<cell>
<property
name="backgroundColor">#FFFFFF</property>
</cell>
</row>
</header>
<group>
<property
name="groupName">CategoryGroup</property>
<property name="interval">none</property>
<property
name="sortDirection">desc</property>
<expression
name="keyExpr">row["categoryName"]</expression>
<header>
<row>
<cell>
<property
name="colSpan">2</property>
<property
name="rowSpan">1</property>
<property
name="backgroundColor">#C0C0C0</property>
<data>
<property
name="fontWeight">bold</property>
<property
name="paddingLeft">5pt</property>
<expression
name="valueExpr">activities = row["activities"];
row["categoryName"]</expression>
</data>
</cell>
<cell/>
<cell/>
</row>
</header>
<footer>
<row>
<cell/>
<cell/>
<cell/>
<cell/>
</row>
</footer>
</group>
<detail>
<row>
<cell>
<property
name="colSpan">2</property>
<property
name="rowSpan">1</property>
<table>
<property
name="marginLeft">45pt</property>
<property
name="marginRight">0pt</property>
<property
name="width">100%</property>
<property
name="dataSet">Activity Set</property>
<column>
<property
name="width">0.979in</property>
</column>
<column>
<property
name="width">0.666in</property>
</column>
<column>
<property
name="width">0.76in</property>
</column>
<column>
<property
name="width">1.343in</property>
</column>
<column>
<property
name="width">1.302in</property>
</column>
<header>
<row>
<property
name="backgroundColor">#FFD9B3</property>
<cell>
<text>
<property
name="fontWeight">bold</property>
<property
name="textAlign">center</property>
<property
name="contentType">plain</property>
<text-property
name="content"><![CDATA[Activity]]></text-property>
</text>
</cell>
<cell>
<property
name="colSpan">2</property>
<property
name="rowSpan">1</property>
<text>
<property
name="fontWeight">bold</property>
<property
name="textAlign">center</property>
<property
name="contentType">plain</property>
<text-property
name="content"><![CDATA[Volume]]></text-property>
</text>
</cell>
<cell>
<text>
<property
name="fontWeight">bold</property>
<property
name="textAlign">center</property>
<property
name="contentType">plain</property>
<text-property
name="content"><![CDATA[Volume/Day]]></text-property>
</text>
</cell>
<cell>
<property
name="backgroundColor">#FFFFFF</property>
<label>
<text-property
name="text"> </text-property>
</label>
</cell>
</row>
</header>
<detail>
<row>
<list-property
name="highlightRules">
<structure>
<property
name="operator">ne</property>
<property
name="backgroundColor">#EEEEEE</property>
<expression
name="testExpr">row[0] % 2</expression>
<expression
name="value1">0</expression>
</structure>
</list-property>
<cell>
<property
name="borderRightColor">#000000</property>
<property
name="borderRightStyle">solid</property>
<property
name="borderRightWidth">thin</property>
<data>
<expression
name="valueExpr">row["activityName"]</expression>
</data>
</cell>
<cell>
<data>
<property
name="textAlign">right</property>
<expression
name="valueExpr">row["targetVolume"]</expression>
</data>
</cell>
<cell>
<property
name="borderRightColor">#000000</property>
<property
name="borderRightStyle">solid</property>
<property
name="borderRightWidth">thin</property>
<data>
<property
name="paddingLeft">5pt</property>
<expression
name="valueExpr">row["targetObject"]</expression>
</data>
</cell>
<cell>
<data>
<structure
name="numberFormat">
<property
name="category">Fixed</property>
<property
name="pattern">###0.0</property>
</structure>
<property
name="textAlign">right</property>
<expression
name="valueExpr">row["dailyVolume"]</expression>
</data>
</cell>
<cell/>
</row>
</detail>
<footer>
<row>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
</row>
</footer>
</table>
</cell>
<cell/>
<cell/>
</row>
</detail>
<footer>
<row>
<property
name="height">0.239in</property>
<cell/>
<cell/>
<cell/>
<cell/>
</row>
</footer>
</table>
<label>
<text-property name="text"> </text-property>
</label>
</cell>
</row>
</detail>
<footer>
<row>
<property name="height">0.239in</property>
<cell>
<property name="paddingLeft">10pt</property>
</cell>
</row>
</footer>
</table>
</body>
</report>
Re: helper = null [message #119211 is a reply to message #119187] Fri, 27 January 2006 20:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zhai.actuate.com

The engine instance in my code path can open the report design without
problem. Though I can see some script evaluation errors shown up in the
report page, I can not see any NPE. I am using the code path currently
used in the viewer.

Can you pin down the place the NPE thrown out in your local? Is
helper=null? If so, you probably want to trace into the engine init
process and see whether there are some errors.

There are similar engine init code exists in viewer. See
" org.eclipse.birt.report.services.ReportEngineService.initEng ineInstance() "
for example. There are quite a few steps.
Re: helper = null [message #120164 is a reply to message #119211] Mon, 30 January 2006 18:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

Yes, helper = null (that's why the NPE).

I tried to access the BIRT source thru the CVS repository, but my co.'s
firewall won't let me connect.

Is there another way to get the source? (via email e.g. if not too large
or ftp perhaps; maybe even just a portion of the source related to this
area of the system)
Re: helper = null [message #120229 is a reply to message #120164] Mon, 30 January 2006 20:09 Go to previous messageGo to next message
Jun Zhai is currently offline Jun ZhaiFriend
Messages: 74
Registered: July 2009
Member
Code attached below.

synchronized private void initEngineInstance( ServletConfig servletConfig
)
{
System.setProperty( "RUN_UNDER_ECLIPSE", "false" ); //$NON-NLS-1$
//$NON-NLS-2$

if ( servletConfig == null )
{
return;
}

config = new EngineConfig( );

// Register new image handler
HTMLEmitterConfig emitterConfig = new HTMLEmitterConfig( );
emitterConfig.setActionHandler( new HTMLActionHandler( ) );
imageHandler = new HTMLServerImageHandler( );
emitterConfig.setImageHandler( imageHandler );
config.getEmitterConfigs( ).put( "html", emitterConfig );
//$NON-NLS-1$

// Prepare image directory.
imageDirectory = servletConfig.getServletContext( ).getInitParameter(
ParameterAccessor.INIT_PARAM_IMAGE_DIR );

if ( imageDirectory == null
|| imageDirectory.trim( ).length( ) <= 0
|| ParameterAccessor.isRelativePath( imageDirectory ) )
{
imageDirectory = servletConfig.getServletContext( ).getRealPath(
"/report/images" ); //$NON-NLS-1$
}

// Prepare image base url.
imageBaseUrl = "/run?__imageID="; //$NON-NLS-1$

// Prepare log directory.
String logDirectory = servletConfig.getServletContext(
).getInitParameter( ParameterAccessor.INIT_PARAM_LOG_DIR );

if ( logDirectory == null
|| logDirectory.trim( ).length( ) <= 0
|| ParameterAccessor.isRelativePath( logDirectory ) )
{
logDirectory = servletConfig.getServletContext( ).getRealPath( "/logs"
); //$NON-NLS-1$
}


// Prepare ScriptLib location
String scriptLibDir = servletConfig.getServletContext(
).getInitParameter( ParameterAccessor.INIT_PARAM_SCRIPTLIB_DIR );
if ( scriptLibDir == null ||
scriptLibDir.trim( ).length( ) <= 0 ||
ParameterAccessor.isRelativePath( scriptLibDir ) )
{
scriptLibDir = servletConfig.getServletContext( ).getRealPath(
"/scriptlib" ); //$NON-NLS-1$
}

ArrayList jarFileList = new ArrayList();
if ( scriptLibDir != null )
{
File dir = new File( scriptLibDir );
getAllJarFiles( dir, jarFileList );
}

String scriptlibClassPath = ""; //$NON-NLS-1$
for ( int i=0; i<jarFileList.size(); i++ )
scriptlibClassPath += ScriptExecutor.PROPERTYSEPARATOR +
((File)jarFileList.get(i)).getAbsolutePath();

if ( scriptlibClassPath.startsWith(ScriptExecutor.PROPERTYSEPARAT OR) )
scriptlibClassPath = scriptlibClassPath.substring(
ScriptExecutor.PROPERTYSEPARATOR.length() );

System.setProperty( ScriptExecutor.WEBAPP_CLASSPATH_KEY,
scriptlibClassPath );
}

This is currently used in viewer. You may want to trace your code and also
turn the engine log on to see whether there are error or not.

You can also double check current tomcat log. Exception may already be
logger there. Log dir is "workspace\.metadata\.plugins\org.eclipse.tomcat"
Re: helper = null [message #121739 is a reply to message #120229] Tue, 31 January 2006 16:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

How do I turn on the engine log? I don't see anything in Preferences and
I don't see a .properties file. I also don't find anything explaining
this on the BIRT site.

Thx, Mark
Re: helper = null [message #122164 is a reply to message #121739] Tue, 31 January 2006 23:21 Go to previous messageGo to next message
Jun Zhai is currently offline Jun ZhaiFriend
Messages: 74
Registered: July 2009
Member
Engine log is enabled from API by setting log dir and level in the config
object that passed over to the engine instance in init process like this.

config.setLogConfig( logDirectory, level );

Check engine api doc.
Re: helper = null [message #122433 is a reply to message #121739] Wed, 01 February 2006 06:28 Go to previous message
Eclipse UserFriend
Originally posted by: jan.tanis.coas.com

config.setLogConfig("C:\\cbirt\\logs\\", Level.OFF); this is to turn it
off, you will figure out how to turn it on;)

Regards, Jan.

Mark Lorenz wrote:
> How do I turn on the engine log? I don't see anything in Preferences
> and I don't see a .properties file. I also don't find anything
> explaining this on the BIRT site.
>
> Thx, Mark
>
Previous Topic:Engine log ??
Next Topic:OSGI error or something like it
Goto Forum:
  


Current Time: Sun Jun 30 19:31:02 GMT 2024

Powered by FUDForum. Page generated in 0.09877 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top