Support Article
sendFile fails with ServiceExport (Is a directory) error
Summary
The activity calling API to sendFile with aPersistFileToServiceExport set to true sporadically fails with an error.
public String sendFile(byte[] aFileData, String aFileName,
boolean aPersistFileToServiceExport, StringMap aHttpHeaders,
boolean aSendForDownload)
Error Messages
/usr/local/tomcat/work/Catalina/localhost/prweb/StaticContent/global/ServiceExport (Is a directory)
at java.io.FileOutputStream.open0(Native:Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:162)
at com.pega.pegarules.storage.fs.direct.FilesystemStorage._getOutputStream_privact(FilesystemStorage.java:363)
at com.pega.pegarules.storage.fs.direct.FilesystemStorage.getOutputStream(FilesystemStorage.java:336)
at com.pega.pegarules.storage.FileStorageManager.getOutputStream(FileStorageManager.java:549)
at com.pega.pegarules.storage.FileStorageUtilsImpl.getOutputStream(FileStorageUtilsImpl.java:128)
at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown:Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.pega.pegarules.pub.util.PROutputStream.getOutputStream(PROutputStream.java:130)
at com.pega.pegarules.pub.util.PROutputStream.(PROutputStream.java:118)
at com.pega.pegarules.pub.util.PROutputStream.(PROutputStream.java:102)
at com.pega.pegarules.session.internal.mgmt.Executable.sendFile(Executable.java:8582)
Steps to Reproduce
Add an activity call sendFile method.
Root Cause
An issue in the custom application code or rules.
When the aFileName parameter was set to an empty string, the call to sendFile displayed an error.
Resolution
Perform the following local-change:
Add a check before invoking the sendFile to ensure that the aFileName is set to a valid filename.
Published February 10, 2020 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.