-
15. Re: @EJB not working
mahi.rathaur Sep 21, 2012 12:11 AM (in response to dajo20034)Thanks Danilo. but it is still not working .
i again created project in eclipse with default configuraion for jsf and used jsf , provided by jboss 7.1.1. @EJB is working fine there.
i really can't figure out ,when i am not using server provide jsf why @EJB is not working.
-
16. Re: @EJB not working
jaikiran Sep 21, 2012 4:21 AM (in response to mahi.rathaur)I've now moved this to AS7 forum where someone might be able to help.
-
17. Re: @EJB not working
ssilvert Sep 21, 2012 6:55 AM (in response to mahi.rathaur)I'm not sure I follow everything in this thread, but here are all the facts as I know them:
You can enable the built-in JSF 1.2 by adding this in your web.xml:
<context-param> <param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name> <param-value>Mojarra-1.2</param-value> </context-param>
@EJB doesn't work on managed beans with this built-in version of JSF 1.2. This is due to a classloading issue. It is fixed upstream as mentioned here:
https://issues.jboss.org/browse/AS7-5564
There are two workarounds. First, you can still get a reference to your EJB via JNDI:
SimpleEJB ejbFromJNDI = (SimpleEJB)new InitialContext().lookup("java:module/SimpleEJB");
Or, you can change the classloading behavior in the web subsystem. If you do this then JSF 2.x won't work, but JSF 1.2 will work.
Edit <jboss_home>/modules/org/jboss/as/web/main/module.xml Under the dependencies section, change <module name="com.sun.jsf-impl"/> to <module name="com.sun.jsf-impl" slot="1.2"/>
That will cause the web subsystem to link to the 1.2 version of the InjectionProvider and @EJB will work.
Stan
-
18. Re: @EJB not working
mahi.rathaur Sep 23, 2012 2:06 AM (in response to ssilvert)Hi stan.
actually i want to use different distribution of JSF not the one provided by server...
any help..
-
19. Re: @EJB not working
mahi.rathaur Sep 23, 2012 2:07 AM (in response to jaikiran)hi jaikiran can u provide me a link to ur post in jboss community
....
-
20. Re: @EJB not working
jaikiran Sep 23, 2012 5:23 AM (in response to mahi.rathaur)Mahesh Pal wrote:
hi jaikiran can u provide me a link to ur post in jboss community
....
There's no "new" link. The thread you are replying to is the one which is now in the AS7 forums.
-
21. Re: @EJB not working
ssilvert Sep 23, 2012 2:30 PM (in response to mahi.rathaur)Mahesh Pal wrote:
Hi stan.
actually i want to use different distribution of JSF not the one provided by server...
any help..
Which JSF distribution and version do you want to use?