3 Replies Latest reply on Sep 20, 2010 6:34 AM by Leo van den berg

    Aysnchronous call and context destroy?

    Chun Shin Newbie

      Hi,


      I'm kind of puzzled why this is happening, but sometimes (not always), I see the following messages after the asynchronous call from a conversation scoped component to a stateless scoped component.




      2010-09-17 08:37:07,187 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin call
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.async.Asynchronous] executing: org.jboss.seam.async.AsynchronousInvocation$1@1782f03
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] destroying business process context
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] destroying conversation context
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] flushing server-side conversation context
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] flushing session context
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] destroying event context
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
      2010-09-17 08:37:07,203 DEBUG [org.jboss.seam.contexts.Contexts] destroying: timer





      Again, the odd thing is, this is happening when I have more than one project running in my server. I'm guessing it's because of the context destroy, but whenever I get the messages above, my asynchronous call fails.


      Can someone please explain me what's exactly happening here and how to work around this?


      Thanks for your time and help!

        • 1. Re: Aysnchronous call and context destroy?
          Chun Shin Newbie

          I've noticed that this is happening only with one particular project. I'm not exactly sure why this is happening. I've checked component names and there isn't any conflict. Any idea?

          • 2. Re: Aysnchronous call and context destroy?
            Chun Shin Newbie

            So, I'm getting an error like this:




            12:20:24,734 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
            org.jboss.seam.InstantiationException: Could not instantiate Seam component: asynchronousBean
                    at org.jboss.seam.Component.newInstance(Component.java:2144)
                    at org.jboss.seam.Component.getInstance(Component.java:2021)
                    at org.jboss.seam.Component.getInstance(Component.java:1983)
                    at org.jboss.seam.core.Events.raiseEvent(Events.java:77)
                    at org.jboss.seam.async.AsynchronousEvent$1.process(AsynchronousEvent.java:33)
                    at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
                    at org.jboss.seam.async.AsynchronousEvent.execute(AsynchronousEvent.java:27)
                    at org.jboss.seam.async.ThreadPoolDispatcher$RunnableAsynchronous.run(ThreadPoolDispatcher.java:142)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
                    at java.util.concurrent.FutureTask.run(FutureTask.java:123)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:168)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                    at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.naming.NameNotFoundException: AsynchronousAction not bound
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
                    at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
                    at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
                    at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
                    at javax.naming.InitialContext.lookup(InitialContext.java:351)
                    at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
                    at org.jboss.seam.Component.instantiate(Component.java:1364)
                    at org.jboss.seam.Component.newInstance(Component.java:2122)
                    ... 15 more



            • 3. Re: Aysnchronous call and context destroy?
              Leo van den berg Master

              Hi,


              use the create and destroy annotations on test-method and put a log.info inside those methods. In this way you can see the creation of the components to see if something goes wrong in the order the components are created/called.


              Leo