1 2 Previous Next 21 Replies Latest reply on Sep 23, 2012 2:30 PM by ssilvert Go to original post
      • 15. Re: @EJB not working
        mahi.rathaur

        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

          I've now moved this to AS7 forum where someone might be able to help.

          • 17. Re: @EJB not working
            ssilvert

            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

              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

                hi jaikiran can u provide me a link to ur post in jboss community

                ....

                • 20. Re: @EJB not working
                  jaikiran

                  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

                    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?

                    1 2 Previous Next