-
1. Re: EJB dependency injection returns null in application container client
wdfink Nov 16, 2012 5:12 PM (in response to usydrajani)You have to create an InitialContext and lookup the remote proxy. You can find examples within the docs depend to the JBoss version you use.
@EJB injection is only availabe uner container control.
-
2. Re: EJB dependency injection returns null in application container client
usydrajani Nov 16, 2012 5:21 PM (in response to wdfink)Would not creating initial context make it as a remote lookup in JNDI, while What I want to is to connect as a local client from within the container. As given in the example http://glassfish.java.net/javaee5/ejb/examples/Sless.html
under the heading of "Application Client" and "Standalone Java Client"
Meena
-
3. Re: EJB dependency injection returns null in application container client
wdfink Nov 17, 2012 8:00 AM (in response to usydrajani)If you read the documentation in case of 'Application Client' the container is responsible to resolve the @EJB.
AFAIK if you use a remote standalone application outside of the server JVM this is not supported by JBoss. You have to use the 'Standalone Java Client' approach.
-
4. Re: EJB dependency injection returns null in application container client
usydrajani Nov 17, 2012 1:15 PM (in response to wdfink)Ofcourse I read the documentation and ACC should resolve the @EJB dependency but I am getting error that is what my question is.
-
5. Re: EJB dependency injection returns null in application container client
wdfink Nov 19, 2012 2:14 AM (in response to usydrajani)Meena Rajnai schrieb:
Ofcourse I read the documentation and ACC should resolve the @EJB dependency but I am getting error that is what my question is.
What you mean by ACC?
I only see a Main class and I suppose it is a simple client starting in a different (from server) JVM. In that case the @EJB is not resolved.
Also your link 'HowToUseAnApplicationClientI....' is not valid.
-
6. Re: EJB dependency injection returns null in application container client
usydrajani Dec 29, 2012 3:39 AM (in response to wdfink)I followed this https://community.jboss.org/wiki/HowtouseanapplicationclientinJBoss-5 and this http://www.cs.hs-rm.de/~knauf/KomponentenArchitekturen2008/stateless/index.html and it worked. I was missing some jar files when in class pah from command line.