Disposition=null
Hi All,
I am trying to read a email with few lines of text and attachment.
When I try to read the email, I observed contenttype in header is Multipart/mixed.
I could find 2 parts
1. disposition=null and content-Type=plain/text
2. disposition=null and content-Type=application/ms-tnef,Content-Transfer-Encoding: base64
When I forward this email as it is, only text is passed. the attachment is lost.
Anyone know what the problem could be?
Thanks in advance
S
I am trying to read a email sent using Microsoft Outlook ( Rich Text Format selected ).
Few lines of code added
public static void getMultipart(Multipart multipart)
throws MessagingException, IOException
for (int i=0, n=multipart.getCount(); i<n; i++)
getPart(multipart.getBodyPart(i));
public static void getPart(Part part)
throws MessagingException, IOException
String disposition = part.getDisposition();
String contentType = part.getContentType();
if (disposition == null)
{ // When just body
I get disposition = null. Any ideas??
Thanks in advance
S
Similar Messages
-
Reading attachment: diposition NULL
Hi,
I am trying to read attachment using javamail but when I use getDisposition function, I always get NULL disposition value,even for attachment.Please help me.This is the code I am using.
import java.io.*;
import javax.swing.*;
import java.util.*;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import java.sql.*;
public class try_attachment{
public static void main(String args[])throws Exception
String host = "host";
String username = "username";
String password = "password";
Properties Prop = new Properties();
Session session = Session.getInstance(Prop,null);
Store store = session.getStore("imap");
store.connect(host,username,password);
// open Inbox
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);
// get Directory
Message msg[] = folder.getMessages();
for (int i=0;i<msg.length;i++)
Object content = msg.getContent();
if(content instanceof Multipart)
handleMultipart(( Multipart)content);
else
handlePart(msg[i]);
folder.close(false);
store.close();
public static void handleMultipart( Multipart multipart)
throws MessagingException, IOException
for(int i=0;i<multipart.getCount();i++)
handlePart(multipart.getBodyPart(i));
public static void handlePart(Part part)throws MessagingException,IOException
String disposition = part.getDisposition();
String contentType = part.getContentType();
// trying to read disposition value
System.out.println("Hello "+ disposition);
try{ if (disposition == null)
System.out.println("Null: " +contentType);
//checkif plain
// if ((contentType.length()>=10)&& (contentType.toLowerCase().substring(0,10).equals("text/plain")))
// part.writeTo(System.out);
else if(disposition.equalsIgnoreCase(Part.ATTACHMENT))
System.out.println("Attachment:" + part.getFileName() + ":" + contentType);
saveFile(part.getFileName(),part.getInputStream());
else if(disposition.equalsIgnoreCase(Part.INLINE))
System.out.println("Inline :"+ part.getFileName()+":" + contentType);
saveFile(part.getFileName(),part.getInputStream());
else
System.out.println("Other");
catch(Exception e)
{ System.out.println(e);}
public static void saveFile(String filename, InputStream input) throws IOException
if (filename == null)
filename = File.createTempFile("testmail",".out").getName();
//do not overwrite
File file = new File(filename);
for(int i=0;file.exists();i++)
file = new File(filename+i);
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
BufferedInputStream bis = new BufferedInputStream(input);
int aByte;
while ((aByte = bis.read())!= -1)
bos.write(aByte);
bos.flush();
bos.close();
bis.close();Hello Mark,
1. My Soap Sender Adapter, I checked the Keep Attachment option
2. I am getting the WSDL file from the SOAP Sender Agreement.. it is like http(s)://host:port/XISOAPAdapter/MessageServlet?channel=p:s:c? as you said.
I used the user-defined function, it works when <inc:Include href="cid:test.jpg" xmlns:inc="http://www.w3.org/2004/08/xop/include" /> is deleted in the message.
If the coming message includes <inc:Include href="cid:test.jpg" xmlns:inc="http://www.w3.org/2004/08/xop/include" />,
the <null> error occurs.
Thanx for your reply.. -
XML Publisher Patch 9501440 EBS 11i
Hello
Is there any body faced any problem when apply XML Publisher Patch 9501440?
Bursting Program does not find File...
Oracle XML Publisher Template Builder for Word
Version 5.6 Build 45
Oracle RDBMS : 10.2.0.4.0
Oracle Applications : 11.5.10.2
Concurrent Program: XML Publisher Report Bursting Program
Concurrent Short Name:XDOBURSTREP
Executable: XDOBURSTRPT
*************LOG FILE Messages START ****************************
XDOBURSTREP module: XML Publisher Report Bursting Program
Current system time is 08-NOV-2010 17:02:08
1.007: [GC 1.007: [DefNew: 1792K->191K(1984K), 0.0192655 secs] 1792K->243K(6080K), 0.0195205 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
1.787: [GC 1.788: [DefNew: 1983K->45K(1984K), 0.0277442 secs] 2035K->283K(6080K), 0.0279352 secs] [Times: user=0.03 sys=0.00, real=0.03 secs]
2.562: [GC 2.562: [DefNew: 1837K->192K(1984K), 0.0253611 secs] 2075K->597K(6080K), 0.0255568 secs] [Times: user=0.02 sys=0.00, real=0.03 secs]
3.462: [GC 3.462: [DefNew: 1984K->130K(1984K), 0.0209697 secs] 2389K->713K(6080K), 0.0211647 secs] [Times: user=0.01 sys=0.00, real=0.02 secs]
4.266: [GC 4.266: [DefNew: 1922K->97K(1984K), 0.0168747 secs] 2505K->809K(6080K), 0.0170602 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5.123: [GC 5.123: [DefNew: 1889K->192K(1984K), 0.0284309 secs] 2601K->1253K(6080K), 0.0286286 secs] [Times: user=0.02 sys=0.00, real=0.03 secs]
5.909: [GC 5.909: [DefNew: 1957K->192K(1984K), 0.0116465 secs] 3018K->1567K(6080K), 0.0118526 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5.943: [GC 5.944: [DefNew: 1973K->162K(1984K), 0.0029086 secs] 3349K->1664K(6080K), 0.0030941 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
5.970: [GC 5.970: [DefNew: 1951K->1K(1984K), 0.0025240 secs] 3452K->1504K(6080K), 0.0027056 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
5.993: [GC 5.993: [DefNew: 1781K->35K(1984K), 0.0020896 secs] 3284K->1537K(6080K), 0.0022733 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
6.651: [GC 6.651: [DefNew: 1827K->119K(1984K), 0.0065788 secs] 3329K->1622K(6080K), 0.0067660 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
6.843: [GC 6.843: [DefNew: 1911K->54K(1984K), 0.0077538 secs] 3414K->1670K(6080K), 0.0079373 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
7.056: [GC 7.057: [DefNew: 1846K->99K(1984K), 0.0033575 secs] 3462K->1715K(6080K), 0.0035395 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
7.228: [GC 7.229: [DefNew: 1891K->82K(1984K), 0.0054213 secs] 3507K->1750K(6080K), 0.0056144 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
7.351: [GC 7.351: [DefNew: 1874K->137K(1984K), 0.0046116 secs] 3542K->1805K(6080K), 0.0047993 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
7.469: [GC 7.470: [DefNew: 1929K->100K(1984K), 0.0043573 secs] 3597K->1843K(6080K), 0.0045445 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
7.632: [GC 7.632: [DefNew: 1892K->192K(1984K), 0.0134389 secs] 3635K->2308K(6080K), 0.0136347 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
XML/BI Publisher Version : 5.6.3
Request ID: 17676203
All Parameters: ReportRequestID=17674892:DebugFlag=Y
Report Req ID: 17674892
Debug Flag: Y
Updating request description
Updated description
Retrieving XML request information
Node Name:ATFAPT02
Preparing parameters
null output =/oracle/appl/orad1at2/product/comn/admin/out/o17676203.out
8.464: [GC 8.464: [DefNew: 1984K->192K(1984K), 0.0184990 secs] 4100K->2509K(6080K), 0.0186945 secs] [Times: user=0.01 sys=0.00, real=0.02 secs]
inputfilename =/oracle/appl/orad1at2/product/comn/admin/out/o17674892.out
Data XML File:/oracle/appl/orad1at2/product/comn/admin/out/o17674892.out
Set Bursting parameters..
Bursting propertes.....
{user-variable:cp:territory=US, PRT00814.pdf-stream-divider-max-output-size=65536000, user-variable:cp:ReportRequestID=17674892, user-variable:cp:language=en, user-variable:cp:responsibility=20420, pdf-stream-divider-max-output-size=65536000, user-variable.OA_MEDIA=http://d1at2.abc.ca:8010/OA_MEDIA, burstng-source=EBS, user-variable:cp:DebugFlag=Y, user-variable:cp:parent_request_id=17674892, user-variable:cp:locale=en-US, user-variable:cp:user=URU4.ASHAFI, user-variable:cp:application_short_name=XDO, system-temp-dir=/oracle/appl/orad1at2/product/comn/temp, user-variable:cp:request_id=17676203, user-variable:cp:org_id=43, user-variable:cp:reportdescription=XXPAY Database Audit Series Change Register}
Start bursting process..
9.208: [GC 9.208: [DefNew: 1984K->142K(1984K), 0.0167699 secs] 4301K->2645K(6080K), 0.0169704 secs] [Times: user=0.01 sys=0.01, real=0.02 secs]
[110810_050218008][][STATEMENT] /oracle/appl/orad1at2/product/comn/temp
[110810_050218063][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:territory : value=>US
[110810_050218063][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:ReportRequestID : value=>17674892
[110810_050218064][][STATEMENT] BurstingProcessor:Property Key=>PRT00814.pdf-stream-divider-max-output-size : value=>65536000
[110810_050218064][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:language : value=>en
[110810_050218065][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:responsibility : value=>20420
[110810_050218065][][STATEMENT] BurstingProcessor:Property Key=>user-variable.OA_MEDIA : value=>http://d1at2.abc.ca:8010/OA_MEDIA
[110810_050218066][][STATEMENT] BurstingProcessor:Property Key=>burstng-source : value=>EBS
[110810_050218066][][STATEMENT] BurstingProcessor:Property Key=>pdf-stream-divider-max-output-size : value=>65536000
[110810_050218066][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:DebugFlag : value=>Y
[110810_050218067][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:locale : value=>en-US
[110810_050218067][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:parent_request_id : value=>17674892
[110810_050218068][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:user : value=>URU4.ASHAFI
[110810_050218068][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:application_short_name : value=>XDO
[110810_050218068][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:request_id : value=>17676203
[110810_050218069][][STATEMENT] BurstingProcessor:Property Key=>system-temp-dir : value=>/oracle/appl/orad1at2/product/comn/temp
[110810_050218069][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:org_id : value=>43
[110810_050218070][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:reportdescription : value=>XXPAY Database Audit Series Change Register
[110810_050218071][][STATEMENT] Inside burstingConfigParser
[110810_050218073][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: startDocument is entered <========================
[110810_050218095][][STATEMENT] ATTR_TEMPLATE_FIELD_ALIAS:null
9.325: [GC 9.325: [DefNew: 382K->38K(1984K), 0.0116621 secs]9.337: [Tenured[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor2]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor1]
: 2642K->2080K(4096K), 0.2945164 secs] 2885K->2080K(6080K), 0.3065072 secs] [Times: user=0.32 sys=0.02, real=0.31 secs]
[110810_050218555][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: startDocument is entered <========================
[110810_050218572][][STATEMENT] Template Location:xdo://XX.XXPAY048RPT.en.00/?getSource = true
[110810_050218605][][STATEMENT] url:xdo://XX.XXPAY048RPT.en.00/?getSource = true
[110810_050218606][][STATEMENT] mUrl:xdo://XX.XXPAY048RPT.en.00/?getSource = true
[110810_050218686][oracle.apps.xdo.oa.schema.server.TemplateInputStream][STATEMENT] initStream(): mProps is null
[110810_050218689][oracle.apps.xdo.oa.schema.server.TemplateInputStream][STATEMENT] initStream(): xdo.TemplateValidation: null
[110810_050218689][oracle.apps.xdo.oa.schema.server.TemplateInputStream][STATEMENT] initStream(): template validation is on
[110810_050218880][][STATEMENT] initConfig(): config file used :null
[110810_050218881][][STATEMENT] initCustomFactories(): loading custom delivery channels :{}
[110810_050218881][oracle.apps.xdo.delivery.DeliveryManager][STATEMENT] initConfig(): loading default properties :{}
[110810_050218882][oracle.apps.xdo.delivery.DeliveryManager][STATEMENT] createRequest(): called with request type :smtp_email
10.191: [GC 10.192: [DefNew: 1792K->157K(1984K), 0.0124028 secs] 5872K->4238K(6080K), 0.0125942 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
[110810_050218994][oracle.apps.xdo.delivery.DeliveryManager][STATEMENT] createRequest(): exiting
[110810_050219092][oracle.apps.xdo.batch.DeliveryHelper][EXCEPTION] java.io.FileNotFoundException: /oracle/appl/orad1at2/product/comn/temp/110810_050218056/xdo1_2.pdf (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at oracle.apps.xdo.batch.DeliveryHelper.getEmailDeliveryRequest(DeliveryHelper.java:221)
at oracle.apps.xdo.batch.DeliveryHelper.addRequest(DeliveryHelper.java:466)
at oracle.apps.xdo.batch.bursting.DocumentDelivery.addDeliveryRequest(DocumentDelivery.java:204)
at oracle.apps.xdo.batch.bursting.DocumentDelivery.submitCoreDeliveryRequests(DocumentDelivery.java:143)
at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue(BurstingProcessorEngine.java:3326)
at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument(BurstingProcessorEngine.java:2165)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstDocument(BurstingProcessorEngine.java:2102)
at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement(BurstingProcessorEngine.java:2025)
at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1145)
at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(BurstingProcessorEngine.java:2206)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingEndElement(BurstingProcessorEngine.java:1835)
at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1148)
at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:227)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingConfigParser(BurstingProcessorEngine.java:974)
at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:917)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:293)
at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
[110810_050219094][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Called
[110810_050219095][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] setDefaultServerProperties(): No default server found for this request type: smtp_email
[110810_050219096][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] setDefaultServerProperties(): properties defined in this request.
[TEMP_DIR:String] [oracle/appl/orad1at2/product/comn/temp/110810_050218056]
[ASYNC_CHECK_INTERVAL:Integer] [60000]
[HOST:String] [is053.abc.com]
[SMTP_TO_RECIPIENTS:String] [[email protected]]
[SMTP_ENCODING:String] **
[SMTP_CONTENT_TYPE:String] [text/html;charset=UTF-8]
[SMTP_SUBJECT:String] [- ]
[BUFFERING_MODE:Boolean] [true]
[SMTP_FROM:String] []
[TEMP_FILE_PREFIX:String] [dlvr]
[PORT:Integer] [(java.lang.Integer]
[RETRY:Integer] [0]
[SMTP_ATTACHMENT:Attachment] [(oracle.apps.xdo.delivery.smtp.Attachment]
[RETRY_INTERVAL:Integer] [60000]
[TEMP_FILE_SUFFIX:String] [.tmp]
[SMTP_ATTACHMENT_FIRST:Boolean] [(java.lang.Boolean]
[SMTP_REPLY_TO:String] [[email protected]]
[SMTP_CHARSET:String] [UTF-8]
[ASYNC_TIMEOUT:Integer] [86400000]
[110810_050219097][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): BUFFERING_MODE is ON.
[110810_050219097][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): TEMP_DIR found, start document buffering : /oracle/appl/orad1at2/product/comn/temp/110810_050218056
[110810_050219098][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): Starting document buffering.
[110810_050219133][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): Creating temporary file for buffering : /oracle/appl/orad1at2/product/comn/temp/110810_050218056/dlvrt6raN7DEYH26913.tmp
[110810_050219137][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): 1528 bytes have been written to the temporary file.
[110810_050219137][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] filterDocument(): Starting document preprocessing.
[110810_050219137][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] filterDocument(): No native command found for preprocessing, exiting.
[110810_050219138][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): Finished document buffering.
[110810_050219138][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Start reading the buffered document file. : /oracle/appl/orad1at2/product/comn/temp/110810_050218056/dlvrt6raN7DEYH26913.tmp
[110810_050219139][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Calling DeliveryRequestHandler.submitRequest()
[110810_050219139][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): called
[110810_050219140][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): This request has never been submitted before.
[110810_050219161][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] Start parsing HTML file...(filename:null)(current dir:null)
[110810_050219163][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] 1th <img>/<embed> tag - Beginning of the tag.
[110810_050219163][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] 1th <img>/<embed> tag - Reached the end of the tag.
[110810_050219164][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] 1th <img>/<embed> tag - Original image src :
[110810_050219164][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] 1th <img>/<embed> tag - source is NOT reachable. Value will be used as is.
[110810_050219166][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] Reached the end of InputStream.
[110810_050219171][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Adding an attachment ...[filename]=[null], [content-type]=[text/html], [index]=[-1], [disposition]=[null]
[110810_050219173][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Character set for MIME headers : UTF-8
[110810_050219173][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Character encoding for MIME headers : B
[110810_050219174][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Exiting addAttachment()
[110810_050219174][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT]
<html>
<head>
<style type="text/css">
body {font-family:Arial}
</style>
</head>
<body>
<!-- <img src=""/>
-->
---------------------------------------------------------- Oracle----------------------------------------------------------------
System Administrator Action:
Not applicable.
Regards
The information transmitted is intended only for the addressee and may contain confidential,
proprietary and/or privileged material. Any unauthorized review, distribution or other use of
or the taking of any action in reliance upon this information is prohibited. If you received
this in error, please contact the sender and delete any copies.
</body></html>
[110810_050219267][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): Character set for MIME headers : UTF-8
[110810_050219267][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): Character encoding for MIME headers : B
[110810_050219282][oracle.apps.xdo.batch.DeliveryHelper][EXCEPTION] javax.mail.internet.AddressException: Illegal address in string ``''
at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:68)
at oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler.submitRequest(SMTPDeliveryRequestHandler.java:747)
at oracle.apps.xdo.delivery.AbstractDeliveryRequest.submit(AbstractDeliveryRequest.java:1270)
at oracle.apps.xdo.batch.DeliveryHelper.submitRequests(DeliveryHelper.java:627)
at oracle.apps.xdo.batch.bursting.DocumentDelivery.submitCoreDeliveryRequests(DocumentDelivery.java:151)
at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue(BurstingProcessorEngine.java:3326)
at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument(BurstingProcessorEngine.java:2165)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstDocument(BurstingProcessorEngine.java:2102)
at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement(BurstingProcessorEngine.java:2025)
at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1145)
at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(BurstingProcessorEngine.java:2206)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingEndElement(BurstingProcessorEngine.java:1835)
at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1148)
at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:227)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingConfigParser(BurstingProcessorEngine.java:974)
at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:917)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:293)
at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
[110810_050219283][][EXCEPTION] Error!! Could not deliver the output for Delivery channel:null . Please check the Log for error details..
10.512: [GC 10.512: [DefNew: 1204K->61K(1984K), 0.0072295 secs]10.520: [Tenured: 4232K->2292K(4352K), 0.2700526 secs] 5284K->2292K(6336K), 0.2776002 secs] [Times: user=0.28 sys=0.00, real=0.28 secs]
[110810_050219578][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: endDocument is entered <========================
[110810_050219580][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: endDocument is entered <========================
Bursting process complete..
Generating Bursting Status Report..
--Exception
/*oracle/appl/orad1at2/product/comn/temp/110810_050218056/xdo1_2.pdf (No such file or directory)*
java.io.FileNotFoundException: /oracle/appl/orad1at2/product/comn/temp/110810_050218056/xdo1_2.pdf (No such file or directory) at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.zipOutputFiles(JCP4XDOBurstingEngine.java:532)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:299)
at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
[110810_050219666][][STATEMENT] /oracle/appl/orad1at2/product/comn/temp/110810_050218056 deleted successfully...
Heap
def new generation total 1984K, used 199K [0xb1000000, 0xb1220000, 0xb4780000)
eden space 1792K, 11% used [0xb1000000, 0xb1031d68, 0xb11c0000)
from space 192K, 0% used [0xb11c0000, 0xb11c0000, 0xb11f0000)
to space 192K, 0% used [0xb11f0000, 0xb11f0000, 0xb1220000)
tenured generation total 6104K, used 4292K [0xb4780000, 0xb4d76000, 0xd0400000)
the space 6104K, 70% used [0xb4780000, 0xb4bb10c0, 0xb4bb1200, 0xb4d76000)
compacting perm gen total 12288K, used 7320K [0xd0400000, 0xd1000000, 0xd8400000)
the space 12288K, 59% used [0xd0400000, 0xd0b26118, 0xd0b26200, 0xd1000000)
ro space 8192K, 80% used [0xd8400000, 0xd8a73430, 0xd8a73600, 0xd8c00000)
rw space 12288K, 59% used [0xd8c00000, 0xd9330510, 0xd9330600, 0xd9800000)
*************LOG FILE Messages END****************************
ThanksHi Edmonton,
Check the email address that you're trying to send to, from your log below:
javax.mail.internet.AddressException: Illegal address in string ``''
Regards,
Gareth -
Reading attachments within attachments
Hi,
I tested this code that I found and I was wondering if it's possible to read attachments within attachments. We are receiving forwarded messages that have an attachment of type message. The attachment then has its own attachment of type doc. We can break it into 2 parts but we don't know how to break it into 3 parts. I'm sure this sounds confusing so here is the code example:
Object content = message.getContent();
if (content instanceof Multipart) {
handleMultipart((Multipart)content,msgName, mailFr, mailTo);
} else {
handlePart(message[i],msgName, mailFr, mailTo);
public static void handleMultipart(Multipart multipart, String msgName, String mailFr, String mailTo)
throws MessagingException, IOException {
for (int i=0, n=multipart.getCount(); i<n; i++) {
handlePart(multipart.getBodyPart(i),msgName, mailFr, mailTo);
public static void handlePart(Part part, String msgName, String mailFr, String mailTo)
throws MessagingException, IOException {
String disposition = part.getDisposition();
String contentType = part.getContentType();
if (disposition == null) { if ((contentType.length() >= 10) &&
(contentType.toLowerCase().substring(
0, 10).equals("text/plain"))) {
//part.writeTo(System.out);
} else {
//part.writeTo(System.out);
saveFile(part.getFileName(), part.getInputStream(),msgName, mailFr, mailTo);
} else if (disposition.equalsIgnoreCase(Part.ATTACHMENT)) {
saveFile(part.getFileName(), part.getInputStream(),msgName, mailFr, mailTo);
System.out.println("This is an attachment");
} else if (disposition.equalsIgnoreCase(Part.INLINE)) {
saveFile(part.getFileName(), part.getInputStream(),msgName, mailFr, mailTo);If you have an attachment that's a message, then try to cast it to something of class Message or MimeMessage, then you can get parts from that.
-
Problem to get file with special characters in the message
Hi, I'm developing an application that read the email and save the attached file. However, some files have special characters in the name, like: Documento de EspecificaÇÂO.doc
I noticed the de name of the file in de message head is:
"=?iso-8859-1?Q?Documento_de_Especifica=E7=E3o.doc?="
I'm already using the JavaMil 1.4.5
Tha is my code:
package br.com.cesan.helpdesk;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Part;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.search.FlagTerm;
public class LerEmail2 {
* @param args
* @throws MessagingException
* @throws IOException
public static void main(String[] args) throws MessagingException, IOException {
// TODO Auto-generated method stub
// Get session
Session session = Session.getInstance(new Properties(), null);
// Get the store
Store store = session.getStore("pop3");
store.connect("pop.xxxxx.com.br", "user", "password");
Folder folder = store.getFolder("INBOX");
//folder.open(Folder.READ_ONLY);
folder.open(Folder.READ_WRITE);
// Show only unreaded Messages
FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
// Get directory
Message message[] = folder.getMessages();
//Message messages[] = folder.search(ft);
for (int i=0, n=message.length; i<n; i++) {
System.out.println(i + " - "+ message.getSubject() +" - " + message[i].getSentDate() );
Object content = message[i].getContent();
if (content instanceof Multipart) {
handleMultipart((Multipart)content);
} else {
handlePart(message[i]);
// Close connection
folder.close(false);
store.close();
public static void handleMultipart(Multipart multipart) throws MessagingException, IOException {
for (int i=0, n=multipart.getCount(); i<n; i++) {
handlePart(multipart.getBodyPart(i));
public static void handlePart(Part part) throws MessagingException, IOException {
String disposition = part.getDisposition();
String contentType = part.getContentType();
if (disposition == null) { // When just body
System.out.println("Null: " + contentType);
// Check if plain
if ((contentType.length() >= 10) && (contentType.toLowerCase().substring(0, 10).equals("text/plain"))) {
part.writeTo(System.out);
} else { // Don't think this will happen
System.out.println("Other body: " + contentType);
part.writeTo(System.out);
} else if (disposition.equalsIgnoreCase(Part.ATTACHMENT)) {
System.out.println("Attachment: " + part.getFileName() + " : " + contentType);
saveFile(part.getFileName(), part.getInputStream());
} else if (disposition.equalsIgnoreCase(Part.INLINE)) {
System.out.println("Inline: " +
part.getFileName() +
" : " + contentType);
saveFile(part.getFileName(), part.getInputStream());
} else { // Should never happen
System.out.println("Other: " + disposition);
public static void saveFile(String filename, InputStream input) throws IOException {
if (filename == null) {
filename = File.createTempFile("xx", ".out").getName();
// Do no overwrite existing file
File file = new File(filename);
for (int i=0; file.exists(); i++) {
file = new File(filename+i);
System.setProperty("file.encoding", "iso-8859-1");
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
BufferedInputStream bis = new BufferedInputStream(input);
int aByte;
while ((aByte = bis.read()) != -1) {
bos.write(aByte);
bos.flush();
bos.close();
bis.close();
The problem occurs in:
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
BufferedInputStream bis = new BufferedInputStream(input);
int aByte;
while ((aByte = bis.read()) != -1) {
bos.write(aByte);
Thanks
Edited by: user10283976 on 30/03/2012 07:36
Edited by: user10283976 on 30/03/2012 07:37
Edited by: user10283976 on 30/03/2012 07:37
Edited by: user10283976 on 30/03/2012 07:38
Edited by: user10283976 on 30/03/2012 07:40
Edited by: user10283976 on 30/03/2012 07:41
Edited by: user10283976 on 30/03/2012 07:42http://www.oracle.com/technetwork/java/javamail/faq/index.html#encodefilename
-
Problem with attachment saving to db
Hi,
I've encountered the following problem when writing a small app. to receive e-mails and subsequently storing them in a database.
private void handlePart(Part part) throws IOException, MessagingException {
String disposition = part.getDisposition();
if (disposition == null) { //body
// do something dull
} else if (disposition.equalsIgnoreCase(Part.ATTACHMENT)) {
try {
saveAttachmentToDB(part.getFileName(), part.getInputStream(), part.getSize());
} catch (SQLException e) {
System.err.print("SQL Error: ");
System.err.println(e.getMessage());
System.exit(-1);
} else if (disposition.equalsIgnoreCase(Part.INLINE) && part.getSize()>9) {
// do something to store to db
}and
public void saveAttachmentToDB(String filename, InputStream input, int size)
throws IOException, SQLException {
PreparedStatement pstmt;
String Query = "insert Attachment VALUES(?,?)";
pstmt = con.prepareStatement(Query);
pstmt.setString(1, filename);
pstmt.setBinaryStream(2, input, size); //method to insert a stream of bytes
pstmt.executeUpdate();
}Now the problem is that upon exection the system hangs on the first insert.
Probably this is because the size aint right...
I've tried it using different attachments, like MS Word documents, plain textfiles. Is this the way to do this?
Or must I use a DataHandler object, but if the latter is true can someone pinpoint me to a good tutorial on datahandlers.
I rewrote the former code using a part.WriteTo() writing to a ByteArrayOutPutstream --> converting that stream to a ByteArrayInputStream and calling setBinaryStream on that using the size of ByteArrayOutputStream.
If I did this the system wouldn't hang but it wrote the contentHeader and the body to the database. The body would than be in Base64 format, wich is not what I want... Please can somebody set me on the right track here?
Grts
JoerHai I am getting the attachments from the inbox.But I have also need the same to store my attachmnts i db can u explain it or send me the code
thanks -
Gettting attachments using JAVAMAIL
Hi,
I am dealing with an application which wants me to go through the mailbox and get the attachments of specific emails. These attachments are of different kinds. The attachments can vary from being rtf document, to Word, html, fo.. documents.. I got this skeleton code from the tutorial but dont know what to fill in..
if (disposition == null) {
// Check if plain
MimeBodyPart mbp = (MimeBodyPart)part;
if (mbp.isMimeType("text/plain")) {
// Handle plain
} else {
// Special non-attachment cases here of
// image/gif, text/html, ...
What is it meant by handling plain? How do i handle html, worf, rtf documents.. Thanks a lot in advance.. Thanks
AbhishekTry this as a reference. It works PERFECTLY. Ignore the comments.
//If the content is ATTACHMENT
filename = part.getFileName();
if (filename != null) {
filename = filename.trim();
if(filename.equalsIgnoreCase(fileNameDownload.trim())) {
//System.out.println("Downloading DOWN 1");
session_id = this.DL_sessionid;
directory = ATTACHMENTPath + m_user + "_" + session_id + "/";
if(download) {
pushFile(part.getFileName(),part.getInputStream(),resp);
} else {
saveFile(part.getFileName(), directory, part.getInputStream(), resp);
filectr++;
private void saveFile(String fileName, String Directory, InputStream input, HttpServletResponse resp)
String myfile="";
try
//Correct the file name;
String p_filename = javaFileParser(fileName);
File newDir = new File(Directory);
//Check if the directory does not exists!
if(!newDir.exists()) { //If it doesn't..
//Create the directory
newDir.mkdir();
String complete_path = Directory + p_filename;
File myFile=new File(complete_path);
//Check if a filename like this already exists!
if(myFile.exists()) {
//If it does..
//delete the current file residing into the directory
myFile.delete();
//Write the file (START)
FileOutputStream fos = new FileOutputStream(myFile);
BufferedOutputStream bos = new BufferedOutputStream(fos);
BufferedInputStream bis = new BufferedInputStream(input);
int aByte;
while ((aByte = bis.read()) != -1)
bos.write(aByte);
bos.flush();
bos.close();
bis.close();
//(END)
catch (Exception x)
System.out.println("Error : " + x);
private void pushFile(String fileName,InputStream input, HttpServletResponse resp)
try
//Download the file to the Client's machine
ServletOutputStream stream = resp.getOutputStream();
resp.setContentType("application/octet-stream");
resp.setHeader("Content-Disposition","attachment;filename="+fileName.trim()+";");
//BufferedInputStream fif = new BufferedInputStream(new FileInputStream(complete_path));
BufferedInputStream fif = new BufferedInputStream(input);
int data;
while((data = fif.read()) != -1)
stream.write(data);
stream.flush();
fif.close();
stream.close();
catch (Exception x)
System.out.println("Error : " + x);
private String javaFileParser(String filename)
//System.out.println("In EmailObject javaFileParser");
String n_filename="";
//Check if the file starts with '=?iso8859'
//If it does, it will need parsing
if(filename.startsWith("=?iso")) {
n_filename = filename.substring(15,filename.lastIndexOf("?"));
} else
n_filename = filename;
return n_filename;
I suggest don't use JavaMail.. It has BUGS on some other email type. If not in POP3 then in IMAP.. Specialy when it receives "Enriched" contents types. Better yet don't use Java. It has lots of Bugs. -
Unable to read attachment from javamail using IMAP
I am unable to read and save attachement in java mail using IMAP, but able to do using POP3
Sample code below:
Multipart multipart = (Multipart) message.getContent();
for (int i = 0, n = multipart.getCount(); i < n; i++)
Part part = multipart.getBodyPart(i);
String disposition = part.getDisposition();
// here i am getting dispostion null if use IMAP, if i use POP3 then i can able to recevive attachment
if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT) || (disposition.equals(Part.INLINE)))))
System.out.println("file name is " + part.getFileName());
message.setFlag(Flags.Flag.ANSWERED, true);
saveFile(part.getFileName(), part.getInputStream());
public static void saveFile(String fn, InputStream in) {
try {
FileOutputStream fos = new FileOutputStream(new File("c://test//" + fn));
byte[] buf = new byte[1024];
int i = 0;
while ((i = in.read(buf)) != -1) {
fos.write(buf, 0, i);
in.close();
fos.close();
} catch (IOException e) {
e.printStackTrace();
Any help is appreciated
Thanks
SamiIf you're getting disposition == null it's because your IMAP server
isn't returning this information to you. Possibly your IMAP server
is buggy. You can look at the protocol trace to see what the IMAP
server is returning, and if it's missing information that should be there,
report a bug to your IMAP server vendor.
Your program might need to work around this problem by deciding
that any body part with a filename is an attachment, or any part
after the first is an attachment. -
Format of email body in bursting control file
Hi,
I am hoping this is a simple question for someone that is not as new as I am to bursting...
What is the new line character I should be using to format the outgoing email body within the bursting control file.
At present, the entire email body appears as one paragraph regardless of whether I have included new lines or not. I am no doubt missing something simple given that it is 5.20pm on a Friday.
Any help is appreciated.
Kind regards,
WesVersion 11.5.10.2
XML/BI Publisher Version : 5.6.3
i have put the log file here for your reference
XML/BI Publisher Version : 5.6.3
Request ID: 1691733
All Parameters: ReportRequestID=1691732:DebugFlag=Y
Report Req ID: 1691732
Debug Flag: Y
Updating request description
Updated description
Retrieving XML request information
Node Name:COLFARMT
Preparing parameters
null output =/u3010/app/oracle/UAT/common/admin/out/UAT1_colfarmt/o1691733.out
inputfilename =/u3010/app/oracle/UAT/common/admin/out/UAT1_colfarmt/o1691732.out
Data XML File:/u3010/app/oracle/UAT/common/admin/out/UAT1_colfarmt/o1691732.out
Set Bursting parameters..
Temp. Directory:/u0350/app/apps/UAT/xx/1.0/log
[033108_044049404][][STATEMENT] Oracle XML Parser version ::: Oracle XDK Java 9.0.4.0.0 Production
Start bursting process..
[033108_044049410][][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log
[033108_044049474][][STATEMENT] BurstingProcessor ::: Property Key ---> burstng-source
[033108_044049475][][STATEMENT] Inside burstingConfigParser
[033108_044049482][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: startDocument is entered <========================
[033108_044049688][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: startDocument is entered <========================
[033108_044050177][][STATEMENT] template File/u0350/app/apps/UAT/xx/1.0/data/PurchaseOrder.rtf
[033108_044050245][][STATEMENT] Logger.init(): *** DEBUG MODE IS OFF. ***
[033108_044050731][][STATEMENT] [ PDF GENERATOR ]---------------------------------------------
[033108_044050732][][STATEMENT] XDO version = Oracle XML Publisher 5.6.3
[033108_044050732][][STATEMENT] java.home = /usr/j2sdk1.4.2_08/jre
[033108_044050732][][STATEMENT] XDO_TOP = null
[033108_044050732][][STATEMENT] Config Path = null
[033108_044050732][][STATEMENT] Debug Cfg Path= null
[033108_044050733][][STATEMENT] Font dir = /usr/j2sdk1.4.2_08/jre/lib/fonts/
[033108_044050733][][STATEMENT] Locale = en
[033108_044050733][][STATEMENT] Fallback font = type1.Helvetica
[033108_044050733][][STATEMENT] [ PDF GENERATOR PROPERTIES ]----------------------------------
[033108_044050736][][STATEMENT] digit-substitution=null(not set)
[033108_044050736][][STATEMENT] font.ALBANY WT J.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTJ.ttf
[033108_044050736][][STATEMENT] font.ALBANY WT K.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTK.ttf
[033108_044050737][][STATEMENT] font.ALBANY WT SC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTS.ttf
[033108_044050737][][STATEMENT] font.ALBANY WT TC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTT.ttf
[033108_044050737][][STATEMENT] font.ALBANY WT.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANYWT.ttf
[033108_044050737][][STATEMENT] font.ANDALE DUOSPACE WT J.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOJB.ttf
[033108_044050737][][STATEMENT] font.ANDALE DUOSPACE WT J.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOJ.ttf
[033108_044050738][][STATEMENT] font.ANDALE DUOSPACE WT K.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOKB.ttf
[033108_044050738][][STATEMENT] font.ANDALE DUOSPACE WT K.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOK.ttf
[033108_044050738][][STATEMENT] font.ANDALE DUOSPACE WT SC.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOSCB.ttf
[033108_044050738][][STATEMENT] font.ANDALE DUOSPACE WT SC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOSC.ttf
[033108_044050739][][STATEMENT] font.ANDALE DUOSPACE WT TC.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOTCB.ttf
[033108_044050739][][STATEMENT] font.ANDALE DUOSPACE WT TC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOTC.ttf
[033108_044050739][][STATEMENT] font.ANDALE DUOSPACE WT.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOB.ttf
[033108_044050739][][STATEMENT] font.ANDALE DUOSPACE WT.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUO.ttf
[033108_044050739][][STATEMENT] font.CG TIMES.italic.bold=type1.Times-BoldItalic
[033108_044050739][][STATEMENT] font.CG TIMES.italic.normal=type1.Times-Italic
[033108_044050740][][STATEMENT] font.CG TIMES.normal.bold=type1.Times-Bold
[033108_044050741][][STATEMENT] font.CG TIMES.normal.normal=type1.Times-Roman
[033108_044050741][][STATEMENT] font.COURIER NEW.italic.bold=type1.Courier-BoldOblique
[033108_044050741][][STATEMENT] font.COURIER NEW.italic.normal=type1.Courier-Oblique
[033108_044050741][][STATEMENT] font.COURIER NEW.normal.bold=type1.Courier-Bold
[033108_044050741][][STATEMENT] font.COURIER NEW.normal.normal=type1.Courier
[033108_044050742][][STATEMENT] font.COURIER.italic.bold=type1.Courier-BoldOblique
[033108_044050742][][STATEMENT] font.COURIER.italic.normal=type1.Courier-Oblique
[033108_044050742][][STATEMENT] font.COURIER.normal.bold=type1.Courier-Bold
[033108_044050742][][STATEMENT] font.COURIER.normal.normal=type1.Courier
[033108_044050742][][STATEMENT] font.DEFAULT.italic.bold=type1.Helvetica-BoldOblique
[033108_044050742][][STATEMENT] font.DEFAULT.italic.normal=type1.Helvetica-Oblique
[033108_044050743][][STATEMENT] font.DEFAULT.normal.bold=type1.Helvetica-Bold
[033108_044050743][][STATEMENT] font.DEFAULT.normal.normal=type1.Helvetica
[033108_044050743][][STATEMENT] font.HELVETICA.italic.bold=type1.Helvetica-BoldOblique
[033108_044050743][][STATEMENT] font.HELVETICA.italic.normal=type1.Helvetica-Oblique
[033108_044050743][][STATEMENT] font.HELVETICA.normal.bold=type1.Helvetica-Bold
[033108_044050743][][STATEMENT] font.HELVETICA.normal.normal=type1.Helvetica
[033108_044050743][][STATEMENT] font.MONOSPACE.italic.bold=type1.Courier-BoldOblique
[033108_044050744][][STATEMENT] font.MONOSPACE.italic.normal=type1.Courier-Oblique
[033108_044050744][][STATEMENT] font.MONOSPACE.normal.bold=type1.Courier-Bold
[033108_044050744][][STATEMENT] font.MONOSPACE.normal.normal=type1.Courier
[033108_044050744][][STATEMENT] font.SANS-SERIF.italic.bold=type1.Helvetica-BoldOblique
[033108_044050744][][STATEMENT] font.SANS-SERIF.italic.normal=type1.Helvetica-Oblique
[033108_044050744][][STATEMENT] font.SANS-SERIF.normal.bold=type1.Helvetica-Bold
[033108_044050745][][STATEMENT] font.SANS-SERIF.normal.normal=type1.Helvetica
[033108_044050745][][STATEMENT] font.SERIF.italic.bold=type1.Times-BoldItalic
[033108_044050745][][STATEMENT] font.SERIF.italic.normal=type1.Times-Italic
[033108_044050745][][STATEMENT] font.SERIF.normal.bold=type1.Times-Bold
[033108_044050745][][STATEMENT] font.SERIF.normal.normal=type1.Times-Roman
[033108_044050745][][STATEMENT] font.SYMBOL.normal.normal=type1.Symbol
[033108_044050746][][STATEMENT] font.TIMES NEW ROMAN.italic.bold=type1.Times-BoldItalic
[033108_044050746][][STATEMENT] font.TIMES NEW ROMAN.italic.normal=type1.Times-Italic
[033108_044050746][][STATEMENT] font.TIMES NEW ROMAN.normal.bold=type1.Times-Bold
[033108_044050746][][STATEMENT] font.TIMES NEW ROMAN.normal.normal=type1.Times-Roman
[033108_044050746][][STATEMENT] font.TIMES.italic.bold=type1.Times-BoldItalic
[033108_044050746][][STATEMENT] font.TIMES.italic.normal=type1.Times-Italic
[033108_044050747][][STATEMENT] font.TIMES.normal.bold=type1.Times-Bold
[033108_044050747][][STATEMENT] font.TIMES.normal.normal=type1.Times-Roman
[033108_044050747][][STATEMENT] font.ZAPFDINGBATS.normal.normal=type1.ZapfDingbats
[033108_044050747][][STATEMENT] pdf-changes-allowed=0
[033108_044050749][][STATEMENT] pdf-compression=true
[033108_044050749][][STATEMENT] pdf-enable-accessibility=true
[033108_044050749][][STATEMENT] pdf-enable-copying=false
[033108_044050749][][STATEMENT] pdf-encryption-level=0
[033108_044050749][][STATEMENT] pdf-font-embedding=true
[033108_044050749][][STATEMENT] pdf-hide-menubar=false
[033108_044050750][][STATEMENT] pdf-hide-toolbar=false
[033108_044050750][][STATEMENT] pdf-no-accff=false
[033108_044050750][][STATEMENT] pdf-no-cceda=false
[033108_044050750][][STATEMENT] pdf-no-changing-the-document=true
[033108_044050750][][STATEMENT] pdf-no-printing=false
[033108_044050750][][STATEMENT] pdf-open-password=
[033108_044050751][][STATEMENT] pdf-permissions=0
[033108_044050751][][STATEMENT] pdf-permissions-password=
[033108_044050751][][STATEMENT] pdf-printing-allowed=0
[033108_044050751][][STATEMENT] pdf-replace-smartquotes=true
[033108_044050751][][STATEMENT] pdf-security=false
[033108_044050751][][STATEMENT] ------------------------------------------------------
[033108_044051077][oracle.apps.xdo.common.font.FontFactory$FontDef][STATEMENT] Type1 font created: Helvetica
[033108_044051091][oracle.apps.xdo.common.font.FontFactory$FontDef][STATEMENT] Type1 font created: Times-Roman
[033108_044051237][][STATEMENT] WARNING: Old RTF version detected, nested table disabled
[033108_044052301][][STATEMENT] WARNING: Old RTF version detected, nested table disabled
[033108_044052383][oracle.apps.xdo.template.rtf.RTF2XSLParser][STATEMENT] Time spent: 1665
[033108_044052394][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Helvetica closed.
[033108_044052394][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Times-Roman closed.
[033108_044052649][][STATEMENT] Logger.init(): *** DEBUG MODE IS OFF. ***
[033108_044052649][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor constructor is called.
[033108_044052901][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor has been initialized without default config.
[033108_044052901][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setTemplate(String) is called with '/u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo2.tmp'.
[033108_044052916][][STATEMENT] Logger.init(): *** DEBUG MODE IS OFF. ***
[033108_044052916][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setData(String) is called with '/u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo0.tmp'.
[033108_044052920][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setOutput(String)is called with '/u0350/app/apps/UAT/xx/1.0/log/033108_044049420/PurchaseOrder 6023571.pdf'.
[033108_044052948][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setOutputFormat(byte)is called with ID=1.
[033108_044052950][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.generate() called.
[033108_044052950][oracle.apps.xdo.template.FOProcessor][STATEMENT] createFO(Object, Object) is called.
[033108_044053858][oracle.apps.xdo.common.xml.XSLT10gR1][STATEMENT] oracle.xdo Developers Kit 10.1.0.3.0 - Production
[033108_044053859][oracle.apps.xdo.common.xml.XSLT10gR1][STATEMENT] Scalable Feature Disabled
[033108_044055032][oracle.apps.xdo.template.fo.FOProcessingEngine][STATEMENT] Using proxy for PDF Generator
[033108_044055064][oracle.apps.xdo.template.FOProcessor][STATEMENT] Calling FOProcessingEngine.process()
[033108_044055065][][STATEMENT] Using optimized xslt
[033108_044055100][oracle.apps.xdo.template.fo.datatype.AttrKey][STATEMENT] WARNING: Found undetermined AttrKey: xmlns:xlink
[033108_044055108][][STATEMENT] [ PDF GENERATOR ]---------------------------------------------
[033108_044055108][][STATEMENT] XDO version = Oracle XML Publisher 5.6.3
[033108_044055108][][STATEMENT] java.home = /usr/j2sdk1.4.2_08/jre
[033108_044055109][][STATEMENT] XDO_TOP = null
[033108_044055112][][STATEMENT] Config Path = null
[033108_044055112][][STATEMENT] Debug Cfg Path= null
[033108_044055112][][STATEMENT] Font dir = /usr/j2sdk1.4.2_08/jre/lib/fonts/
[033108_044055112][][STATEMENT] Locale = en
[033108_044055112][][STATEMENT] Fallback font = type1.Helvetica
[033108_044055112][][STATEMENT] [ PDF GENERATOR PROPERTIES ]----------------------------------
[033108_044055115][][STATEMENT] digit-substitution=null(not set)
[033108_044055115][][STATEMENT] font.ALBANY WT J.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTJ.ttf
[033108_044055116][][STATEMENT] font.ALBANY WT K.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTK.ttf
[033108_044055116][][STATEMENT] font.ALBANY WT SC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTS.ttf
[033108_044055116][][STATEMENT] font.ALBANY WT TC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANWTT.ttf
[033108_044055116][][STATEMENT] font.ALBANY WT.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ALBANYWT.ttf
[033108_044055116][][STATEMENT] font.ANDALE DUOSPACE WT J.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOJB.ttf
[033108_044055116][][STATEMENT] font.ANDALE DUOSPACE WT J.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOJ.ttf
[033108_044055116][][STATEMENT] font.ANDALE DUOSPACE WT K.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOKB.ttf
[033108_044055130][][STATEMENT] font.ANDALE DUOSPACE WT K.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOK.ttf
[033108_044055130][][STATEMENT] font.ANDALE DUOSPACE WT SC.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOSCB.ttf
[033108_044055131][][STATEMENT] font.ANDALE DUOSPACE WT SC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOSC.ttf
[033108_044055137][][STATEMENT] font.ANDALE DUOSPACE WT TC.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOTCB.ttf
[033108_044055137][][STATEMENT] font.ANDALE DUOSPACE WT TC.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOTC.ttf
[033108_044055137][][STATEMENT] font.ANDALE DUOSPACE WT.normal.bold=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUOB.ttf
[033108_044055138][][STATEMENT] font.ANDALE DUOSPACE WT.normal.normal=truetype./usr/j2sdk1.4.2_08/jre/lib/fonts/ADUO.ttf
[033108_044055138][][STATEMENT] font.CG TIMES.italic.bold=type1.Times-BoldItalic
[033108_044055138][][STATEMENT] font.CG TIMES.italic.normal=type1.Times-Italic
[033108_044055138][][STATEMENT] font.CG TIMES.normal.bold=type1.Times-Bold
[033108_044055138][][STATEMENT] font.CG TIMES.normal.normal=type1.Times-Roman
[033108_044055138][][STATEMENT] font.COURIER NEW.italic.bold=type1.Courier-BoldOblique
[033108_044055138][][STATEMENT] font.COURIER NEW.italic.normal=type1.Courier-Oblique
[033108_044055138][][STATEMENT] font.COURIER NEW.normal.bold=type1.Courier-Bold
[033108_044055138][][STATEMENT] font.COURIER NEW.normal.normal=type1.Courier
[033108_044055139][][STATEMENT] font.COURIER.italic.bold=type1.Courier-BoldOblique
[033108_044055139][][STATEMENT] font.COURIER.italic.normal=type1.Courier-Oblique
[033108_044055139][][STATEMENT] font.COURIER.normal.bold=type1.Courier-Bold
[033108_044055139][][STATEMENT] font.COURIER.normal.normal=type1.Courier
[033108_044055139][][STATEMENT] font.DEFAULT.italic.bold=type1.Helvetica-BoldOblique
[033108_044055139][][STATEMENT] font.DEFAULT.italic.normal=type1.Helvetica-Oblique
[033108_044055139][][STATEMENT] font.DEFAULT.normal.bold=type1.Helvetica-Bold
[033108_044055139][][STATEMENT] font.DEFAULT.normal.normal=type1.Helvetica
[033108_044055139][][STATEMENT] font.HELVETICA.italic.bold=type1.Helvetica-BoldOblique
[033108_044055140][][STATEMENT] font.HELVETICA.italic.normal=type1.Helvetica-Oblique
[033108_044055140][][STATEMENT] font.HELVETICA.normal.bold=type1.Helvetica-Bold
[033108_044055140][][STATEMENT] font.HELVETICA.normal.normal=type1.Helvetica
[033108_044055140][][STATEMENT] font.MONOSPACE.italic.bold=type1.Courier-BoldOblique
[033108_044055140][][STATEMENT] font.MONOSPACE.italic.normal=type1.Courier-Oblique
[033108_044055140][][STATEMENT] font.MONOSPACE.normal.bold=type1.Courier-Bold
[033108_044055140][][STATEMENT] font.MONOSPACE.normal.normal=type1.Courier
[033108_044055140][][STATEMENT] font.SANS-SERIF.italic.bold=type1.Helvetica-BoldOblique
[033108_044055140][][STATEMENT] font.SANS-SERIF.italic.normal=type1.Helvetica-Oblique
[033108_044055141][][STATEMENT] font.SANS-SERIF.normal.bold=type1.Helvetica-Bold
[033108_044055141][][STATEMENT] font.SANS-SERIF.normal.normal=type1.Helvetica
[033108_044055141][][STATEMENT] font.SERIF.italic.bold=type1.Times-BoldItalic
[033108_044055141][][STATEMENT] font.SERIF.italic.normal=type1.Times-Italic
[033108_044055141][][STATEMENT] font.SERIF.normal.bold=type1.Times-Bold
[033108_044055141][][STATEMENT] font.SERIF.normal.normal=type1.Times-Roman
[033108_044055141][][STATEMENT] font.SYMBOL.normal.normal=type1.Symbol
[033108_044055141][][STATEMENT] font.TIMES NEW ROMAN.italic.bold=type1.Times-BoldItalic
[033108_044055141][][STATEMENT] font.TIMES NEW ROMAN.italic.normal=type1.Times-Italic
[033108_044055142][][STATEMENT] font.TIMES NEW ROMAN.normal.bold=type1.Times-Bold
[033108_044055142][][STATEMENT] font.TIMES NEW ROMAN.normal.normal=type1.Times-Roman
[033108_044055142][][STATEMENT] font.TIMES.italic.bold=type1.Times-BoldItalic
[033108_044055142][][STATEMENT] font.TIMES.italic.normal=type1.Times-Italic
[033108_044055142][][STATEMENT] font.TIMES.normal.bold=type1.Times-Bold
[033108_044055142][][STATEMENT] font.TIMES.normal.normal=type1.Times-Roman
[033108_044055142][][STATEMENT] font.ZAPFDINGBATS.normal.normal=type1.ZapfDingbats
[033108_044055142][][STATEMENT] pdf-changes-allowed=0
[033108_044055142][][STATEMENT] pdf-compression=true
[033108_044055143][][STATEMENT] pdf-enable-accessibility=true
[033108_044055143][][STATEMENT] pdf-enable-copying=false
[033108_044055143][][STATEMENT] pdf-encryption-level=0
[033108_044055143][][STATEMENT] pdf-font-embedding=true
[033108_044055143][][STATEMENT] pdf-hide-menubar=false
[033108_044055143][][STATEMENT] pdf-hide-toolbar=false
[033108_044055143][][STATEMENT] pdf-no-accff=false
[033108_044055143][][STATEMENT] pdf-no-cceda=false
[033108_044055143][][STATEMENT] pdf-no-changing-the-document=true
[033108_044055144][][STATEMENT] pdf-no-printing=false
[033108_044055145][][STATEMENT] pdf-open-password=
[033108_044055145][][STATEMENT] pdf-permissions=0
[033108_044055145][][STATEMENT] pdf-permissions-password=
[033108_044055145][][STATEMENT] pdf-printing-allowed=0
[033108_044055145][][STATEMENT] pdf-replace-smartquotes=true
[033108_044055145][][STATEMENT] pdf-security=false
[033108_044055145][][STATEMENT] ------------------------------------------------------
[033108_044055220][][STATEMENT] Rendering page [1]
[033108_044055238][oracle.apps.xdo.common.font.FontFactory$FontDef][STATEMENT] Type1 font created: Helvetica
[033108_044055238][oracle.apps.xdo.common.font.FontFactory$FontDef][STATEMENT] Type1 font created: Times-Roman
[033108_044055246][][STATEMENT] Phase2 time used: 83ms
[033108_044055531][][STATEMENT] Continue rendering page [1]
[033108_044055585][oracle.apps.xdo.common.font.FontFactory$FontDef][STATEMENT] Type1 font created: Helvetica-Bold
[033108_044055799][][STATEMENT] Generating page [1]
[033108_044055843][][STATEMENT] Rendering page [2]
[033108_044056064][][STATEMENT] Generating page [2]
[033108_044056096][][STATEMENT] Rendering page [3]
[033108_044056271][][STATEMENT] Generating page [3]
[033108_044056303][][STATEMENT] Rendering page [4]
[033108_044056407][][STATEMENT] Phase2 time used: 876ms
[033108_044056443][][STATEMENT] Continue rendering page [4]
[033108_044056483][][STATEMENT] Generating page [4]
[033108_044056512][][STATEMENT] Rendering page [5]
[033108_044056613][][STATEMENT] Generating page [5]
[033108_044056635][][STATEMENT] Rendering page [6]
[033108_044056653][][STATEMENT] Phase2 time used: 210ms
[033108_044056654][][STATEMENT] Continue rendering page [6]
[033108_044056654][][STATEMENT] Phase2 time used: 1ms
[033108_044056654][][STATEMENT] Continue rendering page [6]
[033108_044056656][][STATEMENT] Phase2 time used: 2ms
[033108_044056666][][STATEMENT] Continue rendering page [6]
[033108_044056676][][STATEMENT] Generating page [6]
[033108_044056681][][STATEMENT] Rendering page [7]
[033108_044056731][][STATEMENT] Phase2 time used: 65ms
[033108_044056731][][STATEMENT] Continue rendering page [7]
[033108_044056731][][STATEMENT] Phase2 time used: 0ms
[033108_044056732][][STATEMENT] Continue rendering page [7]
[033108_044056732][][STATEMENT] Phase2 time used: 0ms
[033108_044056733][][STATEMENT] Continue rendering page [7]
[033108_044056733][][STATEMENT] Generating page [7]
[033108_044056735][][STATEMENT] Phase2 time used: 3ms
[033108_044056736][][STATEMENT] Total time used: 1668ms for processing XSL-FO
[033108_044057034][][STATEMENT] ProxyGenerator creating new page: 1
[033108_044057111][][STATEMENT] ProxyGenerator creating new page: 2
[033108_044057189][][STATEMENT] ProxyGenerator creating new page: 3
[033108_044057242][][STATEMENT] ProxyGenerator creating new page: 4
[033108_044057301][][STATEMENT] ProxyGenerator creating new page: 5
[033108_044057331][][STATEMENT] ProxyGenerator creating new page: 6
[033108_044057343][][STATEMENT] ProxyGenerator creating new page: 7
[033108_044057382][][STATEMENT] Starting Generator.close()
[033108_044057388][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Helvetica closed.
[033108_044057388][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Helvetica-Bold closed.
[033108_044057388][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Times-Roman closed.
[033108_044057389][][STATEMENT] Generator.close() took: 6ms
[033108_044057389][][STATEMENT] Total time to process commands from ProxyGenerator tmp file: 643ms
[033108_044057389][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) is called.
[033108_044057412][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) done. All inputs are cleared.
[033108_044057477][][STATEMENT] initConfig(): config file used :null
[033108_044057478][][STATEMENT] initCustomFactories(): loading custom delivery channels :{}
[033108_044057478][oracle.apps.xdo.delivery.DeliveryManager][STATEMENT] initConfig(): loading default properties :{}
[033108_044057479][oracle.apps.xdo.delivery.DeliveryManager][STATEMENT] createRequest(): called with request type :smtp_email
[033108_044057522][oracle.apps.xdo.delivery.DeliveryManager][STATEMENT] createRequest(): exiting
[033108_044057577][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Adding an attachment ...[filename]=[PurchaseOrder 6023571.pdf], [content-type]=[application/pdf], [index]=[-1], [disposition]=[inline]
[033108_044057585][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Character set for MIME headers : UTF-8
[033108_044057586][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Character encoding for MIME headers : B
[033108_044057588][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Exiting addAttachment()
[033108_044057589][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Called
[033108_044057589][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] setDefaultServerProperties(): No default server found for this request type: smtp_email
[033108_044057589][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] setDefaultServerProperties(): properties defined in this request.
[TEMP_DIR:String] [u0350/app/apps/UAT/xx/1.0/log/033108_044049420]
[ASYNC_CHECK_INTERVAL:Integer] [60000]
[HOST:String] [colfarmt.hpa.org.uk]
[SMTP_TO_RECIPIENTS:String] [[email protected]]
[SMTP_ENCODING:String]
[SMTP_CONTENT_FILENAME:String] [messageBody.txt]
[SMTP_CONTENT_TYPE:String] [text/html;charset=UTF-8]
[SMTP_SUBJECT:String] [Purchase Order No: 6023571]
[BUFFERING_MODE:Boolean] [true]
[SMTP_CC_RECIPIENTS:String] [[email protected]]
[SMTP_FROM:String] [[email protected]]
[TEMP_FILE_PREFIX:String] [dlvr]
[PORT:Integer] [(java.lang.Integer]
[RETRY:Integer] [0]
[SMTP_ATTACHMENT:Attachment] [(oracle.apps.xdo.delivery.smtp.Attachment]
[RETRY_INTERVAL:Integer] [60000]
[TEMP_FILE_SUFFIX:String] [.tmp]
[SMTP_ATTACHMENT_FIRST:Boolean] [(java.lang.Boolean]
[SMTP_CHARSET:String] [UTF-8]
[ASYNC_TIMEOUT:Integer] [86400000]
[033108_044057590][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): BUFFERING_MODE is ON.
[033108_044057590][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): TEMP_DIR found, start document buffering : /u0350/app/apps/UAT/xx/1.0/log/033108_044049420
[033108_044057590][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): Starting document buffering.
[033108_044057602][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): Creating temporary file for buffering : /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/dlvrbrfaxe1m4B55646.tmp
[033108_044057603][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): 63 bytes have been written to the temporary file.
[033108_044057603][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] filterDocument(): Starting document preprocessing.
[033108_044057603][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] filterDocument(): No native command found for preprocessing, exiting.
[033108_044057603][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] backupDocument(): Finished document buffering.
[033108_044057603][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Start reading the buffered document file. : /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/dlvrbrfaxe1m4B55646.tmp
[033108_044057603][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Calling DeliveryRequestHandler.submitRequest()
[033108_044057604][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): called
[033108_044057604][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): This request has never been submitted before.
[033108_044057607][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] Start parsing HTML file...(filename:messageBody.txt)(current dir:null)
[033108_044057607][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] Reached the end of InputStream.
[033108_044057608][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Adding an attachment ...[filename]=[messageBody.txt], [content-type]=[text/html;charset=UTF-8], [index]=[-1], [disposition]=[null]
[033108_044057608][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Character set for MIME headers : UTF-8
[033108_044057608][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Character encoding for MIME headers : B
[033108_044057608][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT] addAttachment(): Exiting addAttachment()
[033108_044057609][oracle.apps.xdo.delivery.smtp.Attachment][STATEMENT]
Dear Sir/Madam,
Please review the attached PO 6023571
[033108_044057666][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): Character set for MIME headers : UTF-8
[033108_044057666][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): Character encoding for MIME headers : B
[033108_044058067][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler][STATEMENT] submitRequest(): exiting
[033108_044058067][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Finished calling DeliveryRequestHandler.submitRequest()
[033108_044058067][oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequest][STATEMENT] submit(): Process done successfully. Exiting submit()
[033108_044058085][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: endDocument is entered <========================
[033108_044058086][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: endDocument is entered <========================
Bursting process complete..
Generating Bursting Status Report..
[033108_044058202][oracle.apps.xdo.batch.bursting.FileHandler][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo0.tmp is deleted
[033108_044058203][oracle.apps.xdo.batch.bursting.FileHandler][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo1.tmp is not deleted
[033108_044058226][oracle.apps.xdo.batch.bursting.FileHandler][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo2.tmp is deleted
[033108_044058226][oracle.apps.xdo.batch.bursting.FileHandler][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo3.tmp is not deleted
[033108_044058238][oracle.apps.xdo.batch.bursting.FileHandler][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/xdo4.tmp is deleted
[033108_044058262][oracle.apps.xdo.batch.bursting.FileHandler][STATEMENT] /u0350/app/apps/UAT/xx/1.0/log/033108_044049420/PurchaseOrder 6023571.pdf is deleted -
Pb:reading mail from Outlook
Hi
the problem is depended on the reception of a message starting from Outlook.
is to say that the message of Content-Type is received: multipart/alternative; in two type one is Content-Type: text/plain; and the other Content-Type: text/html; .
Also, the other part is not received if there is a file attached
the code is:
if(messages[msgnr].isMimeType("multipart/*"))
Multipart multipart = (Multipart)messages[msgnr].getContent();
for(int i = 0;i < multipart.getCount();i++)
Part p = multipart.getBodyPart(i);
String disposition = p.getDisposition();
if (disposition == null) { // When just body
// Check if plain
if (p.isMimeType("text/plain")) {
out.print("<PRE>");
out.print(p.getContent());
out.print("</PRE>");
} else if (p.isMimeType("text/html")){
out.print("<PRE>");
out.print(p.getContent());
out.print("</PRE>");
else if (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)){
String filename = p.getFileName();
printHyperlink(attachmentLink,
request,response,
messages[msgnr].getMessageNumber() +
"&part=" + i,
"attachment");
else if(messages[msgnr].isMimeType("text/plain"))
out.print("<PRE>");
out.print(messages[msgnr].getContent());
out.print("</PRE>");
else
printHyperlink(attachmentLink,
request,response,messages[msgnr].getMessageNumber() +
"&part=-1",
"open content");If you get impatient waiting for an answer, don't repost the thread. It makes people hate you. If you post a reply to your first one it will get moved back up to the top.
Here's your old thread, in case you forgot:
http://forum.java.sun.com/thread.jsp?forum=31&thread=307730 -
I have been using a simple Java Mail program to read an incoming mail and if the mail has an attachment save the attachment as a file. Here is a part of the code:
String fileName = p.getFileName();
String disposition = p.getDisposition();
String contentType = p.getContentType();
System.out.println("File Name is:" + fileName );
System.out.println("Dispostion is:" + disposition );
System.out.println("Content type is:" + contentType );
//Check if fileName exists and disposition=ATTACHMENT
if (fileName != null && Part.ATTACHMENT.equalsIgnoreCase(disposition))
//Create a New File Object
System.out.println("Building Output File");
File f = new File(fileName); //
// find a version that does not yet exist
for (int i = 1; f.exists(); i++)
String newName = fileName + " " + i;
f = new File(newName);
The above code has been working fine for the last couple of years. However lately the getDisposition is returning null in some scenarios even though there is an attacment. See below for part of the output.
I noticed that when the charset is "utf-8" disposition=null and when charset ="us-ascii" dispostion is:attachment.
Multipart Message
File Name is:null
Dispostion is:null
Content type is:text/plain;^M
charset="us-ascii"
File Name is:vsr_0000378445_20080516_0842.htm
Dispostion is:attachment
Content type is:application/octet-stream;^M
name="vsr_0000378445_20080516_0842.htm"
Building Output File
File Created
Multipart Message
File Name is:null
Dispostion is:null
Content type is:text/plain;^M
charset="utf-8"
File Name is:vsr_0000378471_20080516_1244.htm
Dispostion is:null
Content type is:application/octet-stream;^M
name="vsr_0000378471_20080516_1244.htm"
Hopefully someone has encountered this problem before.
Thanks in advance for your help.
Regards,
SKThanks for your response again.
I do understand the logic of my program, but I guess I am puzzled at the inconsistency of how it behaves. My program is pretty static and has been working for years. I wanted to make sure that all my loose ends are tied before I go to the mailer.
Also the mail.jar and activation.jar files I have been using are very old(2004). Do you think getting the latest version will help?
Again I understand the fact that the program will only process what it gets, but i expect Javamail API to be smarter, especially when sendmail is doing the same without a problem.
SK -
Email image attachment problem
I have an 8300 curve and when I attach an email from my device to send out, it converts to image to a .vcf file when others get it. I am using a Novell Groupwise email system on a BES server that is pushing to my device. I can send and recieve emails all day, but when I attach a photo I take with the phone and attach to the outgoing device email....it sends as a .vcf not a photo attachment.....
anyone else have this issue?? AT&T BB tech support said my 8300 curve was setup correctly and all configurations were set to send image attachments.
I can recieve an image and view it on my device from another persons accountI don' have the demo folder currently. Any sample code that can be posted here?
I tried
if(disposition == null){
//do this for emails with no attachment
else if (disp.equalsIgnoreCase(Part.ATTACHMENT)){
//do this with attachments
else{
out.println("invalid");
But it still can't work. The (disp == null) seems to pass in all values for both emails with attachments or no attachments....Why?? -
Deal with mails with / without attachments
My codes actually can save the image attachment of emails from email server. But, one problem I have is the codes don't work for mails with no attachment. How can solve this? I have added the structure of how I coded it. I am not sure if I can modify the 2nd part of the codes such that mails without attachment can work too. Pls advise. thank.
My code pattern is like this:
1st part : Connection.
2nd part:
if (contentType.startswith("image/")){
//get the image and save to folder and insert path to image table of database
if (contentType.startswith("text/plain")){
// insert image id and text to another table of database
3rd part: Delete email.I don' have the demo folder currently. Any sample code that can be posted here?
I tried
if(disposition == null){
//do this for emails with no attachment
else if (disp.equalsIgnoreCase(Part.ATTACHMENT)){
//do this with attachments
else{
out.println("invalid");
But it still can't work. The (disp == null) seems to pass in all values for both emails with attachments or no attachments....Why?? -
What do u think is happening here ?
I am using the following code fr parsing the incoming MimeMesssage object. This code works fine for messages received from all servers untill now... A mail received from orgio.net ..is not able to parse the attachments. It gives the following exception
java.lang.ClassCastException: com.sun.mail.util.QPDecoderStream
at MimeMethods.handlePart(MimeMethods.java:121)
Part.getContent() method returns MimeBodyPart for all mails from all other servers (I hope) while mails from this server it throws this exception. please check the code and the print statements at the bottom. Do help me .. if u can.
package com.sdsi.mail.mtx.common;
import com.sdsi.mail.mtx.receivermtx.queue.ReceipientIDs;
import java.util.Properties;
import javax.mail.internet.MimeMessage;
import javax.mail.Message.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.Address;
import java.util.GregorianCalendar;
import java.util.Calendar;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.mail.Multipart;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeMessage;
import javax.mail.Message;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import java.io.File;
import java.io.FileReader;
import java.io.FileOutputStream;
import javax.mail.Part;
import java.io.InputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.nio.channels.FileChannel;
import java.nio.ByteBuffer;
public class MimeMethods
public MimeMessage mime;
boolean attachmentFlag=false;
public long sentDateLong=0;
public MimeMethods()
System.out.println("In MimeMethods-mime=="+mime);
public MimeMethods(MimeMessage message)
this.mime=message;
System.out.println("In MimeMethods-mime=="+mime);
public static void main(String s[])
MimeMethods mimemethods=new MimeMethods();
mimemethods.getMime("c:\\mailsystem\\temp\\1032425458377.MTXServer.N.R.296679");
//mimemethods.getMime("c:\\mailsystem\\temp\\1032444921365.MTXServer.A.U.549677");
boolean hasattachment=mimemethods.hasAttachments();
System.out.println("in-hasattachment----flag--"+hasattachment);
public boolean hasAttachments()
try
Object content = mime.getContent();
if (content instanceof Multipart)
System.out.println("In-hasAttachments-ifContent-11");
//attachmentFlag=true;
handleMultipart((Multipart)content);
else
System.out.println("In-hasAttachments-ifContent-22");
//attachmentFlag=false;
handlePart(mime);
catch(Exception e)
e.printStackTrace();
attachmentFlag=false;
return attachmentFlag;
public void handleMultipart(Multipart multipart) throws Exception
System.out.println("In MimeMethods-handleMultipart--multipart=="+multipart);
for (int i=0, n=multipart.getCount(); i<n; i++)
handlePart(multipart.getBodyPart(i));
public void handlePart(Part part) throws Exception
System.out.println("In MimeMethods-handlePart--part=="+part);
String disposition = part.getDisposition();
String contentType = part.getContentType();
try
if (disposition == null)
// When just body
// Check if plain
System.out.println("In-hasAttachments-ifContent-33");
if ((contentType.length() >= 10) && (contentType.toLowerCase().substring(0, 10).equals("text/plain"))) {
System.out.println("In-hasAttachments-ifContent-44");
String st="";
st=(String)part.getContent();
// Check if html
}else if ((contentType.length() >= 9) && (contentType.toLowerCase().substring(0, 9).equals("text/html"))) {
System.out.println("In-hasAttachments-ifContent-55");
String st="";
Object content=part.getContent();
//MimeMessage mm=(MimeMessage)part.getContent();
System.out.println("in handle PArt--551--obj-content-content.getClass()"+content.getClass());
System.out.println("in handle PArt--552--obj-content-part.getContentType()"+part.getContentType());
if (content instanceof Multipart)
handleMultipart((Multipart)content);
st=(String)part.getContent();
} else if(contentType.equals("message/rfc822")){
System.out.println("In-hasAttachments-ifContent-66");
String str="";
MimeMessage mm=(MimeMessage)part.getContent();
Object content = mm.getContent();
if (content instanceof Multipart)
handleMultipart((Multipart)content);
} else {
handlePart(mm);
} else { // Don't think this will happen
System.out.println("In-hasAttachments-ifContent-661");
MimeBodyPart bodyPartForword = (MimeBodyPart)part;
Object content = bodyPartForword.getContent();
if (content instanceof Multipart) {
handleMultipart((Multipart)content);
else if (disposition.equalsIgnoreCase(Part.ATTACHMENT))
System.out.println("In-hasAttachments-ifContent-ATTACHMENT---77");
attachmentFlag=true;
System.out.println("198 Other: " );
} else if (disposition.equalsIgnoreCase(Part.INLINE)) {
System.out.println("In-hasAttachments-ifContent-88--INLINE");
attachmentFlag=true;
System.out.println("203 Other: " );
} else { // Should never happen
//System.out.println("Other: " + disposition);
catch(Exception e)
e.printStackTrace();
public String getFrom()
String mailFromData=null;
try
Address fromAddress[] = mime.getFrom();
for(int j=0;j<fromAddress.length; j++)
InternetAddress interAdd = (InternetAddress)fromAddress[j];
mailFromData = interAdd.getAddress();
catch(Exception e)
e.printStackTrace();
mailFromData="null";
return mailFromData;
public void setFrom(String fromId)
try
Address fromAddress=new InternetAddress(fromId);
this.mime.setFrom(fromAddress);
catch(Exception e)
e.printStackTrace();
public void setSubject(String sub)
try
mime.setSubject(sub);
catch(Exception e)
e.printStackTrace();
public String getSubject()
String mailSubjectData=null;
try
mailSubjectData = mime.getSubject();
catch(Exception e)
e.printStackTrace();
mailSubjectData="null";
return mailSubjectData;
public String getSentDate()
String toPut=null;
try
java.util.Date sentDate = mime.getSentDate();
Calendar cal = Calendar.getInstance();
cal.setTime(sentDate);
sentDateLong=cal.getTimeInMillis();
Calendar caln = Calendar.getInstance();
caln.set(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DATE),
cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE),cal.get(Calendar.SECOND));
int year = caln.get(Calendar.YEAR);
int month = caln.get(Calendar.MONTH)+1;
int day = caln.get(Calendar.DATE);
int hour = caln.get(Calendar.HOUR_OF_DAY);
int min = caln.get(Calendar.MINUTE);
int sec = caln.get(Calendar.SECOND);
String day1="";
if(cal.get(Calendar.DAY_OF_WEEK)== 1)
day1 ="Sun";
else if(cal.get(Calendar.DAY_OF_WEEK)== 2)
day1 ="Mon";
else if(cal.get(Calendar.DAY_OF_WEEK)== 3)
day1 ="Tue";
else if(cal.get(Calendar.DAY_OF_WEEK)== 4)
day1 ="Wed";
else if(cal.get(Calendar.DAY_OF_WEEK)== 5)
day1 ="Thu";
else if(cal.get(Calendar.DAY_OF_WEEK)== 6)
day1 ="Fri";
else if(cal.get(Calendar.DAY_OF_WEEK)== 7)
day1 ="Sat";
toPut = new String(year+"-"+month+"-"+day+" "+day1+" "+hour+":"+min+":"+sec);
catch(Exception e)
e.printStackTrace();
return toPut;
public String[] getToIds()
String toids[]=null;
try
Address recipientAddresses[] = mime.getRecipients(Message.RecipientType.TO);
if(recipientAddresses != null)
String recipientIDs[] = new String[recipientAddresses.length];
for(int j=0; j<recipientAddresses.length; j++)
InternetAddress iAdd = (InternetAddress)recipientAddresses[j];
recipientIDs[j] = iAdd.getAddress();
toids=recipientIDs;
return toids;
catch(Exception e)
e.printStackTrace();
return toids;
public String[] getCCIds()
String ccids[]=null;
try
Address ccAddresses[] = mime.getRecipients(Message.RecipientType.CC);
if(ccAddresses != null)
String recipientIDs[] = new String[ccAddresses.length];
for(int j=0; j<ccAddresses.length; j++)
InternetAddress iAdd = (InternetAddress)ccAddresses[j];
recipientIDs[j] = iAdd.getAddress();
ccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return ccids;
public String[] getBCCIds()
String bccids[]=null;
try
Address bccAddresses[] = mime.getRecipients(Message.RecipientType.BCC);
if(bccAddresses != null)
String recipientIDs[] = new String[bccAddresses.length];
for(int j=0; j<bccAddresses.length; j++)
InternetAddress iAdd = (InternetAddress)bccAddresses[j];
recipientIDs[j] = iAdd.getAddress();
bccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return bccids;
public void setBody(String bodyPart)
try
//String body=(String)mime.getContent();
mime.setText(bodyPart);
//body.concat("Your mail could not get delivered to the recipient");
catch(Exception e)
e.printStackTrace();
/** By using this method the user will get the Content and the attachments
* for a mail/ Forwarded mail.
public boolean writeMime(String mailMessage, String receivers[],String senderId)
MimeMessage message=null;
try
System.out.println("In-EnQueuer--writeMime()");
String host = " ";
Properties props = System.getProperties();
props.put("mail.smtp.host",host);
Session session = Session.getInstance(props, null);
FileOutputStream fos=new FileOutputStream("c://MTXServer//receiver//queue//mimefolder"+"//"+System.currentTimeMillis());
message = new MimeMessage(session);
int size=receivers.length;
Address address[]=InternetAddress.parse(ArrayToString(receivers));
//message.setRecipients(Message.RecipientType.TO,address);
message.setFrom(address[0]);
message.setSubject("Hello Avanish Sub for Testing set in EnQueuer");
int num=(int)(System.currentTimeMillis()/100);
GregorianCalendar date=new GregorianCalendar();
message.setText(mailMessage);
//message.setSentDate();
message.writeTo(fos);
System.out.println("In-Dequeuer-after-Mime-message Id==" + message.getMessageID());
fos.close();
catch(Exception e)
System.out.println("Exception in Reading file" + e);
return true;
public String ArrayToString(String receivers[])
String str=null;
StringBuffer strbuff=new StringBuffer();
int size=receivers.length;
for(int i = 0; i < size; i++)
strbuff.append(receivers);
return strbuff.toString();
public MimeMessage getMime(String filePath)
StringBuffer mailMessage = new StringBuffer();
MimeMessage message = null;
try
System.out.println("In-MimeMethods-getMime()-filePath--" + filePath);
FileInputStream fis = new FileInputStream(filePath);
String host = " ";
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getInstance(props, null);
message = new MimeMessage(session, fis);
System.out.println("In-MimeMethods-getMime()-after-Mime-message Id==" + message.getMessageID());
this.mime=message;
fis.close();
catch(Exception e)
e.printStackTrace();
return message;
public String getMailContent(String filePath)
StringBuffer mailMessage=new StringBuffer();
try
FileReader fread = new FileReader(filePath);
BufferedReader br = new BufferedReader(fread);
String s1;
while((s1 = br.readLine()) != null)
mailMessage.append(s1);
mailMessage.append("\n");
br.close();
fread.close();
catch(Exception e)
e.printStackTrace();
return new String(mailMessage);
//This is whatever i get when i am printing using print statements.
*In-MimeMethods-getMime()-filePath--c:\mailsystem\temp\1032425458377.MTXServer.N.R.296679
In-MimeMethods-getMime()-after-Mime-message Id==<[email protected]>
In-hasAttachments-ifContent-11
In MimeMethods-handleMultipart--multipart==javax.mail.internet.MimeMultipart@b1c5fa
In MimeMethods-handlePart--part==javax.mail.internet.MimeBodyPart@971afc
In-hasAttachments-ifContent-33
In-hasAttachments-ifContent-55
in handle PArt--551--obj-content-content.getClass()class com.sun.mail.util.QPDecoderStream
in handle PArt--552--obj-content-part.getContentType()text/html;
In MimeMethods-handlePart--part==javax.mail.internet.MimeBodyPart@e5855a
In-hasAttachments-ifContent-ATTACHMENT---77
198 Other:
in-hasattachment----flag--true
java.lang.ClassCastException: com.sun.mail.util.QPDecoderStream
at MimeMethods.handlePart(MimeMethods.java:121)
at MimeMethods.handleMultipart(MimeMethods.java:89)
at MimeMethods.hasAttachments(MimeMethods.java:68)
at MimeMethods.main(MimeMethods.java:56)I am having this exact problem now. I am glad if anyone has a solution for this. Thanks a million for anyone who can help me! I am pretty desperate here.
I am using the following code fr parsing the incoming
MimeMesssage object. This code works fine for messages
received from all servers untill now... A mail
received from orgio.net ..is not able to parse the
attachments. It gives the following exception
java.lang.ClassCastException:
com.sun.mail.util.QPDecoderStream
at
at MimeMethods.handlePart(MimeMethods.java:121)
Part.getContent() method returns MimeBodyPart for all
mails from all other servers (I hope) while mails from
this server it throws this exception. please check the
code and the print statements at the bottom. Do help
me .. if u can.
package com.sdsi.mail.mtx.common;
import
com.sdsi.mail.mtx.receivermtx.queue.ReceipientIDs;
import java.util.Properties;
import javax.mail.internet.MimeMessage;
import javax.mail.Message.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.Address;
import java.util.GregorianCalendar;
import java.util.Calendar;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.mail.Multipart;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeMessage;
import javax.mail.Message;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import java.io.File;
import java.io.FileReader;
import java.io.FileOutputStream;
import javax.mail.Part;
import java.io.InputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.nio.channels.FileChannel;
import java.nio.ByteBuffer;
public class MimeMethods
public MimeMessage mime;
boolean attachmentFlag=false;
public long sentDateLong=0;
public MimeMethods()
System.out.println("In
tln("In MimeMethods-mime=="+mime);
public MimeMethods(MimeMessage message)
this.mime=message;
System.out.println("In
tln("In MimeMethods-mime=="+mime);
public static void main(String s[])
MimeMethods mimemethods=new MimeMethods();
mimemethods.getMime("c:\\mailsystem\\temp\\10324254583
7.MTXServer.N.R.296679");
//mimemethods.getMime("c:\\mailsystem\\temp\\103244492
365.MTXServer.A.U.549677");
boolean
boolean hasattachment=mimemethods.hasAttachments();
System.out.println("in-hasattachment----flag--"+hasatt
chment);
public boolean hasAttachments()
try
Object content = mime.getContent();
if (content instanceof Multipart)
System.out.println("In-hasAttachments-ifContent-11");
//attachmentFlag=true;
handleMultipart((Multipart)content);
else
System.out.println("In-hasAttachments-ifContent-22");
//attachmentFlag=false;
handlePart(mime);
catch(Exception e)
e.printStackTrace();
attachmentFlag=false;
return attachmentFlag;
public void handleMultipart(Multipart multipart)
rt) throws Exception
System.out.println("In
("In
MimeMethods-handleMultipart--multipart=="+multipart);
for (int i=0, n=multipart.getCount(); i<n;
); i<n; i++)
handlePart(multipart.getBodyPart(i));
public void handlePart(Part part) throws
ows Exception
System.out.println("In
("In MimeMethods-handlePart--part=="+part);
String disposition = part.getDisposition();
String contentType = part.getContentType();
try
if (disposition == null)
// When just body
// Check if plain
System.out.println("In-hasAttachments-ifContent-33");
if ((contentType.length() >= 10) &&
gth() >= 10) &&
(contentType.toLowerCase().substring(0,
10).equals("text/plain"))) {
System.out.println("In-hasAttachments-ifContent-44");
String st="";
st=(String)part.getContent();
// Check if html
}else if ((contentType.length() >= 9)
.length() >= 9) &&
(contentType.toLowerCase().substring(0,
9).equals("text/html"))) {
System.out.println("In-hasAttachments-ifContent-55");
String st="";
Object
Object
Object content=part.getContent();
//MimeMessage
//MimeMessage
//MimeMessage mm=(MimeMessage)part.getContent();
System.out.println("in
System.out.println("in handle
ndle
PArt--551--obj-content-content.getClass()"+content.getC
ass());
System.out.println("in
System.out.println("in handle
ndle
PArt--552--obj-content-part.getContentType()"+part.getC
ntentType());
if (content instanceof
if (content instanceof Multipart)
handleMultipart((Multipart)content);
st=(String)part.getContent();
} else
} else
} else if(contentType.equals("message/rfc822")){
System.out.println("In-hasAttachments-ifContent-66");
String str="";
MimeMessage
MimeMessage
MimeMessage mm=(MimeMessage)part.getContent();
Object content =
Object content = mm.getContent();
if (content instanceof
if (content instanceof Multipart)
handleMultipart((Multipart)content);
} else {
handlePart(mm);
} else { // Don't think this will
hink this will happen
System.out.println("In-hasAttachments-ifContent-661");
MimeBodyPart
MimeBodyPart bodyPartForword =
yPartForword = (MimeBodyPart)part;
Object content =
Object content =
content = bodyPartForword.getContent();
if (content instanceof
if (content instanceof Multipart) {
handleMultipart((Multipart)content);
else if
else if
(disposition.equalsIgnoreCase(Part.ATTACHMENT))
System.out.println("In-hasAttachments-ifContent-ATTACH
ENT---77");
attachmentFlag=true;
System.out.println("198 Other: " );
} else if
else if (disposition.equalsIgnoreCase(Part.INLINE)) {
System.out.println("In-hasAttachments-ifContent-88--IN
INE");
attachmentFlag=true;
System.out.println("203 Other: "
ntln("203 Other: " );
} else { // Should never happen
//System.out.println("Other: " +
println("Other: " + disposition);
catch(Exception e)
e.printStackTrace();
public String getFrom()
String mailFromData=null;
try
Address fromAddress[] = mime.getFrom();
for(int j=0;j<fromAddress.length; j++)
InternetAddress interAdd =
ress interAdd = (InternetAddress)fromAddress[j];
mailFromData = interAdd.getAddress();
catch(Exception e)
e.printStackTrace();
mailFromData="null";
return mailFromData;
public void setFrom(String fromId)
try
Address fromAddress=new
Address=new InternetAddress(fromId);
this.mime.setFrom(fromAddress);
catch(Exception e)
e.printStackTrace();
public void setSubject(String sub)
try
mime.setSubject(sub);
catch(Exception e)
e.printStackTrace();
public String getSubject()
String mailSubjectData=null;
try
mailSubjectData = mime.getSubject();
catch(Exception e)
e.printStackTrace();
mailSubjectData="null";
return mailSubjectData;
public String getSentDate()
String toPut=null;
try
java.util.Date sentDate =
sentDate = mime.getSentDate();
Calendar cal = Calendar.getInstance();
cal.setTime(sentDate);
sentDateLong=cal.getTimeInMillis();
Calendar caln = Calendar.getInstance();
caln.set(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH
,cal.get(Calendar.DATE),
cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE)
cal.get(Calendar.SECOND));
int year = caln.get(Calendar.YEAR);
int month = caln.get(Calendar.MONTH)+1;
int day = caln.get(Calendar.DATE);
int hour =
int hour = caln.get(Calendar.HOUR_OF_DAY);
int min = caln.get(Calendar.MINUTE);
int sec = caln.get(Calendar.SECOND);
String day1="";
if(cal.get(Calendar.DAY_OF_WEEK)== 1)
day1 ="Sun";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 2)
day1 ="Mon";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 3)
day1 ="Tue";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 4)
day1 ="Wed";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 5)
day1 ="Thu";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 6)
day1 ="Fri";
else if(cal.get(Calendar.DAY_OF_WEEK)==
OFWEEK)== 7)
day1 ="Sat";
toPut = new
toPut = new String(year+"-"+month+"-"+day+" "+day1+"
"+hour+":"+min+":"+sec);
catch(Exception e)
e.printStackTrace();
return toPut;
public String[] getToIds()
String toids[]=null;
try
Address recipientAddresses[] =
dresses[] =
mime.getRecipients(Message.RecipientType.TO);
if(recipientAddresses != null)
String recipientIDs[] = new
ientIDs[] = new String[recipientAddresses.length];
for(int j=0;
for(int j=0; j<recipientAddresses.length; j++)
InternetAddress iAdd =
ernetAddress iAdd =
(InternetAddress)recipientAddresses[j];
recipientIDs[j] =
recipientIDs[j] = iAdd.getAddress();
toids=recipientIDs;
return toids;
catch(Exception e)
e.printStackTrace();
return toids;
public String[] getCCIds()
String ccids[]=null;
try
Address ccAddresses[] =
ses[] = mime.getRecipients(Message.RecipientType.CC);
if(ccAddresses != null)
String recipientIDs[] = new
ientIDs[] = new String[ccAddresses.length];
for(int j=0; j<ccAddresses.length;
dresses.length; j++)
InternetAddress iAdd =
ernetAddress iAdd = (InternetAddress)ccAddresses[j];
recipientIDs[j] =
recipientIDs[j] = iAdd.getAddress();
ccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return ccids;
public String[] getBCCIds()
String bccids[]=null;
try
Address bccAddresses[] =
dresses[] =
mime.getRecipients(Message.RecipientType.BCC);
if(bccAddresses != null)
String recipientIDs[] = new
ientIDs[] = new String[bccAddresses.length];
for(int j=0; j<bccAddresses.length;
dresses.length; j++)
InternetAddress iAdd =
ernetAddress iAdd = (InternetAddress)bccAddresses[j];
recipientIDs[j] =
recipientIDs[j] = iAdd.getAddress();
bccids=recipientIDs;
catch(Exception e)
e.printStackTrace();
return bccids;
public void setBody(String bodyPart)
try
//String body=(String)mime.getContent();
mime.setText(bodyPart);
//body.concat("Your mail could not get
not get delivered to the recipient");
catch(Exception e)
e.printStackTrace();
/** By using this method the user will get the
the Content and the attachments
* for a mail/ Forwarded mail.
public boolean writeMime(String mailMessage,
ge, String receivers[],String senderId)
MimeMessage message=null;
try
System.out.println("In-EnQueuer--writeMime()");
String host = " ";
Properties props =
ies props = System.getProperties();
props.put("mail.smtp.host",host);
Session session =
n session = Session.getInstance(props, null);
FileOutputStream fos=new
eam fos=new
FileOutputStream("c://MTXServer//receiver//queue//mimef
lder"+"//"+System.currentTimeMillis());
message = new MimeMessage(session);
int size=receivers.length;
Address
Address
ess
address[]=InternetAddress.parse(ArrayToString(receivers
//message.setRecipients(Message.RecipientType.TO,addre
s);
message.setFrom(address[0]);
message.setSubject("Hello Avanish Sub for
ish Sub for Testing set in EnQueuer");
int
int
int num=(int)(System.currentTimeMillis()/100);
GregorianCalendar date=new
ar date=new GregorianCalendar();
message.setText(mailMessage);
//message.setSentDate();
message.writeTo(fos);
System.out.println("In-Dequeuer-after-Mime-message
age Id==" + message.getMessageID());
fos.close();
catch(Exception e)
System.out.println("Exception in Reading
in Reading file" + e);
return true;
public String ArrayToString(String receivers[])
String str=null;
StringBuffer strbuff=new StringBuffer();
int size=receivers.length;
for(int i = 0; i < size; i++)
strbuff.append(receivers);
return strbuff.toString();
public MimeMessage getMime(String filePath)
StringBuffer mailMessage = new
e = new StringBuffer();
MimeMessage message = null;
try
System.out.println("In-MimeMethods-getMime()-filePath-
" + filePath);
FileInputStream fis = new
m fis = new FileInputStream(filePath);
String host = " ";
Properties props =
ies props = System.getProperties();
props.put("mail.smtp.host", host);
Session session =
n session = Session.getInstance(props, null);
message = new MimeMessage(session, fis);
System.out.println("In-MimeMethods-getMime()-after-Mim
-message Id==" + message.getMessageID());
this.mime=message;
fis.close();
catch(Exception e)
e.printStackTrace();
return message;
public String getMailContent(String filePath)
StringBuffer mailMessage=new StringBuffer();
try
FileReader fread = new
fread = new FileReader(filePath);
BufferedReader br = new
er br = new BufferedReader(fread);
String s1;
while((s1 = br.readLine()) != null)
mailMessage.append(s1);
mailMessage.append("\n");
br.close();
fread.close();
catch(Exception e)
e.printStackTrace();
return new String(mailMessage);
//This is whatever i get when i am printing using
print statements.
*In-MimeMethods-getMime()-filePath--c:\mailsystem\temp
1032425458377.MTXServer.N.R.296679
In-MimeMethods-getMime()-after-Mime-message
Id==<[email protected]>
In-hasAttachments-ifContent-11
In
MimeMethods-handleMultipart--multipart==javax.mail.inte
net.MimeMultipart@b1c5fa
In
MimeMethods-handlePart--part==javax.mail.internet.MimeB
dyPart@971afc
In-hasAttachments-ifContent-33
In-hasAttachments-ifContent-55
in handle
PArt--551--obj-content-content.getClass()class
com.sun.mail.util.QPDecoderStream
in handle
PArt--552--obj-content-part.getContentType()text/html;
In
MimeMethods-handlePart--part==javax.mail.internet.MimeB
dyPart@e5855a
In-hasAttachments-ifContent-ATTACHMENT---77
198 Other:
in-hasattachment----flag--true
java.lang.ClassCastException:
com.sun.mail.util.QPDecoderStream
at
at MimeMethods.handlePart(MimeMethods.java:121)
at
at
at MimeMethods.handleMultipart(MimeMethods.java:89)
at
at
at MimeMethods.hasAttachments(MimeMethods.java:68)
at MimeMethods.main(MimeMethods.java:56) -
Getting attachments and emails need serious help!!
I am not sure if I am doing this right, but I am trying to receive emails from gmail, and I am having some serious problems. For some reason I get four emails and then I get a null exception. I have been through my code a dozen times and I cannot find the problem. Here is my code: try{
Properties props = new Properties();
props.setProperty("mail.pop3.socketFactory.class", SSL_FACTORY);
props.setProperty("mail.pop3.port", "995");
props.setProperty("mail.pop3.socketFactory.port", "995");
Session session = Session.getInstance(props, null);
Store store = session.getStore("pop3");
store.connect("pop.gmail.com", "jwheat3300", "carrie11");
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
int n=folder.getMessageCount();
attach = new String[n];
String select = "false";
String body = "";
for(int i=1; i<=n; i++)
Message message = folder.getMessage(i);
date2 = "3/2/2006";
from = message.getFrom()[0];
subject = message.getSubject();
attach="false";
Multipart multipart = (Multipart)message.getContent();
int j = multipart.getCount();
for(int l=0; l<j; l++)
Part part = multipart.getBodyPart(l);
disposition = part.getDisposition();
System.out.println(disposition);
if((disposition !=null) && ((disposition.equalsIgnoreCase(Part.ATTACHMENT) || disposition.equalsIgnoreCase(Part.INLINE))))
MimeBodyPart mbp = (MimeBodyPart)part;
if(mbp.isMimeType("text/plain"))
body = (String)mbp.getContent();
if(body==null)
body="";
bodies.add(new Body(body));
if(mbp.isMimeType("text/html"))
body = "This is an html email. Unable to display HELP";
bodies.add(new Body(body));
if(mbp.isMimeType("application/x-shockwave-flash"))
attach[i] = "true";
System.out.println(part.getContentType());
if(disposition == null)
MimeBodyPart mbp = (MimeBodyPart)part;
if(mbp.isMimeType("text/plain"))
body = (String)mbp.getContent();
if(body==null)
body="";
bodies.add(new Body(body));
attach[i] = "false";
if(mbp.isMimeType("text/html"))
body = "This is an html email. Unable to display HELP";
bodies.add(new Body(body));
attach[i] = "false";
inmails.add(new Inmail(select, from, subject, date2, attach[i]));
table.revalidate();
folder.close(false);
store.close();
}catch(Exception t)
System.err.println("Exception900: " +t.getMessage());
I get the body fine, and what I am trying to do is when I get all of my information is to put this into the inmails vector and then update my table. That works but I am only gettting four of thirty emails. Also when it comes to attachments do I need to set up a mime type for every possible attachment that will come? I need some serious help!I guess I am seriously confused then....I tried doing the tutorial from jguru on sun's site and this was how the code was set up. At least I think it is....I pretty much have no idea what I am doing. I mean the code as it stands will get the emails, and by the way this is for an application not for a server or anything. So should I check for it to be just plain text first and then find out if there is a multipart. There is not really any good tutorials that explain what it is I am trying to accomplish. Please help!
Maybe you are looking for
-
Incoming emails going to junk folder instead of inbox
i I have an iPad and every time my sister emails me it goes into the junk folder instead of the inbox. Is there a setting I need to change?
-
Find exact word in text file tht is present in an excel sheet
Hi all, i want to find words in an text file. but the criteria is i want to search words which r already listed in another excel sheet and change the color of these word. i used FileInputStream and also BufferedInputStream cany anyone help me with th
-
JEE5 Application Architecture Best Practice.
Hi Everybody I am going to redesign a moderate size application (not v big but larger then normal). Now I have few Question in my mind. I am using JSF as front-end, EJB3 Session Bean for Business Logic and last but not the least JPA as domain model.
-
Re: Broadband dropping regularly
I've recently had this problem (again). I've battled through the BT help support, and eventually get a 2nd stage report, when the 'engineer' tells me they will re-set my 'line profile'. This takes up to 48 hours. They did this Sunday and it went from
-
Troubles to open After Effects CC
Hi Everybody, I have some troubles to open After Effects and also Premiere pro CC actually. this is the error message : ALERTE AFTER EFFECTS last report: <140735212468576> <GPUManager> <2> Sniffer Result code 3 Here are some informations about my com