8 Replies Latest reply on Aug 28, 2007 10:33 AM by Pete Muir

    Getting "Stack must not be null" error when running a test

    Jeff Mutonho Newbie

      The code for my test is :

      public class FindClaimTest extends SeamTest {
      
       @Test
       public void testFindUnregisteredClaims() throws Exception {
       new ComponentTest() {
      
       protected void testComponents() throws Exception {
       invokeMethod("#{registrationFinder.find}");
       }
      
       }.run();
       }
      }



      However, when this test runs , its failing with the message
      "javax.el.ELException: javax.ejb.EJBException: java.lang.IllegalArgumentException: Stack must not be null"



      The full stacktrace is shown below :

      javax.el.ELException: javax.ejb.EJBException: java.lang.IllegalArgumentException: Stack must not be null
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:338)
       at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
       at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
       at org.jboss.seam.mock.BaseSeamTest$ComponentTest.invokeMethod(BaseSeamTest.java:130)
       at com.introspect.scs.testclients.FindClaimTest$1.testComponents(FindClaimTest.java:13)
       at org.jboss.seam.mock.BaseSeamTest$ComponentTest.run(BaseSeamTest.java:156)
       at com.introspect.scs.testclients.FindClaimTest.testFindUnregisteredClaims(FindClaimTest.java:10)
      Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: Stack must not be null
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:193)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:105)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
       at $Proxy67.find(Unknown Source)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
       at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
       at org.javassist.tmp.java.lang.Object_$$_javassist_68.find(Object_$$_javassist_68.java)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
       ... 31 more
      Caused by: java.lang.IllegalArgumentException: Stack must not be null
       at org.jboss.seam.core.ConversationEntry.<init>(ConversationEntry.java:39)
       at org.jboss.seam.core.ConversationEntries.createConversationEntry(ConversationEntries.java:53)
       at org.jboss.seam.core.Manager.createConversationEntry(Manager.java:510)
       at org.jboss.seam.core.Manager.beginConversation(Manager.java:531)
       at org.jboss.seam.core.ConversationInterceptor.beginConversation(ConversationInterceptor.java:212)
       at org.jboss.seam.core.ConversationInterceptor.beginConversationIfNecessary(ConversationInterceptor.java:149)
       at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:55)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       ... 65 more



      Any pointers?


      Thanks


      jeff mutonho

        • 1. Re: Getting
          Jeff Mutonho Newbie

          Hi


          Please don't get me wrong , this is not a demand for a response.I just wanna
          get an idea why my post failed to induce a response ,i.e its a case of

          a) my post being unclear and problem not well explained?

          b) I didn't RTFM ?

          If that's the case how can I improve on this?


          Thank you

          • 2. Re: Getting
            Pete Muir Master

            Which Seam version?

            You just posted a non-trivial post and no one has had time to look at it so far (12 hours is a quick turnaround here ;)

            • 3. Re: Getting
              Jeff Mutonho Newbie

              :)

              Seam version : jboss-seam-2.0.0.BETA1

              Java version : 1.6

              • 4. Re: Getting
                Jeff Mutonho Newbie

                Changed the code to :

                @Test
                 public void testFindUnregisteredClaims() throws Exception {
                 new FacesRequest() {
                 @Override
                 protected void invokeApplication() {
                 invokeMethod("#{registrationFinder.find}");
                 }
                 }.run();
                 }



                and works

                • 5. Re: Getting
                  Pete Muir Master

                  Post the code for registrationFinder (this is working for me in a simple situation)

                  • 6. Re: Getting
                    Jeff Mutonho Newbie

                     

                    "pete.muir@jboss.org" wrote:
                    Post the code for registrationFinder (this is working for me in a simple situation)



                    @Name("registrationFinder")
                    @Stateful
                    public class RegistrationFinderBean implements RegistrationFinder {
                    
                     @Logger
                     private Log log;
                    
                     @SuppressWarnings("unused")
                     @DataModel
                     private List< Claim > unregisteredClaims;
                    
                     @SuppressWarnings("unused")
                     @DataModelSelection
                     private Claim claim;
                    
                     @In
                     private Session hibernateSession;
                    
                     @In(required=false)
                     private Date accidentDate;
                    
                     @SuppressWarnings("unchecked")
                     @Begin(join=true)
                     public String find() {
                     String queryString = "from Claim where dateRegistered is null";
                    
                     Query q = hibernateSession.createQuery(queryString);
                     List<Object> results = q.list();
                     unregisteredClaims = new ArrayList< Claim >(results.size());
                     for(Object result : results) {
                     unregisteredClaims.add((Claim) result);
                     }
                     return "/forms/registration/finder/finder";
                    
                     }
                    
                     @Remove @Destroy
                     public void destroy() { }
                    
                    }


                    • 7. Re: Getting
                      Pete Muir Master

                      Sorry, I need dependant classes as well.

                      • 8. Re: Getting
                        Pete Muir Master

                        s/dependant/referenced/