Home Analytics Developing analytics applications
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.

java.lang.NullPointerException


Hi,


 


I'm using scripted dataset in beforeOpen() method.



var query='';

if(params["cmbMedium"].value !== "ALL" ) {
query= " AND MEDIUM.MEDIUM_ID ='"+params["cmbMedium"].value+"'";
}

if(params["cmbUsers"].value[0] != "ALL" ) {
query= query+" AND SEC_USER.LOGIN_ID IN ('"+params["cmbUsers"].value.join("','")+"')";
}

if(params["cmbchannel"].value !== "ALL" ) {
query= query+" AND SESSION_SOURCE.CHANNEL_ID ='"+params["cmbchannel"].value+"'";
}

if(params["cmbOrgType"].value !== "ALL" ){
query= query+" AND ORG_UNIT.ORG_UNIT_ID ='"+params["cmbOrgType"].value+"'";
}
if(params["cmbOrgUnitType"].value !== "ALL" ){
query= query+" AND ORG_UNIT_TYPE.UNIT_TYPE_ID ='"+params["cmbOrgUnitType"].value+"'";
}

if (query=='') {
this.queryText = " SELECT TOP (100) PERCENT s.USER_ID + ' - ' + SEC_USER.FULL_NAME AS Distinct_Agents,s.SESSION_ID, COUNT(*) AS Call_Logged, SUM(DATEDIFF(mi, s.START_TIME, s.END_TIME))"+
" AS Duration_MIN, SUM(s.ACTIVITY_COUNT) AS Activities, 'Outcome' AS Outcome, s.INTERACT_OUTCOME_ID AS Channel_ID, 'StartTime' AS StartTime, "+
" 'EndTime' AS EndTime, 'USER_ID' AS UserID, SESSION_SOURCE.CHANNEL_ID AS ChannelCode, 'Channel' AS Channel, s.USER_ID AS agentId, s.END_TIME, s.START_TIME,"+
" 'Branch' AS OrgName, SUM(DATEDIFF(ss, s.START_TIME, s.END_TIME)) AS Duration_Sec, s.MEDIUM"+
" FROM dbo.SESSION_HISTORY AS s INNER JOIN"+
" dbo.SESSION_SOURCE ON s.CHANNEL_ID = SESSION_SOURCE.CHANNEL_ID INNER JOIN"+
" dbo.SEC_USER ON s.USER_ID = SEC_USER.LOGIN_ID LEFT OUTER JOIN "+
" MEDIUM ON s.MEDIUM = MEDIUM.MEDIUM_ID LEFT OUTER JOIN"+
" dbo.ORG_UNIT ON s.SESSION_ID = dbo.ORG_UNIT.ORG_UNIT_ID LEFT OUTER JOIN"+
" ORG_UNIT_TYPE ON s.SESSION_ID = ORG_UNIT_TYPE.UNIT_TYPE_ID"+
" WHERE s.CREATED_ON BETWEEN ( '"+params["txtFromDate"].value+" 00:00:01.000' ) AND ('"+params["txtToDate"].value+" 23:59:59.000') "+
" GROUP BY s.USER_ID, s.INTERACT_OUTCOME_ID, SEC_USER.FULL_NAME, s.ACTIVITY_COUNT, SESSION_SOURCE.CHANNEL_ID, s.END_TIME, s.START_TIME, s.SESSION_ID, s.MEDIUM"+
" ORDER BY agentId"

}else{
this.queryText = " SELECT TOP (100) PERCENT s.USER_ID + ' - ' + SEC_USER.FULL_NAME AS Distinct_Agents,s.SESSION_ID, COUNT(*) AS Call_Logged, SUM(DATEDIFF(mi, s.START_TIME, s.END_TIME))"+
" AS Duration_MIN, SUM(s.ACTIVITY_COUNT) AS Activities, 'Outcome' AS Outcome, s.INTERACT_OUTCOME_ID AS Channel_ID, 'StartTime' AS StartTime, "+
" 'EndTime' AS EndTime, 'USER_ID' AS UserID, SESSION_SOURCE.CHANNEL_ID AS ChannelCode, 'Channel' AS Channel, s.USER_ID AS agentId, s.END_TIME, s.START_TIME,"+
" 'Branch' AS OrgName, SUM(DATEDIFF(ss, s.START_TIME, s.END_TIME)) AS Duration_Sec, s.MEDIUM"+
" FROM dbo.SESSION_HISTORY AS s INNER JOIN"+
" dbo.SESSION_SOURCE ON s.CHANNEL_ID = SESSION_SOURCE.CHANNEL_ID INNER JOIN"+
" dbo.SEC_USER ON s.USER_ID = SEC_USER.LOGIN_ID LEFT OUTER JOIN "+
" MEDIUM ON s.MEDIUM = MEDIUM.MEDIUM_ID LEFT OUTER JOIN"+
" dbo.ORG_UNIT ON s.SESSION_ID = dbo.ORG_UNIT.ORG_UNIT_ID LEFT OUTER JOIN"+
" ORG_UNIT_TYPE ON s.SESSION_ID = ORG_UNIT_TYPE.UNIT_TYPE_ID"+
" WHERE s.CREATED_ON BETWEEN ( '"+params["txtFromDate"].value+" 00:00:01.000' ) AND ('"+params["txtToDate"].value+" 23:59:59.000') "+query+
" GROUP BY s.USER_ID, s.INTERACT_OUTCOME_ID, SEC_USER.FULL_NAME, s.ACTIVITY_COUNT, SESSION_SOURCE.CHANNEL_ID, s.END_TIME, s.START_TIME, s.SESSION_ID, s.MEDIUM"+
" ORDER BY agentId"

When I run report with selected parameters report runs fine but when I run report with 'ALL' parameters it gives following exception.  Earlier it was running fine without giving any exception. I changed nothing. But now its giving following error.


 


org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.


 



org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2375)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:281)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:89)
at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:159)
at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
at org.eclipse.birt.report.service.actionhandler.BirtChangeParameterActionHandler.runReport(BirtChangeParameterActionHandler.java:58)
at org.eclipse.birt.report.service.actionhandler.AbstractChangeParameterActionHandler.__execute(AbstractChangeParameterActionHandler.java:52)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleChangeParameter(BirtDocumentProcessor.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException


 


Regards,
Muhammad Waqas
Software Engineer
Avanza Solutions (Pvt.) Ltd.
Office # 14-B, Fakhri Trade Centre SR 6/10, Shahrah-e-Liaquat New Challi, Karachi-74200, Pakistan.
M   + 92 345 8928822
E    [email protected]
W   www.avanzasolutions.com

Comments

Sign In or Register to comment.