Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » BIRT Engine and server doesn't respond
BIRT Engine and server doesn't respond [message #898723] Fri, 27 July 2012 07:01 Go to next message
Ricardo Rodrigues is currently offline Ricardo Rodrigues
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
I'm using BIRT Engine v3.2.1, running on Glassfish 3.1.2 (build 23).
I'm not using the BIRT Viewer, I'm getting birt's partial html response a injecting it is the page.
See below:

@RequestMapping(value = "/filter.htm")
public void filter(@RequestBody Filter filter, HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
Map parametersMap = reportUtils.getParametersMap(filter);

if(filter.getName() == null){
throw new ReportException("There is no Report Name provided to generate the report");
}

ServletContext sc = request.getSession().getServletContext();

this.birtReportEngine = BirtEngine.getBirtEngine(sc);
response.setContentType("text/html");

IReportRunnable design;


//Open report design
design = birtReportEngine.openReportDesign(sc.getRealPath("/reports") + "/" + filter.getName());
//create task to run and render report
IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask(design);
//the multi-select values to use. This just needs to be Object[].

task.setParameterValues(parametersMap);

task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, ReportController.class.getClassLoader());
task.getAppContext().put("BIRT_VIEWER_HTTPSERVLET_REQUEST", request);

//set output options
HTMLRenderOption options = new HTMLRenderOption();
options.setEmbeddable(true);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
//options.setUrlEncoding("UTF-8");
options.setOutputStream(response.getOutputStream());
options.setImageHandler(new HTMLServerImageHandler());

options.setBaseImageURL(request.getContextPath() + "/images");
options.setImageDirectory(sc.getRealPath("/images"));

task.setRenderOption(options);

//run report
task.run();

task.close();
} catch (Exception e) {
e.printStackTrace();
throw new Exception(e);
}
}


When I request the engine to render the report the server blocks and the client is stuck waiting for a response.
This only happens for a specific combination of parameters in a specific envirement or screen resolution, I'm not sure but I was always able to reproduce the problem in my machine and my collegue in other machine wasn't for the same combination of parameters, but he reproduce for other sequence that I couldn't.

There is no exception in the server.log and in the BIRT log with the level=ALL option I can only see that the engine doesn't close and exit like it does in normal executions.

Memory looks fine and SQL connection looks fine since I can see that BIRT executes the queries, parse the results and beforeClose event of the DataSet is always executed.

The bigger problem with this is that after this problem I have to restart the server to continue.

I was able to reproduce the problem using the Birt Designer. Using a specific combination of parameters I was always able to reproduce the problem. I started to remove some components of my report and I realized that the problem was in a pie chart.
I started to change some definitions in the pie and I realized that a specific rotation with a coverage of 100% on the pie, for that specific combination of parameters, was causing the problem.

Would be possible that BIRT crashes doing some dimension calculation?

I think it could be important to know that i'm sending the chart dimensions (width and height) through parameters, calculated based on the client screen dimensions, that is why I'm considering user screen resolution as the reason for working in one and not working in others.

So now, changing coverage and rotation is working fine, in all the tests that we did, but I don't know the specific cause of the problem so it could happen again.

Thank you
Re: BIRT Engine and server doesn't respond [message #899125 is a reply to message #898723] Mon, 30 July 2012 11:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ricardo,

I have not seen this problem, but could you post the design? What
output format for the chart are you using?

Jason

