Spring and ejb problem
bjorn.palmqvist Feb 14, 2012 3:15 AMHi,
We are using spring to lookup remote ejb:s by defining the remote-slsb tag in the spring context. Now when these beans get injected server crashes with a message that no EJB receivers are present. The lookup goes well, but spring closes the context before making the invocation, and hence no ejb context is present, only the default empty one that JBoss seems to provide as default.
I have tried to activate the expose-access-context="true" flag in the slsb definition, but then it seems that the JBoss gets stuck in some type of deadlock or something like that.
I have set up the environment the following way in the spring context.
{code:xml}
<jee:remote-slsb id="securityController" jndi-name="test/remote/MyBean!remote.MyBeanHome"
business-interface="remote.MyBeanBI"
home-interface="remote.MyBeanHome"
cache-home="true" lookup-home-on-startup="false" refresh-home-on-connect-failure="true" environment-ref="jndiProperties">
</jee:remote-slsb>
{code}
Where jndiProperties is defined as:
{code:xml}
<!-- Hack to get the true value as right type -->
<bean id="trueProvider" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="java.lang.Boolean" />
<property name="targetMethod" value="valueOf" />
<property name="argument" value="true" />
</bean>
<bean id="jndiProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<map>
<entry key="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory" />
<entry key="java.naming.provider.url" value="remote://localhost:4447" />
<entry key="jboss.naming.client.endpoint.name" value="JNDI-Endpoint" />
<entry key="jboss.naming.client.ejb.context" value-ref="trueProvider" />
</map>
</property>
</bean>
{code}
We are running on nightys of the Final version of JBoss, and using spring 3.1.
It feels like I am missing something here. Have anyone had a similar problem and has a solution for this?
BR
Björn