As far as I can see you are trying to DI a stateful session bean. You will have to use lookup instead of injection. Can anyone paste some lookup example, because I have the same problem right now ;) My JNDI lookup works in JBoss but unforunately not in GlassFish. Where is the difference?
I think that the reason why it is not working is because of the way you are using Dependency injection (DI).
DI can only be used by classes which are managed by containers (EJB, servlets), i.e., it is not possible to use DI (@EJB) in your client because it is non-managed.
Morover, DI is intended to "inject" local references (those references obtained from the java:comp/env context) so I don't think you can inject the remote reference of your CountBean.
So to get DI working I think you could try this:
1) Use as a client another EJB or a servlet 2) Define a local interface for your CountBean
Hope this helps,
Joined: Jul 31, 2006
Thanks Manuel, for the the explanation.
What I forgot to mention in my first post (which I thought would be assumed, my fault) is that I also deploy the client in the container with the bean. This means and it is also written in the book, that it is deployed in the container (Application Client Container) and DI should be available for that client. I followed this documentation to deploy on glassfish.