Ejb Injection to Spring from Jboss

Hi,

Here is how we lookup from Spring to jboss:

So let’s say we have Interface implemented in jboss:

com.DestBean

The jndi loopup: /DestBean/remote.

in Spring side:

1. Create a bean which trigger the method:

public class TriggerBean
{
	@Autowired
	DestBean destBean;

	public void test()
	{
		boolean result = destBean.setSomething(1, 2);
		System.out.println("the result is="+  result);
	}
}

Now let’s configure applicationContext.xml:




	
		
		java.naming.provider.url">serverhost:port
		java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
		java.naming.factory.url.pkgs=jboss.naming:org.jnp.interfaces
		
	

pay attention that business-interface attribute should have the value of the class-path of your remote interface placed in the target server.

And that’s it!

Idan.

[ad]

Related Articles:

(1597)

Be Sociable, Share!

Leave a Reply