6 Replies Latest reply on Apr 6, 2011 8:39 AM by Leo van den berg

    Value of context variable is not an instance...can't figure out.

    Carvel Baus Newbie
      I am able to get my Ear to deploy fine. I can even send a message to the war (using a POJO) and get a response back to my flex client. When I try to send a message to my EJB, I get the following error:


      17:17:31,919 ERROR [[AMFMessageServlet]] Servlet.service() for servlet AMFMessageServlet threw exception
      java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: portletQueryService. If you are using hot deploy, you may have attempted to hot deploy a session or application-scoped component definition while using an old instance in the session...

      This error is from a cold startup and even after clearing the JBoss tmp and work directory, I still get it. I am not sure where the issue is - I am sure it is something small and ridiculous, but I am not seeing it.

      Any thoughts? Anyone see something in the log that I should be concerned about or indicative of this issue?

      Complete stack trace of error included:


      17:16:47,312 INFO  [FlexFilter] Registered Tide/Seam service factory and destination
      [2011-04-05 05:16:48,949] Artifact PortletEar: Artifact is deployed successfully
      17:16:48,935 INFO  [AMFMessageFilter] Using configuration: {closeStreams=true, inputBufferSize=null, outputBufferSize=null}
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.hotDeployFilter
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.redirectFilter
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.exceptionFilter
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.multipartFilter
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.identityFilter
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.granite.seam.flexFilter
      17:16:48,936 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.loggingFilter
      17:17:31,917 WARN  [Component] Exception calling component @Destroy method: portletQueryService
      java.lang.IllegalArgumentException: method not found: destroy for component: portletQueryService (check that it is declared on the session bean business interface)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2267)
              at org.jboss.seam.Component.callDestroyMethod(Component.java:2180)
              at org.jboss.seam.Component.destroy(Component.java:1469)
              at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
              at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
              at org.jboss.seam.contexts.ServletLifecycle.endRequest(ServletLifecycle.java:64)
              at org.granite.seam21.Seam21Interceptor.destroySeamContext(Seam21Interceptor.java:219)
              at org.granite.seam21.Seam21Interceptor.after(Seam21Interceptor.java:105)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.process(AMF3MessageProcessor.java:67)
              at org.granite.messaging.amf.process.AMF0MessageProcessor.process(AMF0MessageProcessor.java:78)
              at org.granite.messaging.webapp.AMFMessageServlet.doPost(AMFMessageServlet.java:59)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.granite.messaging.webapp.AMFMessageFilter.doFilter(AMFMessageFilter.java:117)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.NoSuchMethodException: org.javassist.tmp.java.lang.Object_$$_javassist_seam_3.destroy()
              at java.lang.Class.getMethod(Class.java:1605)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2246)
              ... 35 more
      17:17:31,918 ERROR [AMFMessageServlet] AMF message error
      java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: portletQueryService. If you are using hot deploy, you may have attempted to hot deploy a session or application-scoped component definition while using an old instance in the session.
              at org.jboss.seam.Component.getInstance(Component.java:2037)
              at org.jboss.seam.Component.getInstance(Component.java:1983)
              at org.jboss.seam.Component.getInstance(Component.java:1977)
              at org.jboss.seam.Component.getInstance(Component.java:1972)
              at org.granite.tide.seam.AbstractSeamServiceContext.findComponent(AbstractSeamServiceContext.java:218)
              at org.granite.tide.TideServiceInvoker.adjustInvokee(TideServiceInvoker.java:239)
              at org.granite.messaging.service.ServiceInvoker.invoke(ServiceInvoker.java:96)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.processRemotingMessage(AMF3MessageProcessor.java:136)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.process(AMF3MessageProcessor.java:59)
              at org.granite.messaging.amf.process.AMF0MessageProcessor.process(AMF0MessageProcessor.java:78)
              at org.granite.messaging.webapp.AMFMessageServlet.doPost(AMFMessageServlet.java:59)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.granite.messaging.webapp.AMFMessageFilter.doFilter(AMFMessageFilter.java:117)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:680)
      17:17:31,919 ERROR [AMFMessageFilter] AMF message error
      javax.servlet.ServletException: java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: portletQueryService. If you are using hot deploy, you may have attempted to hot deploy a session or application-scoped component definition while using an old instance in the session.
              at org.granite.messaging.webapp.AMFMessageServlet.doPost(AMFMessageServlet.java:66)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.granite.messaging.webapp.AMFMessageFilter.doFilter(AMFMessageFilter.java:117)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: portletQueryService. If you are using hot deploy, you may have attempted to hot deploy a session or application-scoped component definition while using an old instance in the session.
              at org.jboss.seam.Component.getInstance(Component.java:2037)
              at org.jboss.seam.Component.getInstance(Component.java:1983)
              at org.jboss.seam.Component.getInstance(Component.java:1977)
              at org.jboss.seam.Component.getInstance(Component.java:1972)
              at org.granite.tide.seam.AbstractSeamServiceContext.findComponent(AbstractSeamServiceContext.java:218)
              at org.granite.tide.TideServiceInvoker.adjustInvokee(TideServiceInvoker.java:239)
              at org.granite.messaging.service.ServiceInvoker.invoke(ServiceInvoker.java:96)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.processRemotingMessage(AMF3MessageProcessor.java:136)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.process(AMF3MessageProcessor.java:59)
              at org.granite.messaging.amf.process.AMF0MessageProcessor.process(AMF0MessageProcessor.java:78)
              at org.granite.messaging.webapp.AMFMessageServlet.doPost(AMFMessageServlet.java:59)
              ... 25 more
      17:17:31,919 ERROR [[AMFMessageServlet]] Servlet.service() for servlet AMFMessageServlet threw exception
      java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: portletQueryService. If you are using hot deploy, you may have attempted to hot deploy a session or application-scoped component definition while using an old instance in the session.
              at org.jboss.seam.Component.getInstance(Component.java:2037)
              at org.jboss.seam.Component.getInstance(Component.java:1983)
              at org.jboss.seam.Component.getInstance(Component.java:1977)
              at org.jboss.seam.Component.getInstance(Component.java:1972)
              at org.granite.tide.seam.AbstractSeamServiceContext.findComponent(AbstractSeamServiceContext.java:218)
              at org.granite.tide.TideServiceInvoker.adjustInvokee(TideServiceInvoker.java:239)
              at org.granite.messaging.service.ServiceInvoker.invoke(ServiceInvoker.java:96)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.processRemotingMessage(AMF3MessageProcessor.java:136)
              at org.granite.messaging.amf.process.AMF3MessageProcessor.process(AMF3MessageProcessor.java:59)
              at org.granite.messaging.amf.process.AMF0MessageProcessor.process(AMF0MessageProcessor.java:78)
              at org.granite.messaging.webapp.AMFMessageServlet.doPost(AMFMessageServlet.java:59)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.granite.messaging.webapp.AMFMessageFilter.doFilter(AMFMessageFilter.java:117)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:680)
        • 1. Re: Value of context variable is not an instance...can't figure out.
          Carvel Baus Newbie

          Forgot to mention that I am using Seam 2.2.0GA and JBoss AS 5. Here is what the EJB looks like:






          /**
           * User: baus
           * Date: 3/30/11
           * Time: 9:57 AM
           */
          
          @Name("portletQueryService")
          @Stateful
          @AutoCreate
          @Scope(ScopeType.EVENT)
          public class VMFPortletQueryServiceBean implements VMFPortletQueryServiceLocal, VMFPortletQueryServiceRemote {
          
          
              @In
              private EntityManager entityManager;
          
              @Out
              private List<ReissueCode> reissueCodes;
          
              @Out
              private List<VmfMessageSelection> messages;
          
              @Out
              private List<Address> addresses;
          
          
              // Reissue selection Screen
          
              public void loadReissueCodeList() {
          
          
              }
          
          
          
              public void loadMessageList(ReissueCode reissue) {
          
          
              }
          
          
          
              // URN Details
          
              public void loadURNDetails() {
          
              }
          
              public void updateURNDetails() {
          
          
              }
          
          
          
          
              public void updateAllowedSenders(){
          
           
              }
          
              @Remove @Destroy
              public void destroy(){
          
              }
              // Allowed Senders List.
          
          }




          • 2. Re: Value of context variable is not an instance...can't figure out.
            Leo van den berg Master

            Hi,


            I see this in your log:


            java.lang.NoSuchMethodException: org.javassist.tmp.java.lang.Object$$javassistseam3.destroy()


            Which means it is not the expected instance of class, can you show how you call the code and additionally: why are you using a statefull bean when you annotate it with a stateless event-scope?


            Leo

            • 3. Re: Value of context variable is not an instance...can't figure out.
              Carvel Baus Newbie

              Leo van den Berg wrote on Apr 06, 2011 04:19:


              Hi,

              I see this in your log:

              java.lang.NoSuchMethodException: org.javassist.tmp.java.lang.Object$$javassistseam3.destroy()

              Which means it is not the expected instance of class, can you show how you call the code and additionally: why are you using a statefull bean when you annotate it with a stateless event-scope?

              Leo


              I am calling it from a Flex client through GraniteDS. I can call a regular POJO just fine, but the EJB is problematic. Here is variable definition in Flex:




                      [In]
                      public var portletQueryService:Component;
              




              and here is the call:




                          portletQueryService.loadReissueCodeList(onResult, onFault);
              



              The two parameters are used by the locakl flex value object in the client and are removed before the actual call to the server is made, so this is a parameterless call despite what it looks like.


              As for the Scope variable, that was an experiment to see if it changed anything, but it didn't seem to have effect one way or the other - I have tried various scopes and none of them seem to make a difference.

              • 4. Re: Value of context variable is not an instance...can't figure out.
                Leo van den berg Master

                Hi,


                I also missed a subtle piece of text: You're using Seam 3, so you should ask there first.


                I can't help you with Flex. However I suspect you're using the Remote Interface of the bean and that will not work because Seam doesn't support remote interfaces.


                Leo

                • 5. Re: Value of context variable is not an instance...can't figure out.
                  Carvel Baus Newbie

                  Leo van den Berg wrote on Apr 06, 2011 07:51:


                  Hi,

                  I also missed a subtle piece of text: You're using Seam 3, so you should ask there first.

                  I can't help you with Flex. However I suspect you're using the Remote Interface of the bean and that will not work because Seam doesn't support remote interfaces.

                  Leo



                  Hmmm, I am actually using Seam 2.2.0 GA - not sure why there is a Seam 3 reference in the stack trace - I don't even have Seam 3 on my machine.


                  I am attempting to use the remote interface, which for a POJO worked fine - I didn't have trouble until the EJB got involved.

                  • 6. Re: Value of context variable is not an instance...can't figure out.
                    Leo van den berg Master

                    Hi,


                    you can interface with EJB through the remote interface, but you need an additional bean to talk with Seam. Seam intercepts all LOCAL calls, but can't do anything with the generated stubs for remote access.


                    Leo