Since we installed a new snapshot, DataExport is consistently ending in error with a null pointer exception. This code was working fine before that.
The newly installed snapshot:
Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v8.3d_2012-07-21/PowerEdition Deployment 2012-07-21)
The errror:
The code (everything is server side):
More of the log:
Thanks.
The newly installed snapshot:
Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v8.3d_2012-07-21/PowerEdition Deployment 2012-07-21)
The errror:
Code:
java.lang.NullPointerException at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:488) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:384) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:377) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:355) at com.islandpacific.gui.server.purchasing.productionorder.LCExportJob.exportEntries(LCExportJob.java:195) 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 com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:95) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) java.lang.reflect.InvocationTargetException 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 com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:95) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: org.quartz.JobExecutionException: Error writing to /SmartRetail/Export/LetterOfCredit.csv. at com.islandpacific.gui.server.purchasing.productionorder.LCExportJob.exportEntries(LCExportJob.java:202) ... 7 more
Code:
DSRequest lcSummaryRequest = null; Map criteria = null; DSResponse productionOrderResponse = null; lcSummaryRequest = new DSRequest(IslandPacificDSConstants.DATASOURCE_LCSummary, DataSource.OP_FETCH); lcSummaryRequest.setOperationId(LCSummary.OP_FETCH_LC_EXPORT); criteria = new HashMap(); criteria.put(FIELD_exportJob, getJobName()); criteria.put(FIELD_userName, getUserName()); lcSummaryRequest.setCriteria(criteria); try { productionOrderResponse = lcSummaryRequest.execute(); if (productionOrderResponse.statusIsError()) { throw new JobExecutionException("Error exporting Letter of Credit"); } } catch (Exception e) { e.printStackTrace(); throw new JobExecutionException("Error exporting Letter of Credit."); } Writer writer = null; try { writer = new FileWriter(new File(getExportFilePath())); } catch (IOException e1) { e1.printStackTrace(); throw new JobExecutionException("Error creating file object for " + getExportFilePath() + "."); } List exportFields = new ArrayList(); exportFields.add(LCSummary.REQUESTOR); exportFields.add(LCSummary.EXPORT_DATE); . . . exportFields.add(LCSummary.EXPIRY_DATE); DataExport exporter = new DataExport(DataExport.CSV); try { if (productionOrderResponse.getDataList().size() > 0) { log.info("Exporting to file: " + getExportFilePath()); List dataList = DataTools.makeListIfSingle(productionOrderResponse.getData()); exporter.exportResultSet(dataList, exportFields, writer); } else { log.info("Nothing to export."); } } catch (Exception e) { e.printStackTrace(); throw new JobExecutionException("Error writing to " + getExportFilePath() + "."); }
Code:
=== 2012-07-29 22:20:01,430 [er-2] DEBUG IpJobListener - Job starting: LCExportJob-61669 === 2012-07-29 22:20:01,435 [er-2] INFO SQLDataSource - [builtinApplication.null] Performing fetch operation with criteria: {name:"iptsfili"} values: {name:"iptsfili"} === 2012-07-29 22:20:01,436 [er-2] INFO SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause === 2012-07-29 22:20:01,436 [er-2] INFO SQLDataSource - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT environment.applicationId, environment.dbase, environment.description, environment.id, environment.name FROM environment WHERE (environment.name='iptsfili') === 2012-07-29 22:20:01,436 [er-2] INFO SQLDriver - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT environment.applicationId, environment.dbase, environment.description, environment.id, environment.name FROM environment WHERE (environment.name='iptsfili') === 2012-07-29 22:20:01,786 [er-2] INFO DSResponse - [builtinApplication.null] DSResponse: List with 1 items === 2012-07-29 22:20:01,792 [er-2] INFO SQLDataSource - [builtinApplication.null] Performing fetch operation with criteria: {code:"LGORLIN"} values: {code:"LGORLIN"} === 2012-07-29 22:20:01,792 [er-2] INFO SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause === 2012-07-29 22:20:01,792 [er-2] INFO SQLDataSource - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT ipuser.code, ipuser.email, ipuser.id, ipuser.name FROM ipuser WHERE (ipuser.code='LGORLIN') === 2012-07-29 22:20:01,793 [er-2] INFO SQLDriver - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT ipuser.code, ipuser.email, ipuser.id, ipuser.name FROM ipuser WHERE (ipuser.code='LGORLIN') === 2012-07-29 22:20:02,120 [er-2] INFO DSResponse - [builtinApplication.null] DSResponse: List with 1 items === 2012-07-29 22:20:02,125 [er-2] INFO SQLDataSource - [builtinApplication.null] Performing fetch operation with criteria: {userId:11,environmentId:2} values: {userId:11,environmentId:2} === 2012-07-29 22:20:02,125 [er-2] INFO SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause === 2012-07-29 22:20:02,126 [er-2] INFO SQLDataSource - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT userrole.environmentId, userrole.id, userrole.roleId, userrole.userId FROM userrole WHERE (userrole.userId='11' AND userrole.environmentId='2') === 2012-07-29 22:20:02,126 [er-2] INFO SQLDriver - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT userrole.environmentId, userrole.id, userrole.roleId, userrole.userId FROM userrole WHERE (userrole.userId='11' AND userrole.environmentId='2') === 2012-07-29 22:20:02,459 [er-2] INFO DSResponse - [builtinApplication.null] DSResponse: List with 0 items <?xml version="1.0" encoding="UTF-8"?><LogEntry><LogDefinition>ipms</LogDefinition><SystemName>SmartRetail</SystemName><ApplicationName>SmartRetail</ApplicationName><Procedure>LCExportJob</Procedure><ApplicationUserID>LGORLIN</ApplicationUserID><SystemUserID>iptsfili</SystemUserID><Priority>INFO</Priority><Message>Job LCExportJob-61669 started.</Message></LogEntry> === 2012-07-29 22:20:02,465 [er-2] INFO SQLDataSource - [builtinApplication.null] Performing fetch operation with criteria: {SchedName:"IPScheduler",JobGroup:"LCExportJob",JobName:"LCExportJob-61669"} values: {SchedName:"IPScheduler",JobGroup:"LCExportJob",JobName:"LCExportJob-61669"} === 2012-07-29 22:20:02,465 [er-2] INFO SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause === 2012-07-29 22:20:02,466 [er-2] INFO SQLDataSource - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT JobStatus.ExecutionStep, JobStatus.JobGroup, JobStatus.JobName, JobStatus.JobNumber, JobStatus.SchedName FROM JobStatus WHERE (JobStatus.SchedName='IPScheduler' AND JobStatus.JobGroup='LCExportJob' AND JobStatus.JobName='LCExportJob-61669') === 2012-07-29 22:20:02,466 [er-2] INFO SQLDriver - [builtinApplication.null] Executing SQL query on 'ipGui': SELECT JobStatus.ExecutionStep, JobStatus.JobGroup, JobStatus.JobName, JobStatus.JobNumber, JobStatus.SchedName FROM JobStatus WHERE (JobStatus.SchedName='IPScheduler' AND JobStatus.JobGroup='LCExportJob' AND JobStatus.JobName='LCExportJob-61669') === 2012-07-29 22:20:02,770 [er-2] INFO DSResponse - [builtinApplication.null] DSResponse: List with 1 items === 2012-07-29 22:20:02,775 [er-2] INFO SQLDataSource - [builtinApplication.null] Performing update operation with criteria: {SchedName:"IPScheduler",JobGroup:"LCExportJob",JobName:"LCExportJob-61669"} values: {ExecutionStep:"exportEntries"} === 2012-07-29 22:20:02,776 [er-2] WARN SQLDriver - [builtinApplication.null] DSRequest has no RPCManager set when testing if we should join a transaction - transaction will not be joined === 2012-07-29 22:20:02,776 [er-2] INFO SQLDriver - [builtinApplication.null] Executing SQL update on 'ipGui': UPDATE JobStatus SET ExecutionStep='exportEntries' WHERE (JobStatus.SchedName='IPScheduler' AND JobStatus.JobGroup='LCExportJob' AND JobStatus.JobName='LCExportJob-61669') === 2012-07-29 22:20:03,031 [er-2] INFO SQLDataSource - [builtinApplication.null] primaryKeys: {SchedName=IPScheduler, JobGroup=LCExportJob, JobName=LCExportJob-61669} === 2012-07-29 22:20:03,032 [er-2] INFO SQLDataSource - [builtinApplication.null, builtinApplication.null] Performing fetch operation with criteria: {SchedName:"IPScheduler",JobGroup:"LCExportJob",JobName:"LCExportJob-61669"} values: {SchedName:"IPScheduler",JobGroup:"LCExportJob",JobName:"LCExportJob-61669"} === 2012-07-29 22:20:03,032 [er-2] INFO SQLDataSource - [builtinApplication.null, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause === 2012-07-29 22:20:03,033 [er-2] INFO SQLDataSource - [builtinApplication.null, builtinApplication.null] Executing SQL query on 'ipGui': SELECT JobStatus.ExecutionStep, JobStatus.JobGroup, JobStatus.JobName, JobStatus.JobNumber, JobStatus.SchedName FROM JobStatus WHERE (JobStatus.SchedName='IPScheduler' AND JobStatus.JobGroup='LCExportJob' AND JobStatus.JobName='LCExportJob-61669') === 2012-07-29 22:20:03,033 [er-2] INFO SQLDriver - [builtinApplication.null, builtinApplication.null] Executing SQL query on 'ipGui': SELECT JobStatus.ExecutionStep, JobStatus.JobGroup, JobStatus.JobName, JobStatus.JobNumber, JobStatus.SchedName FROM JobStatus WHERE (JobStatus.SchedName='IPScheduler' AND JobStatus.JobGroup='LCExportJob' AND JobStatus.JobName='LCExportJob-61669') === 2012-07-29 22:20:03,319 [er-2] INFO DSResponse - [builtinApplication.null, builtinApplication.null] DSResponse: List with 1 items === 2012-07-29 22:20:03,320 [er-2] INFO DSResponse - [builtinApplication.null] DSResponse: List with 1 items === 2012-07-29 22:20:03,320 [er-2] DEBUG LCExportJob - Exporting letter of credit. === 2012-07-29 22:20:03,325 [er-2] INFO SQLDataSource - [builtinApplication.LCExport] Performing fetch operation with criteria: {userName:"LGORLIN",exportJob:"LCExportJob-61669"} values: {userName:"LGORLIN",exportJob:"LCExportJob-61669"} === 2012-07-29 22:20:03,327 [er-2] INFO SQLDataSource - [builtinApplication.LCExport] Executing SQL query on 'iptsfili': select buyerId as "requestor", CURRENT_DATE as "exportDate", vnam as "supplierName", vad1 as "supplierAddr1", vad2 as "supplierAddr2", vcty as "supplierCity", vsta as "supplierState", vzip as "supplierPostCode", vcnt as "supplierCountry", bankName as "bankName", bankAddr1 as "bankAddr1", bankAddr2 as "bankAddr2", bankCity as "bankCity", bankState as "bankState", bankPost as "bankPostCode", bankCntry as "bankCountry", bicNumber as "bicNumber", ShippingPort.name as "exitPort", IPSTORE.SNAM as "entryPort", ProductionLine.descr as "descriptionOfGoods", ProductionLine.itemStyle as "styleNumber", handDt - 5 DAYS as "shippingWindowFrom", handDt + 5 DAYS as "shippingWindowTo", ProductionDestination.controlNum as "orderNumber", ProductionDestination.unitsOrd as "quantity", ProductionDelivery.vendorCost as "unitCost", ProductionOrder.currency as "currency", handDt + 12 DAYS as "expiryDate" from ProductionOrder join IPMRVEN on vendorId=VVEN join ProductionLine on ProductionOrder.id=ProductionLine.parentId join ProductionDelivery on ProductionLine.id=ProductionDelivery.parentId join ShippingPort on ProductionDelivery.shipPort=ShippingPort.id join ProductionDestination on ProductionDelivery.id=ProductionDestination.parentId join IPSTORE on ProductionDestination.shipTo=IPSTORE.SSTR WHERE exportJob='LCExportJob-61669' === 2012-07-29 22:20:03,327 [er-2] INFO SQLDriver - [builtinApplication.LCExport] Executing SQL query on 'iptsfili': select buyerId as "requestor", CURRENT_DATE as "exportDate", vnam as "supplierName", vad1 as "supplierAddr1", vad2 as "supplierAddr2", vcty as "supplierCity", vsta as "supplierState", vzip as "supplierPostCode", vcnt as "supplierCountry", bankName as "bankName", bankAddr1 as "bankAddr1", bankAddr2 as "bankAddr2", bankCity as "bankCity", bankState as "bankState", bankPost as "bankPostCode", bankCntry as "bankCountry", bicNumber as "bicNumber", ShippingPort.name as "exitPort", IPSTORE.SNAM as "entryPort", ProductionLine.descr as "descriptionOfGoods", ProductionLine.itemStyle as "styleNumber", handDt - 5 DAYS as "shippingWindowFrom", handDt + 5 DAYS as "shippingWindowTo", ProductionDestination.controlNum as "orderNumber", ProductionDestination.unitsOrd as "quantity", ProductionDelivery.vendorCost as "unitCost", ProductionOrder.currency as "currency", handDt + 12 DAYS as "expiryDate" from ProductionOrder join IPMRVEN on vendorId=VVEN join ProductionLine on ProductionOrder.id=ProductionLine.parentId join ProductionDelivery on ProductionLine.id=ProductionDelivery.parentId join ShippingPort on ProductionDelivery.shipPort=ShippingPort.id join ProductionDestination on ProductionDelivery.id=ProductionDestination.parentId join IPSTORE on ProductionDestination.shipTo=IPSTORE.SSTR WHERE exportJob='LCExportJob-61669' === 2012-07-29 22:20:04,093 [er-2] INFO DSResponse - [builtinApplication.LCExport] DSResponse: List with 18 items === 2012-07-29 22:20:04,094 [er-2] INFO LCExportJob - Exporting to file: /SmartRetail/Export/LetterOfCredit.csv java.lang.NullPointerException at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:488) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:384) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:377) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:355) at com.islandpacific.gui.server.purchasing.productionorder.LCExportJob.exportEntries(LCExportJob.java:195) 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 com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:95) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) java.lang.reflect.InvocationTargetException 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 com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:95) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: org.quartz.JobExecutionException: Error writing to /SmartRetail/Export/LetterOfCredit.csv. at com.islandpacific.gui.server.purchasing.productionorder.LCExportJob.exportEntries(LCExportJob.java:202) ... 7 more <?xml version="1.0" encoding="UTF-8"?><LogEntry><LogDefinition>ipms</LogDefinition><SystemName>SmartRetail</SystemName><ApplicationName>SmartRetail</ApplicationName><Procedure>LCExportJob</Procedure><ApplicationUserID>LGORLIN</ApplicationUserID><SystemUserID>iptsfili</SystemUserID><Priority>FATAL</Priority><Message>Job LCExportJob-61669 ended in error. Error at execution step exportEntries Error writing to /SmartRetail/Export/LetterOfCredit.csv.</Message></LogEntry> org.quartz.JobExecutionException: Error at execution step exportEntries Error writing to /SmartRetail/Export/LetterOfCredit.csv. at com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:101) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) === 2012-07-29 22:20:04,099 [er-2] INFO JobRunShell - Job LCExportJob.LCExportJob-61669 threw a JobExecutionException: org.quartz.JobExecutionException: org.quartz.JobExecutionException: Error at execution step exportEntries Error writing to /SmartRetail/Export/LetterOfCredit.csv. [See nested exception: org.quartz.JobExecutionException: Error at execution step exportEntries Error writing to /SmartRetail/Export/LetterOfCredit.csv.] at com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:124) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: org.quartz.JobExecutionException: Error at execution step exportEntries Error writing to /SmartRetail/Export/LetterOfCredit.csv. at com.islandpacific.gui.server.job.IpJobAbs.execute(IpJobAbs.java:101) ... 2 more === 2012-07-29 22:20:04,099 [er-2] INFO IpJobListener - Job LCExportJob-61669 ended in error: org.quartz.JobExecutionException: Error at execution step exportEntries Error writing to /SmartRetail/Export/LetterOfCredit.csv.
Thanks.
Comment