1 Reply Latest reply on Mar 14, 2008 10:18 AM by David Glazier

    Email from the ejb layer

    David Glazier Newbie

      I've been trying to email from (anywhere) in my ejb layer. Tried Javax.mail and even tried spring, but have not had any success. If anyone has some sample code to accomplish this I would be grateful.

      The app is a web service using xfire with the ejb layer (full of stateless, message driven, and management beans) added as a jar to the deployed ear all packaged up using maven2.


        • 1. Re: Email from the ejb layer
          David Glazier Newbie

          Sorry for the vagueness of this post. I think I was throwing the hook in the water with no bait on it to see what would appear showing my frustration. It occurred to me after this post that the request that comes in via the web service is persisted to the database (postgres) via EntityManager, then the information is pushed to a mainframe, then the response from the mainframe is updated to the database and returned to the client. So this whole transactional flow was disrupted when I tried to email (some alert because who knows how that legacy system is going to respond). Hibernate had its grip on the request object and threw all sorts of transaction errors when I tried to send and email. So I put the alert on a JMS queue spawning an asynchronous thread to take care of the notification. Response time is a huge requirement from the client and this pulled it out of the "flow". Again sorry for the lack of information.