I have a bundle that has a service that sends email using javamail library in ISO-2022-JP encoding and a servlet that invokes this service to send emails. The bundle has mail-1.4.1.jar dependency defined in pom.xml. When I am hitting the servlet URL, email is sent properly.
when I hit this url, email is sent successfully.
But when I am trying to invoke the service directly in a form action POST.jsp, I am getting the following error:
javax.mail.NoSuchProviderException: smtp
at javax.mail.Session.getService(Session.java:794)
at javax.mail.Session.getTransport(Session.java:718)
at javax.mail.Session.getTransport(Session.java:661)
at javax.mail.Session.getTransport(Session.java:641)
at javax.mail.Session.getTransport(Session.java:696)
at javax.mail.Transport.send0(Transport.java:186)
at javax.mail.Transport.send(Transport.java:118)
Not sure why is this happening. What would be the difference in invoking the service from a servlet and POST.jsp. Please help me on this.
Solved! Go to Solution.
Views
Replies
Total Likes
your servlet may not be implmenting the sling SCR annotations .
http://sling.apache.org/documentation/the-sling-engine/servlets.html
there are two ways to do this ..
1) as a component .. where your servlet gets called all the time and you implement your logic in doPost()
2) write an osgi bundle and run it as a mail service to reference it later
- Venu Gummadala
Views
Replies
Total Likes
your servlet may not be implmenting the sling SCR annotations .
http://sling.apache.org/documentation/the-sling-engine/servlets.html
there are two ways to do this ..
1) as a component .. where your servlet gets called all the time and you implement your logic in doPost()
2) write an osgi bundle and run it as a mail service to reference it later
- Venu Gummadala
Views
Replies
Total Likes