On 7/27/2012 7:01 AM, Ricardo Rodrigues wrote:
> I'm using BIRT Engine v3.2.1, running on Glassfish 3.1.2 (build 23).
> I'm not using the BIRT Viewer, I'm getting birt's partial html response
> a injecting it is the page. See below:
>
> @RequestMapping(value = "/filter.htm")
> public void filter(@RequestBody Filter filter, HttpServletRequest
> request, HttpServletResponse response) throws Exception {
> try {
> Map parametersMap = reportUtils.getParametersMap(filter);
> if(filter.getName() == null){
> throw new ReportException("There is no Report Name provided
> to generate the report");
> }
> ServletContext sc = request.getSession().getServletContext();
>
> this.birtReportEngine = BirtEngine.getBirtEngine(sc);
> response.setContentType("text/html");
>
> IReportRunnable design;
> //Open report design
> design =
> birtReportEngine.openReportDesign(sc.getRealPath("/reports") + "/" +
> filter.getName());
> //create task to run and render report
> IRunAndRenderTask task =
> birtReportEngine.createRunAndRenderTask(design);
> //the multi-select values to use. This just needs to be
> Object[].
> task.setParameterValues(parametersMap);
>
> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
> ReportController.class.getClassLoader());
> task.getAppContext().put("BIRT_VIEWER_HTTPSERVLET_REQUEST",
> request);
>
> //set output options
> HTMLRenderOption options = new HTMLRenderOption();
> options.setEmbeddable(true);
> options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
> //options.setUrlEncoding("UTF-8");
> options.setOutputStream(response.getOutputStream());
> options.setImageHandler(new HTMLServerImageHandler());
>
> options.setBaseImageURL(request.getContextPath() + "/images");
> options.setImageDirectory(sc.getRealPath("/images"));
> task.setRenderOption(options);
>
> //run report
> task.run();
> task.close();
> } catch (Exception e) {
> e.printStackTrace();
> throw new Exception(e);
> }
> }
>
>
> When I request the engine to render the report the server blocks and the
> client is stuck waiting for a response.
> This only happens for a specific combination of parameters in a specific
> envirement or screen resolution, I'm not sure but I was always able to
> reproduce the problem in my machine and my collegue in other machine
> wasn't for the same combination of parameters, but he reproduce for
> other sequence that I couldn't.
>
> There is no exception in the server.log and in the BIRT log with the
> level=ALL option I can only see that the engine doesn't close and exit
> like it does in normal executions.
>
> Memory looks fine and SQL connection looks fine since I can see that
> BIRT executes the queries, parse the results and beforeClose event of
> the DataSet is always executed.
>
> The bigger problem with this is that after this problem I have to
> restart the server to continue.
>
> I was able to reproduce the problem using the Birt Designer. Using a
> specific combination of parameters I was always able to reproduce the
> problem. I started to remove some components of my report and I realized
> that the problem was in a pie chart.
> I started to change some definitions in the pie and I realized that a
> specific rotation with a coverage of 100% on the pie, for that specific
> combination of parameters, was causing the problem.
>
> Would be possible that BIRT crashes doing some dimension calculation?
>
> I think it could be important to know that i'm sending the chart
> dimensions (width and height) through parameters, calculated based on
> the client screen dimensions, that is why I'm considering user screen
> resolution as the reason for working in one and not working in others.
>
> So now, changing coverage and rotation is working fine, in all the tests
> that we did, but I don't know the specific cause of the problem so it
> could happen again.
>
> Thank you


Jason Weathersby

BIRT Exchange
Re: BIRT Engine and server doesn't respond [message #899140 is a reply to message #899125] Mon, 30 July 2012 12:18 Go to previous messageGo to next message
Ricardo Rodrigues is currently offline Ricardo Rodrigues
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
Hi Jason,

We are now debugging the birt source and looks like birt gets into a infinite loop.

One of the slices in the pie chart has an loStart with an x value of -1.2175^E12 which is a very large -ve number.
This value gets passed into java2d's MaskFill class method FillAAPgram and appears to hang in here and never return.
See the screeshot attach.

The report is attach.

Note:
After my change from 100% to 90% chart coverage, the problem still couldn't be reproduced.

