Questions tagged [javax.activation]

21 questions
84
votes
6 answers

What is the replacement for javax.activation package in java 9?

Seems like javax.activation package is deprecated in Java 9. Oracle migration guide proposes to use --add-modules java.activation option during JVM start. However, I would like to avoid this and replace javax.activation package's classes, as it is…
Dmitriy Dumanskiy
  • 11,657
  • 9
  • 37
  • 57
13
votes
6 answers

Send email with javax.mail using an existing InputStream as attachment content

Is it possible to send an email using javax.mail and using an “existing” InputStream for the email message attachment content? Currently I am building the email message as follows: final MimeMessage message = new…
JamesCollett
  • 179
  • 1
  • 1
  • 7
12
votes
5 answers

converting DataHandler to byte[]

I need a code snippt for converting DataHandler to byte[]. This data handler contains Image.
Narendra
  • 5,635
  • 10
  • 42
  • 54
6
votes
1 answer

Can't send email using javamail and jdk 12

I used to send emails with javamail and Java 8. Now that I upgraded to Java 12 I get the java.lang.NoClassDefFoundError: javax/activation/DataHandler. I added the javax.activation-api-1.2.0.jar and now I get java.lang.NoClassDefFoundError:…
Gustavo
  • 1,332
  • 2
  • 16
  • 39
4
votes
1 answer

Control what DataContentHandler to use for a MimeMessage attachment?

I am creating an attachment to MimeMessage for a Tiff image with a byte array. ByteArrayOutputStream out = new ByteArrayOutputStream(); MimeBodyPart body = new MimeBodyPart(); body.setContent(tiffByteArray,…
JustinKSU
  • 4,875
  • 2
  • 29
  • 51
3
votes
0 answers

JavaX Activation Cannot Be Resolved

By following this example, I got the following inline message in Eclipse Java Oxygen. "The import javax.activation cannot be resolved" Documentation for JavaMail says this object is in JAF or moved into jakarta.activation but I don't understand how…
Brethlosze
  • 1,533
  • 1
  • 22
  • 41
3
votes
3 answers

Error in Sending mail by Java

My code is : // File Name SendEmail.java import java.util.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; public class SendEmail { public static void main(String [] args) { // Recipient's email ID…
M0εiπ
  • 263
  • 3
  • 10
1
vote
1 answer

Javax mail with Lift framework

I'm having a strange issue. I deploy my webapp to the server (jetty 7.4.3.v20110701), and everything (including mailer) seem to be working fine. Debugging info (got with -Djavax.activation.debug=true) for sending an email looks like…
George
  • 8,368
  • 12
  • 65
  • 106
1
vote
0 answers

Unable to fetch Email attachments or Multipart content using Camel-Mail in FuseESB / OSGI

I have created an osgi bundle with a pop3 camel route for reading mails. When deployed in servicemix 5.1, the attachments are getting read properly as expected. However, the same bundle gives problem in FuseEsb-7.1.0.fuse-047-1_2013. The contents…
1
vote
1 answer

Trying to send mail without user interaction: java.lang.NoClassDefFoundError: javax.activation.DataHandler

I'm trying to send a mail without user interaction. I created the following class: import java.util.Calendar; import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import…
Diego
  • 4,011
  • 10
  • 50
  • 76
0
votes
1 answer

Apache Camel 3.17 Adoptium JDK 17 Error IllegalAccessError: failed to access class registries.LogSupport from class javax.activation.MailcapCommandMap

`I have migrated Camel 3.20 to JDK 17 Adoptium. When calling ".unmarshal().mimeMultipart()" at the beginning of the route, the following error occurs. I am slowly running out of ideas. Stacktrace: 2023-03-21 10:18:24,915 [http-nio-8080-exec-303]…
0
votes
1 answer

Tomcat 10, Java 17 - JavaMailSender cannot cast one of elements of java.lang.Object[]

After migrating application to Spring Boot 3 and Java 17 I tried to deploy it to Tomcat 10.1.x. The deployment failed with exception: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailSender'…
Adam Sojka
  • 331
  • 2
  • 9
0
votes
0 answers

Apache Jmeter5.5 build code without runtime dependency com.sun.activation » javax.activation

I'm using Apache Jmeter 5.5 libraries to generate .jmx file & integrated with IDE. Recently my company found vulnerability in com.sun.activation » javax.activation >> 1.2.0 Jar file. Enterprise support team deleted this jar file from repository. My…
Shri
  • 1
0
votes
0 answers

Java selects library class file from java jdk but i need it to use library class file downloaded by adding maven dependency

The problem is I have javax.activation library in Java8JDK/Library and an updated javax.activation library added using maven dependency. While executing it uses library from Java8JDK/Library. How do I enforce it to use it from the library added…
0
votes
1 answer

Maven compilation error about missing javax/mail/mail/1.4/activation.jar. How to fix?

I have imported my maven project into eclipse. The project works with another eclipse on a different machine. I get the following compilation error: [ERROR] bad path element "/home/ps/.m2/repository/javax/mail/mail/1.4/activation.jar": no such file…
Adder
  • 5,708
  • 1
  • 28
  • 56
1
2