Home Analytics Designing reports
The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.

Birt upgrade 4.3 to 4.5 Error in BirtStr.trim function

We use BirtStr.trim function in all our reports and it is failing on 4.5 (Eclipse Mars).


Stack trace:


BirtStr.trim(fname+" "+lname)

org.mozilla.javascript.ConsString cannot be cast to java.lang.String

   at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1245)

   at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1224)

   at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:96)

   at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)



This code works fine in 4.3 version (luna eclipse)



When we change the code to use the BirtStr.concat function it works fine.

BirtStr.trim(BirtStr.concat(fname," ",lname))



Effort of making code changes are really high. 


Any recommendations ?





  • Issue 1:

    BirtStr - all functions


    BirtStr.trim(fname+" "+lname)



    org.mozilla.javascript.ConsString cannot be cast to java.lang.String


    Work around:

    BirtStr.trim(BirtStr.concat(fname," ",mname))





  • Hi,


    If you google the error message, you'll find out that with Rhino 1.7.4, now included in BIRT 4.5, Rhino has changed substantially how it handles Java to Javascript object conversion. I don't know of a workaround, except changing the way you concatenate strings.


    Hope this helps,



    Pierre Richer

    Solutions Consultant, Analytics & Reporting



Sign In or Register to comment.