<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SmartDukaan &#x2013; /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/MailQueueAdapter.java</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Wed, 07 Oct 2026 02:57:48 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fmail%2FMailQueueAdapter.java&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fmail%2FMailQueueAdapter.java&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Mon, 31 Aug 2026 18:32:25 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37486 – mail: fix prod outage -- MailOutboxService must not implement MailQueue ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;mail: fix prod outage -- MailOutboxService must not implement MailQueue&lt;br /&gt;
&lt;br /&gt;
r37478 added &apos;implements MailQueue&apos; to MailOutboxService. That took down both&lt;br /&gt;
ROOT.war and profitmandi-web.war on the 18:19 deploy today; every route 404&apos;d&lt;br /&gt;
because neither Spring context would start.&lt;br /&gt;
&lt;br /&gt;
MailOutboxService has @Transactional methods, so Spring has to proxy it, and&lt;br /&gt;
@EnableTransactionManagement in both WebDBContextConfigure classes runs with the&lt;br /&gt;
default proxyTargetClass=false. While the class implemented no interface Spring&lt;br /&gt;
proxied it with a CGLIB subclass, which is still a MailOutboxService. Adding an&lt;br /&gt;
interface switched it to a JDK proxy implementing only MailQueue, so all 39&lt;br /&gt;
sites that inject the concrete MailOutboxService failed:&lt;br /&gt;
&lt;br /&gt;
  BeanNotOfRequiredTypeException: Bean named &apos;mailOutboxService&apos; is expected to&lt;br /&gt;
  be of type MailOutboxService but was actually of type com.sun.proxy.$Proxy1519&lt;br /&gt;
&lt;br /&gt;
The interface moves to a new MailQueueAdapter, which delegates to&lt;br /&gt;
MailOutboxService and carries no transactional annotations. MailQueueHolder and&lt;br /&gt;
EmailServiceImpl inject it by the MailQueue interface, so Utils.sendMail* and&lt;br /&gt;
EmailService still reach the outbox unchanged. MailOutboxService goes back to&lt;br /&gt;
implementing nothing, and its ~112 existing call sites are untouched.&lt;br /&gt;
&lt;br /&gt;
Chose this over proxyTargetClass=true, which would have flipped proxying for&lt;br /&gt;
every interface-implementing service in the app -- too broad for a hot fix.&lt;br /&gt;
&lt;br /&gt;
Verified with javap inside both built WARs: MailOutboxService declares no&lt;br /&gt;
interfaces, MailQueueAdapter implements MailQueue.&lt;br /&gt;
&lt;br /&gt;
Note for cron: it shares the dao jar, so a rebuild picks this up. Do not restart&lt;br /&gt;
cron on trunk without rebuilding it first.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/MailOutboxService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/mail/MailQueueAdapter.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fmail%2FMailQueueAdapter.java&amp;rev=37486</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fmail%2FMailQueueAdapter.java&amp;rev=37486</guid></item>
</channel></rss>