The problem only happens for a specific combination of parameters:
[userValue, dateTo, width, drillCatId, type, drillValData, dimension, title, xAxisTitle, height, level, drillCatData, role, dateFrom]
[-1, 7-30-2012, 1170pt, 114, pieGraph, Joseph_Van_2_M, student, Student Connected Report, Joseph_Van_2_M's Students, 275.25pt, student, Joseph_Van_2_M, ROLE_ADMIN, 08-01-2011]
Where here we think what really matters is the number os results returned from the query

Any help would be appreciated

Thank you
Re: BIRT Engine and server doesn't respond [message #899147 is a reply to message #899140] Mon, 30 July 2012 12:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ricardo,

If you remove the chart scripts do you get this error. It looks like
something is wrong with the loStart location as you have seen. I would
like to figure out if the plot calc engine has a bug.

Jason

On 7/30/2012 12:18 PM, Ricardo Rodrigues wrote:
> Hi Jason,
>
> We are now debugging the birt source and looks like birt gets into a infinite loop.
>
> One of the slices in the pie chart has an loStart with an x value of -1.2175^E12 which is a very large -ve number.
> This value gets passed into java2d's MaskFill class method FillAAPgram and appears to hang in here and never return.
> See the screeshot attach.
>
> The report is attach.
>
> Note:
> After my change from 100% to 90% chart coverage, the problem still couldn't be reproduced.
>
> The problem only happens for a specific combination of parameters:
> [userValue, dateTo, width, drillCatId, type, drillValData, dimension, title, xAxisTitle, height, level, drillCatData, role, dateFrom]
> [-1, 7-30-2012, 1170pt, 114, pieGraph, Joseph_Van_2_M, student, Student Connected Report, Joseph_Van_2_M's Students, 275.25pt, student, Joseph_Van_2_M, ROLE_ADMIN, 08-01-2011]
> Where here we think what really matters is the number os results returned from the query
>
> Any help would be appreciated
>
> Thank you
>


Jason Weathersby

BIRT Exchange
Re: BIRT Engine and server doesn't respond [message #899151 is a reply to message #899147] Mon, 30 July 2012 12:49 Go to previous messageGo to next message
Ricardo Rodrigues is currently offline Ricardo Rodrigues
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
Hi Jason,

I removed the scripts from the line, bar and pie charts and I got the same error for the same combination of parameters.

We are finding hard to understand how that loStart is calculated and how it is related with the coverage of the pie

Thank you
Re: BIRT Engine and server doesn't respond [message #899154 is a reply to message #899151] Mon, 30 July 2012 12:59 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This should be getting set in the updateSlices function.

Jason

On 7/30/2012 12:49 PM, Ricardo Rodrigues wrote:
> Hi Jason,
>
> I removed the scripts from the line, bar and pie charts and I got the
> same error for the same combination of parameters.
>
> We are finding hard to understand how that loStart is calculated and how
> it is related with the coverage of the pie
>
> Thank you


Jason Weathersby

BIRT Exchange
Re: BIRT Engine and server doesn't respond [message #899264 is a reply to message #899154] Tue, 31 July 2012 05:14 Go to previous messageGo to next message
Ricardo Rodrigues is currently offline Ricardo Rodrigues
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
Jason,

Debugging addSliceLabel()
I see the getXStartClosestToPie() method uses a number from label_list.get(0).getXStartClosestToPie( y );
Now this first element in the list is a SliceLabel with a dRampRate of -1.4^11.
The angle by sheer bad luck was 90.0000000000040001 degrees
The tan of 90 is infinity and we are close to this number.
See screenshot attach.

I replicated this bug with BIRT 4.2.
We need to garantie that this won't happen again and specially that Birt doesn't get in a loop and breaks the server.

Can you garantie that if we define the coverage to auto, or a specific value for the rotation, or anything else, this won't happen again?
Or could you guys create a quick fix for this? ... even throwing an exception avoiding the loop would be enough for us.

Our Suggested Solution:

private void computeRampRate( )
{
double angle = slice.getdMidAngle( ) % 360;
if(angle%90 < TAN_INFINITY_THRESHOLD || angle%90 <
TAN_INFINITY_THRESHOLD) {
angle = angle - 1; //subtract 1 degree if close to 90 or
270 as this will result in a very very large number like 1.4^12
}
dRampRate = Math.tan( Math.toRadians( angle ) );

if (angle>180 && angle < 360)
{
bUp = false;
}
}

Thank you
  • Attachment: tanOf90.png
    (Size: 206.17KB, Downloaded 58 times)
Re: BIRT Engine and server doesn't respond [message #899376 is a reply to message #899264] Tue, 31 July 2012 11:38 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ricardo,

You probably need to log a bugzilla for this. Even if auto fixes the
issue, the chart engine should not allow this to happen, Do you have an
example report that we can run that shows the issue?

Jason


On 7/31/2012 5:14 AM, Ricardo Rodrigues wrote:
> Jason,
>
> Debugging addSliceLabel()
> I see the getXStartClosestToPie() method uses a number from label_list.get(0).getXStartClosestToPie( y );
> Now this first element in the list is a SliceLabel with a dRampRate of -1.4^11.
> The angle by sheer bad luck was 90.0000000000040001 degrees
> The tan of 90 is infinity and we are close to this number.
> See screenshot attach.
>
> I replicated this bug with BIRT 4.2.
> We need to garantie that this won't happen again and specially that Birt doesn't get in a loop and breaks the server.
>
> Can you garantie that if we define the coverage to auto, or a specific value for the rotation, or anything else, this won't happen again?
> Or could you guys create a quick fix for this? ... even throwing an exception avoiding the loop would be enough for us.
>
> Our Suggested Solution:
>
> private void computeRampRate( )
> {
> double angle = slice.getdMidAngle( ) % 360;
> if(angle%90 < TAN_INFINITY_THRESHOLD || angle%90 <
> TAN_INFINITY_THRESHOLD) {
> angle = angle - 1; //subtract 1 degree if close to 90 or
> 270 as this will result in a very very large number like 1.4^12
> }
> dRampRate = Math.tan( Math.toRadians( angle ) );
>
> if (angle>180 && angle < 360)
> {
> bUp = false;
> }
> }
>
> Thank you
>


Jason Weathersby

BIRT Exchange
Re: BIRT Engine and server doesn't respond [message #899623 is a reply to message #899376] Wed, 01 August 2012 11:41 Go to previous messageGo to next message
Ricardo Rodrigues is currently offline Ricardo Rodrigues
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
Hi Jason,

I reported the bug here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386399
Re: BIRT Engine and server doesn't respond [message #899638 is a reply to message #899623] Wed, 01 August 2012 11:59 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ricardo,

Thanks for posting this.

Jason

On 8/1/2012 11:41 AM, Ricardo Rodrigues wrote:
> Hi Jason,
>
> I reported the bug here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=386399


Jason Weathersby

BIRT Exchange
Previous Topic:JDBC: Executing a statement with no results
Next Topic:My report is PAGE BROKEN on SOME pages although I didn't use PAGE BREAK
Goto Forum:
  


Current Time: Sun Apr 20 19:34:48 EDT 2014

Powered by FUDForum. Page generated in 0.02121 seconds