Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 43027
76
  • 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: 27211
87
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.
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic