Hi,
I want to autowire my EJB into Spring managed bean. EJBs are deployed on remote JBoss5. On Tomcat I managed to connect to JBoss, but got error:
Can anyone tell me how to get this EJB properly? I don't want to list every EJB explicitly in applicationContext.xml because I do have annotations. Is it possible to do without listing every EJB in some xml file?Code:org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'foo/SessionService' must be of type [foo.ejb.SessionService], but was actually of type [javax.naming.Reference]
Here is what I have now:
Code:<bean id="simpleJndiBeanFactory" class="org.springframework.jndi.support.SimpleJndiBeanFactory"> <property name="jndiEnvironment"> <props> <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop> <prop key="java.naming.factory.url.pkgs">org.jboss.naming.client</prop> <prop key="java.naming.provider.url">jnp://localhost:1099</prop> </props> </property> </bean> <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"> <property name="alwaysUseJndiLookup" value="true"/> <property name="jndiFactory" ref="simpleJndiBeanFactory"/> </bean> <context:component-scan base-package="foo.web" />


Reply With Quote
