You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Arno Hartmann <a....@teraport.de> on 2001/05/22 10:02:51 UTC

DataHandler NotSerializableException

When I use the javax.activation.DataHandler to transport 
files from server to client, I get the following Exception: 

Generated fault:
  Fault Code   = SOAP-ENV:Server
  Fault String = error unmarshalling return; nested exception is:
        java.io.WriteAbortedException: Writing aborted by exception;
java.io.NotSerializableException: javax.activation.DataHandler       


The Tomcat 3.2.1 says: 

In TemplateProvider.locate()
URI: urn:result-files-fetcher
DD.ServiceClass: org.apache.soap.providers.StatelessEJBProvider
DD.ProviderClass: FileSessionHome
Call.MethodName: downloadFilesForLogin
=============================================
In TemplateProvider.invoke()
Exception Caught upon method invocation attempt: null    

I use an EJB method to put the files in a ByteArrayDataSource object.
(see sample mime)
With this ByteArrayDataSource I create a DataHandler, put it in a Vector
and 
return this Vector. (same procedure as you can see in sample mime). 
Here is my code: (the EJB method):

while(resultSet.next()){
   jobId     =
String.valueOf(resultSet.getInt(EnapSqlStatements.FILE_JOBID));
   directory = resultSet.getString(EnapSqlStatements.FILE_DIRECTORY);
   fileName  = resultSet.getString(EnapSqlStatements.FILE_FILENAME);
   if(ftpHandler.fileExist(directory+"/"+fileName)){
      fileDataSource = new ByteArrayDataSource(new
java.io.File(directory+"/"+fileName), null);
      vector.addElement(new DataHandler(fileDataSource));
   }
}
return vector;

Can anybody tell me why the sample works and my code produce an
exception. 
The Tomcat output seems to me, that there would be a method called
implicit.
The first part is right. The second part appears after I have
implemented 
the Vector with DataHandler objects. 



Thanks 

Arno