Mark Garland wrote:Hi Kengkaj,
Thank you for your reply.
What I meant by my original question, is how is a client identified by the container?
i.e. a 2nd request comes in from a client - how does the container know which object is theirs?
There must be some id somewhere.
Thanks,
MG
jim li wrote:in a application or container managed entity manager with persistenctype = extended, if a entity is deleted, is it detached? if it is dettached, is there a way to reattached it back
Jerwin Louise Uy wrote:Hi Dhiren,
Yes. That will cause the error because the deployment descriptor is wrong.
Here is the modified ejb-jar.xml
Regards.
Jerwin Louise Uy wrote:Hi,
I will try to answer your questions the best as I can.
1. The default name of a session bean is the fully qualified class that it implements, i.e. SessionBean implements Foo.SomeRemoteInterface then that name attribute of SessionBean is bound to Foo.SomeRemoteInterface
2. mappedName bounds that session bean to a global variable in the RMI registry, but not all application server vendors are required to support this functionality
3. See #2 Assigning a mappedName may break portability across different application server vendors
4. See #1 - You can perform that following (assuming no ejb-jar.xml is used and default annotation values), then you can do the following
5. ejb-ref is that bound name for the session bean
For the purpose of SessionContext, you do not need to access this directly. If you really want to, the you can to modify the ejb-jar.xml to include the following information -
This deployment descriptor simply injects a session bean that implements the remote interface, bind to the the value of ejb-ref-name. Therefore, you can do the lookup on the SessionContext. I should note that the SessionContext is not aware of any global variables except for the ones declared in the ejb-jar.xml
I hope this information helps.
Mohammad Rezwan wrote:I got really puzzled about JNDI lookup for local interface in Glassfish2u2.
Whenever I call remote interface like
InitialContext ctx = new InitialContext(); TestingRemote testingBeanJndi = (TestingRemote) ctx.lookup(TestingRemote.class.getName());
It works fine.........
But
InitialContext ctx = new InitialContext(); String strLookUp = ""java:comp/env/ejb/TestingBean"; TestingLocal testingBeanJndi = (TestingLocal) ctx.lookup(strLookUp);
It doesn't work...
I tried
strLookUp = ""java:comp/env/TestingBean";
I also tried like
@Stateless(name="ejb/TestingBeanLocal") // previously I didn't overwrite 'name'
public class TestingBean implements TestingRemote, TestingLocal { }
AND
strLookUp = ""java:comp/env/ejb/TestingBeanLocal";
Not working as well.
Could anyone please help me?
And could I get list for all JNDI env by using any command?
PS -- I am packing in the Beans in ear file.