Hi,

I tried to send a huge XML file as an attachment over JMS layer. Below is
my server code, receiving XML file,

public class JMSService {
 public String receiveMessage(String filename, DataHandler dh) {
  try {
   System.out.println("File received ....");
   System.out.println("File Name : " + filename);

   FileOutputStream fout = new FileOutputStream(new File
("D:\\apache\\jakarta-tomcat-4.0.6\\datafiles\\" + filename));

   System.out.println("Is DataHandler null : " + (dh == null));
   System.out.println("Is InputStream null : " + (dh.getInputStream() ==
null));

   BufferedInputStream bin = new BufferedInputStream(dh.getInputStream());

   while (bin.available() != 0) {
    fout.write(bin.read());
   }

  }
  catch (Throwable t) {
   t.printStackTrace();
  }
  return "Done...";
 }
}


I don't understand why the DataHandler object became null when the service
is called. I have no problem sending the XML file when I use the HTTP as
the transport mechanism.

Any idea ?

regards,
Beoh Seong



Reply via email to