Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error in tmailsend

Dears,
I am getting this below error when i use component tsendmail in my job, without this component my job is running successfully. Can anyone help me in this regard.
Regards,
Ram
Error:

Starting job J_REP_EN at 14:05 20/03/2009.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "(", Expression expected after this token
Syntax error on token "(", Expression expected after this token
Syntax error on token "(", Expression expected after this token
Syntax error on token "(", Expression expected after this token
Syntax error on token "Support", invalid AssignmentOperator
at intel_support_sites.j_rep_en_0_1.J_REP_EN.tOracleInput_4Process(J_REP_EN.java:6149)
at intel_support_sites.j_rep_en_0_1.J_REP_EN.runJobInTOS(J_REP_EN.java:11122)
at intel_support_sites.j_rep_en_0_1.J_REP_EN.main(J_REP_EN.java:10953)
Job J_REP_EN ended at 14:05 20/03/2009.
Labels (3)
4 Replies
Anonymous
Not applicable
Author

Hello Ram
There is a compilation error in code, go to the 'Code' tab and you will see what's the error.

Best regards

shong
Anonymous
Not applicable
Author

hello
I have the exact same error while using tSendMail in TOS 3.0.2
the same component is working fine on TOS 2.3.3 with same arguments
isn't there a bug with this tSendmail component in TOS 3.0.2 ?
Starting job Prepa_GASPAR at 11:11 28/05/2009.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "(", Expression expected after this token
Syntax error on token "(", Expression expected after this token
Syntax error on token "(", Expression expected after this token
Syntax error on token "(", Expression expected after this token
at edifice_gaspar.prepa_gaspar_0_1.Prepa_GASPAR.tSendMail_2Process(Prepa_GASPAR.java:2217)
at edifice_gaspar.prepa_gaspar_0_1.Prepa_GASPAR.tMSSqlInput_1Process(Prepa_GASPAR.java:1987)
at edifice_gaspar.prepa_gaspar_0_1.Prepa_GASPAR.tFileCopy_1Process(Prepa_GASPAR.java:372)
at edifice_gaspar.prepa_gaspar_0_1.Prepa_GASPAR.runJobInTOS(Prepa_GASPAR.java:3085)
at edifice_gaspar.prepa_gaspar_0_1.Prepa_GASPAR.main(Prepa_GASPAR.java:2974)
Job Prepa_GASPAR ended at 11:11 28/05/2009.
code is :
start
*/

currentComponent="tSendMail_2";

String message_tSendMail_2 = (("Hello")==null || "".equals("Hello"))?"\"\"" 0683p000009MPcz.png"Hello") ;
java.util.Properties props_tSendMail_2 = System.getProperties();
props_tSendMail_2.put("mail.smtp.host", smtpHost_tSendMail_2);
props_tSendMail_2.put("mail.smtp.port", smtpPort_tSendMail_2);

props_tSendMail_2.put("mail.smtp.auth", "false");
javax.mail.Session session_tSendMail_2 = javax.mail.Session.getInstance(props_tSendMail_2, null);
javax.mail.Message msg_tSendMail_2 = new javax.mail.internet.MimeMessage(session_tSendMail_2);
msg_tSendMail_2.setFrom(new javax.mail.internet.InternetAddress(from_tSendMail_2));
msg_tSendMail_2.setRecipients(javax.mail.Message.RecipientType.TO,javax.mail.internet.InternetAddress.parse(to_tSendMail_2, false));
if(cc_tSendMail_2!=null) msg_tSendMail_2.setRecipients(javax.mail.Message.RecipientType.CC, javax.mail.internet.InternetAddress.parse(cc_tSendMail_2, false));
if(bcc_tSendMail_2!=null) msg_tSendMail_2.setRecipients(javax.mail.Message.RecipientType.BCC, javax.mail.internet.InternetAddress.parse(bcc_tSendMail_2, false));

msg_tSendMail_2.setSubject(subject_tSendMail_2);
for (int i_tSendMail_2 = 0; i_tSendMail_2 < headers_tSendMail_2.size(); i_tSendMail_2++) {
java.util.Map<String, String> header_tSendMail_2 = headers_tSendMail_2.get(i_tSendMail_2);
msg_tSendMail_2.setHeader(header_tSendMail_2.get("KEY"), header_tSendMail_2.get("VALUE"));
}

msg_tSendMail_2.setSentDate(new Date());
javax.mail.Multipart mp_tSendMail_2 = new javax.mail.internet.MimeMultipart();
javax.mail.internet.MimeBodyPart mbpText_tSendMail_2 = new javax.mail.internet.MimeBodyPart();
mbpText_tSendMail_2.setText(message_tSendMail_2);
mp_tSendMail_2.addBodyPart(mbpText_tSendMail_2);

for(int i_tSendMail_2 = 0; i_tSendMail_2 < attachments_tSendMail_2.size(); i_tSendMail_2++)
{
String filename_tSendMail_2 = attachments_tSendMail_2.get(i_tSendMail_2);
javax.mail.internet.MimeBodyPart mbpFile_tSendMail_2 = new javax.mail.internet.MimeBodyPart();


javax.activation.FileDataSource fds_tSendMail_2 = new javax.activation.FileDataSource(filename_tSendMail_2 );
mbpFile_tSendMail_2.setDataHandler(new javax.activation.DataHandler(fds_tSendMail_2));
mbpFile_tSendMail_2.setFileName(fds_tSendMail_2.getName());
mp_tSendMail_2.addBodyPart(mbpFile_tSendMail_2);
}

// -- set the content --
msg_tSendMail_2.setContent(mp_tSendMail_2);

// -- Send the message --
javax.mail.Transport.send(msg_tSendMail_2);

/**
* stop
c0utta
Creator
Creator

dcopp,
I'm fairly confident that it's related to the message part of the component - you have made an error in the Java code :
(("Hello")==null || "".equals("Hello"))?"\"\""sad"Hello")
Possibly the 3rd closing bracket I've highlighted. If not, please post a screenshot.
Cheers,
c0utta
Anonymous
Not applicable
Author

I had the same error. We must put quotation marks even if the string is empty. (Example for Bcc "").