Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issue the send attach Pdf file in Email. (Urgent).

843834Mar 2 2009 — edited Jul 14 2009
Hello folks, i have issue with attach pdf in e-mail using two lib´s: activation.jar and mail.jar. Currently using a platform SOA and am creating the serviceType, then a file don´t is local and yes by message, so far so good.



Already tried in several forums, but without success.



When send the message (pdf file), the program receive a type ContentType (application/octet-stream) and cause the MessageException, below:



MessageException - in Container:

Message: [B@79ffb7f7 /// the service received the pdf file

[09/03/02 12:22:45] ID=dev_ESBTest (info) application/octet-stream *///ContentType of message*

javax.mail.SendFailedException: Sending failed; *///Exception*

nested exception is:

javax.mail.MessagingException: IOException while sending message;

nested exception is:

**javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octet-stream**

at javax.mail.Transport.send0(Transport.java:219)

at javax.mail.Transport.send(Transport.java:81)

javax.mail.MessagingException: IOException while sending message;

nested exception is:

javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octet-stream

at com.sun.mail.smtp.SMTPTransport.sendMessage (SMTPTransport.java:353)

at javax.mail.Transport.send0 (Transport.java:164)

at javax.mail.Transport.send(Transport.java:81)

....



With this, it send the e-mail without attach......above my source simple source code.



ServiceType Code:
	protected void SendEmail(XQPart prt, String host, String from, String to) {

		// create some properties and get the default Session

		Properties props = System.getProperties();

		props.put("mail.smtp.host";, host);



		Session session = Session.getInstance(props, null);

		try {

			// create a message

			MimeMessage msg = new MimeMessage(session);

			msg.setFrom(new InternetAddress(from));

			InternetAddress[] address = { new InternetAddress(to) };

			msg.setRecipients(Message.RecipientType.TO, address);

			msg.setSubject("Test Subject.");

			MimeBodyPart bp1 = new MimeBodyPart();

			bp1.setText("Test Text.");

			MimeBodyPart bp2 = new MimeBodyPart();

			m_xqLog.logInformation(prt.getContentType());

			bp2.setContent(prt.getContent(), prt.getContentType());

			bp2.setFileName("teste.pdf";);

			Multipart mp = new MimeMultipart();

			mp.addBodyPart(bp1);

			mp.addBodyPart(bp2);

			msg.setContent(mp);

			msg.setSentDate(new Date());

			Transport.send(msg);

			System.out.println("Email sent successfully!");

		} catch (MessagingException mex) {

			mex.printStackTrace();

			Exception ex = null;

			if ((ex = mex.getNextException()) != null) {

				ex.printStackTrace();

			}

		}

	}
Anybody would can help me, please....

Thanks ....

Paulo Sampei.

Comments

862536
Hi,

I too would be interested to know the answer to this, as I have a request to provide a POC for a system which will service both internal and external customers logging into an APEX application, or possibly two separate APEX applications.

I do know of a number of successful installations which service both internal and external customers, but I'm not aware of the licensing considerations involved.

Thanks,
Graham
Udo
Hi Graham,

there had been another thread were Kris posted a clarification of the license terms for the APEX Listener. See {message:id=9714073}.

-Udo
862536
Thanks Udo - so the database license covers it. Problem solved!
mark.lancaster
Hi Udo

I don't think Kris's response addressed the issue of "internal business operations" at all.

You can use the APEX listener if you have a licensed database; this is the same as using Oracle Application Server for zero cost provided it physically resides on the same server as the database.

However the APEX listener license specifies you can use it for "internal business operations". This restriction does not exist for Oracle AS.

This is the part that needs clarification.

Regards

Mark
Udo
Hi Mark,

I think this is a misunderstanding. What you are referring to is the OTN license. When I use the one linked at the APEX Listener OTN home page, I get the same agreement as I get for APEX ([url http://www.oracle.com/technetwork/licenses/app-express-lic-152009.html]ORACLE TECHNOLOGY NETWORK DEVELOPMENT AND DISTRIBUTION LICENSE AGREEMENT TERMS FOR ORACLE APPLICATION EXPRESS). This is the only licensing documentation I could find at all.
I don't think Kris' response was in respect to the APEX OTN License, but a general answer, as the question was aimed at a "production site" - which can't be used with any OTN License I know of, including Oracle AS.

Perhaps I oversaw or misunderstood something here. If you have any hint on what other terms you've based your judgement on, please let me know.

Thanks,

Udo

P.S.: The Licensing Information in the downloaded package actually includes a slightly different version, but still OTN license information only. I think this document is outdated, as it also still contains the EA-license, which shouldn't apply to the current release anymore.
Thinking of that, there seems to be a need to update the downloadable package...

Edited by: Udo on 29.11.2011 08:31
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 11 2009
Added on Mar 2 2009
7 comments
4,334 views