Error when printing through server

Hello,

I have a preprocessor script in which I customize a loaded CSV file. The changes are applied correctly and I can generate all data fields with all records. When I try to output a design template via the server (PDF output) the following error appears. Output as proof print works fine.

Error:

LoggedApplicationException: There was an error running the content creation process caused by null

Preprocessor script:

var tmpFile = createTmpFile();
var originalFile = openTextReader(data.filename);
var modifiedFile = openTextWriter(tmpFile.getPath());

fieldSeparator = ",";

while((line = originalFile.readLine())!= null){
newFieldValue = "some value to add";
modifiedFile.write(line + fieldSeparator + newFieldValue + "\n");
}
modifiedFile.close();
originalFile.close();
deleteFile(data.filename);
tmpFile.move(data.filename);

Can anyone help me? I think it has something to do with the temporary generated file. If I write a file instead of the tmpFile and load that generated file in a new datamapper I can output through server.

Thanks
Thomas

I’m not really sure what would be causing this. It’s working fine on my end. Here’s what I’ve done:

  1. Create a new CSV based datamapper using test data. By default, all columns are extracted.
  2. Copy/Paste your preprocessor script into my datamapper without modifications
  3. Add Extraction for the new column generated by the script.
  4. Print to PDF (default Print Output), successful. The new column and several others are printed correctly on the page.

I also ran the datamapper through the workflow and output the results as XML to a folder. The process finished without issue and the extra field is represented in the XML.

Notes:

My Designer and Server are both on the same machine.

Everything is using the same account and it is a local Admin. I’m also logged into Windows as that account.

The proof print does not go through the Connect Server, it’s done locally by the Designer.

So there may be something preventing your service account from writing the temp file that is not blocking you when you’re running it as a proof print.

I have done the same. My Designer and Server are both on the same machine. Everything is using the same account and it is a local Admin. I’m also logged into Windows as that account. I tried to print through another Connect Server machine within the network and get the same error.

What I have done in detail:

  1. Create a new CSV based datamapper using test data. No columns are extracted automatically.
  2. Create a new preprocessor script and paste my script and I get all new columns in the CSV Viewer.
  3. Set boundaries on change based on a field (customer number).
  4. Extract base data.
  5. Add loop and extract detail data to create a detail table.
  6. Print to PDF (default Print Output), error.

The script posted is not the real script I’m using. In the real script I read data from loaded CSV, load data from a second (external) CSV file and combine both files based on one field and write it to a temp file and use that temp file as input data. In the datamapper everything’s fine and in the designer I can access all fields and records. Only at PDF output through the server I get an error.

If I save my combined data (loaded CSV plus external CSV) in a new external CSV file the external file will be filled correctly and if I use that new CSV file in another datamapper I don’t get an output error.

Note: I’ve tried it again on two machines (Connect Version 1.8 and Version 2018.1.1). With Version 2018.1.1 it works fine. With Version 1.8 I got an error (error message below). Without changes I tried it again with Version 1.8 (only click again on Print) and it worked as well without any problems. Now I’m confused…

Error Message:

Error creating copy of Data File “C:\PLANETPRESS\FUNKTIONSTESTS\MEHRERE_DATENQUELLEN\QUELLE1_KDNR.csv”. C:\Users\Thomas\Connect\filestore\inputdata.6187364500167156052.csv (DME000056).

java.lang.Exception: Error creating copy of Data File “C:\PLANETPRESS\FUNKTIONSTESTS\MEHRERE_DATENQUELLEN\QUELLE1_KDNR.csv”. C:\Users\Thomas\Connect\filestore\inputdata.6187364500167156052.csv (DME000056)

at com.objectiflune.datamining.DataMining.a(DataMining.java)

at com.objectiflune.datamining.DataMining.initialize(DataMining.java)

at com.objectiflune.datamining.ui.model.DataMiningModel.generateContext(DataMiningModel.java)

at com.objectiflune.application.designer.editors.TemplateEditor.doPrint(TemplateEditor.java)

at com.objectiflune.application.designer.perspective.internal.handlers.b.run(b.java)

at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)

at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)

at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)

at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at com.objectiflune.application.Application.start(Application.java)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)

at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Caused by: java.nio.file.AccessDeniedException: C:\Users\Thomas\Connect\filestore\inputdata.6187364500167156052.csv

at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)

at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)

at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)

at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)

at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)

at java.nio.file.Files.newOutputStream(Files.java:216)

at java.nio.file.Files.copy(Files.java:3016)

… 30 more

At this point you’re going to have to open a ticket with Support. It’s going to take more in depth troubleshooting to get to the bottom of this.

Ok, I will do that. Thank you for your help anyway.