Issue 1:
Holger Engels opened SPR-638 and commented

"GenerateLetters.java:42" calls SessionFactoryUtils.getSession(), before the adviced method "ProfileBuilderLogicSupport.java:542" is called. Problem: SessionFactoryUtils looks up the Session with SessionHolder.DEFAULT_KEY, though the Session is stored with the current transaction as key.

java.lang.NullPointerException

at org.springframework.orm.hibernate.HibernateTemplate.createQuery(HibernateTemplate.java:836)

at org.springframework.orm.hibernate.HibernateTemplate$25.doInHibernate(HibernateTemplate.java:469)

at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:200)

at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:220)

at org.springframework.orm.hibernate.HibernateTemplate.find(HibernateTemplate.java:467)

at wilken.openshop.modules.eprofiler.dao.support.hibernate.EProfilerDaoSupport.getFavoritAttributesForBp(EProfilerDaoSupport.java:103)

at wilken.openshop.modules.eprofiler.logic.support.ProfileBuilderLogicSupport.getAllFavoriteAttributes(ProfileBuilderLogicSupport.java:691)

at wilken.openshop.modules.eprofiler.logic.support.ProfileBuilderLogicSupport.getEmptyFavoriteTree(ProfileBuilderLogicSupport.java:527)

at wilken.openshop.modules.eprofiler.logic.support.ProfileBuilderLogicSupport.getFilledFavoriteTree(ProfileBuilderLogicSupport.java:542)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)

at $Proxy4.getFilledFavoriteTree(Unknown Source)

at wilken.openshop.modules.ecampaign.logic.support.CampaignContentBuilderSupport.getFavoriteTree(CampaignContentBuilderSupport.java:384)

at wilken.openshop.modules.ecampaign.logic.support.CampaignContentBuilderSupport.buildContent(CampaignContentBuilderSupport.java:236)

at wilken.openshop.modules.ecampaign.campaign.GenerateLetters.getLocalizedContentItems(GenerateLetters.java:74)

at wilken.openshop.modules.ecampaign.campaign.GenerateLetters.createNewsletter(GenerateLetters.java:65)

at wilken.openshop.modules.ecampaign.campaign.GenerateLetters.execute(GenerateLetters.java:42)

at org.concern.controller.Controller.execute(Controller.java:725)

at org.concern.controller.Controller.process(Controller.java:642)

at org.concern.controller.Controller.process(Controller.java:608)

at org.concern.controller.Controller.timeout(Controller.java:198)

at org.concern.controller.Controller$TimeoutTask.run(Controller.java:1131)

at java.util.TimerThread.mainLoop(Timer.java:432)

at java.util.TimerThread.run(Timer.java:382)

Affects: 1.1.1

Issue Links:

#5382 HibernateTemplate.checkWriteOperationAllowed > NullPointerException ("is duplicated by")

Issue 2:
John Hampton opened SPR-4138 and commented

A MailSendException created with the MailSendException(String msg) constructor throws a NPE when printStackTrace is called.

java.lang.NullPointerException

at org.springframework.mail.MailSendException.printStackTrace(MailSendException.java:149)

at org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:59)

at org.apache.log4j.spi.LoggingEvent.getThrowableStrRep(LoggingEvent.java:342)

at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:304)

at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)

at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)

at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)

at org.apache.log4j.Category.callAppenders(Category.java:203)

at org.apache.log4j.Category.forcedLog(Category.java:388)

at org.apache.log4j.Category.log(Category.java:853)

at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:193)

at com.cleanoffer.mylistings.impl.Emailer.sendUploadConfirmation(Emailer.java:51)

at com.cleanoffer.mylistings.impl.EmailerTest.testSendUploadConfirmation_withSendException(EmailerTest.java:38)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at org.jmock.core.VerifyingTestCase.runBare(VerifyingTestCase.java:39)

at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Affects: 2.5 final

Issue Links:

#8852 NullPointerException thrown from MailSendException if particular constructors are used. ("is duplicated by")

#8875 NullPointerException in MailSendException ("is duplicated by")

#9505 MailSendException is prone to Null Pointer Exceptions ("is duplicated by")

#9090 MailSendException.getMessage will result in NPE ("is duplicated by")

#9095 NullPointerException in org.springframework.mail.MailSendException ("is duplicated by")

#8726 MailSendException created with Map of SmartMimeMessages and SendExceptions is not serializable but not transient