3 Replies Latest reply on Oct 5, 2009 12:51 PM by Tommy Key

    Calling Renderer.render twice throws NPE in testing

    Abram Thielke Newbie

      I'm upgrading from Seam 2.0.1.GA to 2.1.0.GA and I'm having issues with Seam mail in testing.  Some of our methods call Renderer.render( ... ) multiple times inside the same method.  This works fine when I deploy the app, however in testing I get a NullPointerException.  I modified the mail example packaged with Seam 2.1 to call render twice from the MailExample.send method and I get the same thing:


         [testng] ERROR [org.jboss.seam.example.mail.MailExample] Error sending mail
         [testng] java.lang.NullPointerException
         [testng]      at org.jboss.seam.ui.facelet.RendererRequest.init(RendererRequest.java:49)
         [testng]      at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:72)
         [testng]      at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)
         [testng]      at org.jboss.seam.example.mail.MailExample.send(MailExample.java:41)
         [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         [testng]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         [testng]      at java.lang.reflect.Method.invoke(Method.java:585)
         [testng]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
         [testng]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
         [testng]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
         [testng]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
         [testng]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
         [testng]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
         [testng]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
         [testng]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
         [testng]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
         [testng]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
         [testng]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
         [testng]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
         [testng]      at org.jboss.seam.example.mail.MailExample_$$_javassist_5.send(MailExample_$$_javassist_5.java)
         [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         [testng]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         [testng]      at java.lang.reflect.Method.invoke(Method.java:585)
         [testng]      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
         [testng]      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
         [testng]      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
         [testng]      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
         [testng]      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request.invokeMethod(AbstractSeamTest.java:464)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request.invokeAction(AbstractSeamTest.java:473)
         [testng]      at org.jboss.seam.example.mail.test.MailTest$12.invokeApplication(MailTest.java:647)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request.invokeApplicationPhase(AbstractSeamTest.java:647)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:596)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request.access$300(AbstractSeamTest.java:178)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:498)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
         [testng]      at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
         [testng]      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
         [testng]      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
         [testng]      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
         [testng]      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
         [testng]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
         [testng]      at org.jboss.seam.mock.AbstractSeamTest$Request.run(AbstractSeamTest.java:492)
         [testng]      at org.jboss.seam.example.mail.test.MailTest.testDoubleRender(MailTest.java:633)
         [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         [testng]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         [testng]      at java.lang.reflect.Method.invoke(Method.java:585)
         [testng]      at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
         [testng]      at org.testng.internal.Invoker.invokeMethod(Invoker.java:470)
         [testng]      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
         [testng]      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
         [testng]      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
         [testng]      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
         [testng]      at org.testng.TestRunner.runWorkers(TestRunner.java:678)
         [testng]      at org.testng.TestRunner.privateRun(TestRunner.java:624)
         [testng]      at org.testng.TestRunner.run(TestRunner.java:495)
         [testng]      at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
         [testng]      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
         [testng]      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
         [testng]      at org.testng.SuiteRunner.run(SuiteRunner.java:190)
         [testng]      at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
         [testng]      at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
         [testng]      at org.testng.TestNG.run(TestNG.java:699)
         [testng]      at org.testng.TestNG.privateMain(TestNG.java:824)
         [testng]      at org.testng.TestNG.main(TestNG.java:802)
      



      I am calling installMockTransport() from the tests before this gets run.  Is this a known issue?  This worked fine in 2.0.1.GA.