• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to Send Java mail

 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

We tried a Java mail program and ran it in Unix box and windows Machine it's working fine. I used SMTP protocol.

But when I tried to run the same from ORACLE JVM it's failing. Please assist me.

Exception we got:

java.lang.NullPointerException
at javax.activation.DataHandler.getCommand(DataHandler.java:480)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1104)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:865)
at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:254)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1114)
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1930)
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1911)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1611)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:537)




trans.sendMessage(this.message,this.message.getAllRecipients()); ----- Exactly Failing at this line

I loaded the Program in Schema using loadjava command and invoked from Pl/SQL. We tryed in DEV machine thats too worked fine. But in Production we are getting null pointer exception. Any Permission is missing ? Please assist us.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please assist us.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried a non-empty headerPart?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally we traced the issue and I like to share the information

"DataHandler exception is because of Attachment file", We tried without file attachment and it worked. I guess some firewall is running on the ORACLE Database.

Any other suggestions ?
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I missed where the Oracle database was involved in this problem. Could you explain that a bit more?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul,

I loaded the java mail Program in Schema using loadjava command and invoked from Pl/SQL.

So the code is running in the Oracle JVM.
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic