7 Replies Latest reply on Jun 24, 2009 12:29 AM by James Cain

    @Spring injection problem

    James Cain Newbie

      Hello

      I'm using JBoss 5.1.0-CR and Spring-Deploy 3.1. I've followed the documentation on how to setup the Spring Deployer with jbossAS5, but I get an exception "ClassCastException' when I try to retrieve my pojo.

      My setup:

      shout.jar
       com/../../
      
       META-INF/
       jboss-spring.xml
       persistence.xml
       ejb-jar.xml
      



      This is my ear setup shout.ear.
      shout.ear
       shout.war
       shout.jar
       lib/
       ...jar
       jboss-seam.jar
      


      When I deploy my ear (shout.ear) I see that the beans in my jboss-spring.xml file are loaded.

      13:55:17,564 INFO [NamedXmlApplicationContext] Refreshing org.jboss.spring.factory.NamedXmlApplicationContext@125a5e9: display name [org.jboss.spring.factory.NamedXmlApplicationContext@125a5e9]; startup date [Sat Jun 13 13:55:17 MDT 2009]; root of context hierarchy
      13:55:17,624 INFO [NamedXmlBeanDefinitionReader] Loading XML bean definitions from URL [vfszip:/opt/jboss-5.1.0.CR1/server/default/deploy/shout-ear-1.0.ear/shout-ejb-1.0.jar/META-INF/jboss-spring.xml]
      13:55:18,985 INFO [NamedXmlApplicationContext] Bean factory for application context [org.jboss.spring.factory.NamedXmlApplicationContext@125a5e9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1581c9b
      13:55:19,466 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1581c9b: defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,jbossJndiTemplate,activemq,messagePublisherFactory]; root of factory hierarchy
      


      but when I try to retrieve my pojo via the @Spring I get the following exception
      javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: java.lang.ClassCastException: Object at 'shout-ear-1.0' in context {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces} is not an instance of [class=org.springframework.beans.factory.BeanFactory classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={}] object class is [class=org.jnp.interfaces.NamingContext classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={interface=javax.naming.event.EventContext classloader=null, interface=java.io.Serializable classloader=null}]
       javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
       com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       javax.faces.component.UICommand.broadcast(UICommand.java:387)
       org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
       org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
       org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
       com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      javax.ejb.EJBTransactionRolledbackException: java.lang.ClassCastException: Object at 'shout-ear-1.0' in context {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces} is not an instance of [class=org.springframework.beans.factory.BeanFactory classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={}] object class is [class=org.jnp.interfaces.NamingContext classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={interface=javax.naming.event.EventContext classloader=null, interface=java.io.Serializable classloader=null}]
       org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)
       org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
       org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:415)
       org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:85)
       org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
       $Proxy572.invoke(Unknown Source)
       org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
       org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
       $Proxy1382.register(Unknown Source)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
       org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
       org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       org.javassist.tmp.java.lang.Object_$$_javassist_seam_5.register(Object_$$_javassist_seam_5.java)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
       org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
       org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
       org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
       org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
       com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       javax.faces.component.UICommand.broadcast(UICommand.java:387)
       org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
       org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
       org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
       com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      java.lang.RuntimeException: java.lang.ClassCastException: Object at 'shout-ear-1.0' in context {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces} is not an instance of [class=org.springframework.beans.factory.BeanFactory classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={}] object class is [class=org.jnp.interfaces.NamingContext classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={interface=javax.naming.event.EventContext classloader=null, interface=java.io.Serializable classloader=null}]
       org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1123)
       org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1133)
       org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1144)
       org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:93)
       org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
       org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
       org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
       org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
       org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:415)
       org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:85)
       org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
       $Proxy572.invoke(Unknown Source)
       org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
       org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
       $Proxy1382.register(Unknown Source)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
       org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
       org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       org.javassist.tmp.java.lang.Object_$$_javassist_seam_5.register(Object_$$_javassist_seam_5.java)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
       org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
       org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
       org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
       org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
       com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       javax.faces.component.UICommand.broadcast(UICommand.java:387)
       org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
       org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
       org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
       com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      java.lang.ClassCastException: Object at 'shout-ear-1.0' in context {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces} is not an instance of [class=org.springframework.beans.factory.BeanFactory classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={}] object class is [class=org.jnp.interfaces.NamingContext classloader=BaseClassLoader@1e4e3e4{vfsfile:/opt/jboss-5.1.0.CR1/server/default/conf/jboss-service.xml} interfaces={interface=javax.naming.event.EventContext classloader=null, interface=java.io.Serializable classloader=null}]
       org.jboss.util.naming.Util.checkObject(Util.java:338)
       org.jboss.util.naming.Util.lookup(Util.java:223)
       org.jboss.util.naming.Util.lookup(Util.java:182)
       org.jboss.spring.support.SpringInjectionSupport.getObjectFromBeanFactory(SpringInjectionSupport.java:131)
       org.jboss.spring.support.SpringInjectionSupport.injectToField(SpringInjectionSupport.java:190)
       org.jboss.spring.support.SpringInjectionSupport.inject(SpringInjectionSupport.java:77)
       org.jboss.spring.callback.SpringLifecycleInterceptor.postConstruct(SpringLifecycleInterceptor.java:45)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.ejb3.interceptors.aop.LifecycleCallbackInterceptorMethodInterceptor.invoke(LifecycleCallbackInterceptorMethodInterceptor.java:80)
       org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
       org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
       org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:194)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
       org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:194)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
       org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:194)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
       org.jboss.seam.persistence.EntityManagerProxyInterceptor.postConstruct(EntityManagerProxyInterceptor.java:44)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
       org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:194)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
       org.jboss.seam.persistence.HibernateSessionProxyInterceptor.postConstruct(HibernateSessionProxyInterceptor.java:45)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
       org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:194)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.RootInterceptor.invokeAndHandle(RootInterceptor.java:84)
       org.jboss.seam.intercept.SessionBeanInterceptor.postConstruct(SessionBeanInterceptor.java:114)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.ejb3.interceptors.aop.LifecycleCallbackInterceptorMethodInterceptor.invoke(LifecycleCallbackInterceptorMethodInterceptor.java:80)
       org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
       org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
       org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_31777764.invoke(InvocationContextInterceptor_z_setup_31777764.java)
       org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
       org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
       org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
       org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1119)
       org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1133)
       org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1144)
       org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:93)
       org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
       org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
       org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
       org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
       org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:415)
       org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:85)
       org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
       org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
       $Proxy572.invoke(Unknown Source)
       org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
       org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
       $Proxy1382.register(Unknown Source)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
       org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
       org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       org.javassist.tmp.java.lang.Object_$$_javassist_seam_5.register(Object_$$_javassist_seam_5.java)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       java.lang.reflect.Method.invoke(Method.java:597)
       org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
       org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
       org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
       org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
       org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
       com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       javax.faces.component.UICommand.broadcast(UICommand.java:387)
       org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
       org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
       org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
       com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      


      This is the code in my Stateless Bean:

      @Stateless
      @Name("register")
      @Interceptors(SpringLifecycleInterceptor.class)
      public class RegisterManagerBean implements RegisterManagerRemote {
      
       private final Logger log = Logger.getLogger(this.getClass());
      
       @In
       UnverifiedUser unverifiedUser;
      
       private MessagePublisher registrationPublisher;
      
       @Spring(jndiName = "shout-ear-1.0", bean = "messagePublisherFactory")
       private MessagePublisherFactory messagePublisherFactory;
      


      This is the jboss-spring.xml file:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"
       default-init-method="init">
      
       <description>BeanFactory=(shout)</description>
      
       <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
       <property name="brokerURL" value="tcp://localhost:61616" />
       </bean>
      
      
       <bean id="messagePublisherFactory" class="com.digitmind.messaging.camel.CamelPublisherFactory">
       <property name="jmsComponent" ref="activemq" />
       </bean>
      
      </beans>
      


      It appears that for the JNDI object I'm using a 'java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory' but the @Spring is looking for a 'org.springframework.beans.factory.BeanFactory'. I feel like I'm overlooking something in my setup. Any help is greatly appreciated.

      Thanks