Are you talking about having an EJB call itself. If so, yes. As for how, I'm working on that now. I'm working on having an EJB basically call itself in order to enclose a transaction. I'm not done w/it yet though.
By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Originally posted by rameshmca rk: Is it possible to create EJB and make look up in the same machine?
You mean you want to lookup a bean(deployed in a JVM) from a client which resides in the same JVM? That's what local interfaces are meant for. As far as the code is concerned, it would be the same as the one you would use to lookup a remote bean - only the jndi name needs to be changed to the name at which the localhome is bound.
thank you jaikiran, you have said a bean can call itself.How can we look up localhome using JNDI name inside the main method client?Could you give me the complete code for look up with property setting?
I hope this code snippet would help you up for calling local interface from JBOSS AS
See there are two ways for jndi setting. You can put jndi.properties file in you classpath or you can hard code jndi values in code. First approach is the good practice and easier to maintain code values.
If you have deployed your bean on other Application server other Jboss then you need to pass those interface values and context factory setting while doing jndi lookup.
I hope above code would give you more insight for calling ejb...
Cheers !!! Sumit Malik
If at first you don't succeed, don't try skydiving