2 Replies Latest reply on Dec 17, 2004 10:28 AM by peter neville

    jboss-saaj attachmentpart problem

    peter neville Newbie

      Hi,
      I'm using jboss 4.0.0. and am having problems with attachments when using saaj. The only success I have is if I attach using MIME type text/plain and set content to a String.
      If I try to set MIME type to application/xml or text/xml and set content to be JDOMSource then I get IllegalArgument exception:



      If I try to set MIME type to application/xml or text/xml and set content to javax.xml.transform.stream.StreamSource then I get null pointer exception :

      13:40:03,032 ERROR [EBXMLTransportActivatorBean] java.lang.NullPointerException
      13:40:03,032 INFO [STDOUT] java.lang.NullPointerException
      13:40:03,042 INFO [STDOUT] at org.apache.axis.attachments.ManagedMemoryData
      Source.<init>(ManagedMemoryDataSource.java:202)
      13:40:03,042 INFO [STDOUT] at org.apache.axis.attachments.AttachmentPartImp
      l.setContent(AttachmentPartImpl.java:491)

      13:47:57,683 ERROR [EBXMLTransportActivatorBean] java.lang.IllegalArgumentExcep
      ion: Cannot content type 'text/xml' for: org.jdom.transform.JDOMSource@2fe64a
      13:47:57,723 INFO [STDOUT] java.lang.IllegalArgumentException: Cannot content
      ype 'text/xml' for: org.jdom.transform.JDOMSource@2fe64a
      13:47:57,763 INFO [STDOUT] at org.apache.axis.attachments.AttachmentPartIm
      l.setContent(AttachmentPartImpl.java:486)



      I would gratefully appreciate it if someone has some experience to offer on adding a StreamSource as an attachment with jboss-saaj.

      Thanks.