javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2768

@EJB facade is not injected into the @FacesConverter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-m09
    • Fix Version/s: 2.2.0-m11
    • Component/s: lifecycle
    • Labels:
      None
    • Environment:

      GF 4.0.build77

      Description

      I created simple application using NetBeansIDE where are used @FacesConverter-s. These converters require @Stateless facade to be injected (using @EJB annotation). When I run the project and create new car, NPE appears since the ejbfacade is not injected properly into OwnerControllerConverter and the find() method is called on null then.

      But since fixing this issue I would expect that it's correct use case:
      http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-763

      I also found several references, that JSF2.2 should remove this limitations:
      http://jdevelopment.nl/jsf-22/#763
      http://stackoverflow.com/questions/3630403/how-do-i-access-ejb-bean-when-inside-a-custom-converter

      Please take a look on that. I don't want to use InitialContext.lookup workaround since we need to generate in the NetBeans IDE the easiest and best approach source code. Thanks a lot...

        Activity

        Hide
        marfous added a comment -

        I'm attaching link to the workaround I found which is not suitable for usage of generation in the IDE:
        http://balusc.blogspot.cz/2011/09/communication-in-jsf-20.html#ConvertingAndValidatingGETRequestParameters

        Show
        marfous added a comment - I'm attaching link to the workaround I found which is not suitable for usage of generation in the IDE: http://balusc.blogspot.cz/2011/09/communication-in-jsf-20.html#ConvertingAndValidatingGETRequestParameters
        Hide
        marfous added a comment -

        Sorry I forgot to attach link to the application:
        https://dl.dropbox.com/u/1418580/WebApplication311.zip

        Show
        marfous added a comment - Sorry I forgot to attach link to the application: https://dl.dropbox.com/u/1418580/WebApplication311.zip
        Hide
        Manfred Riem added a comment -

        Applied to 2.2 trunk,

        svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2768, r=rogerk, fixes @EJB facade is not injected into the @FacesConverter."
        Sending common\ant\common.xml
        Sending jsf-ri\mojarra-jsf-impl.bnd
        Sending jsf-ri\src\main\java\com\sun\faces\application\annotation\AnnotationManager.java
        Adding jsf-ri\src\main\java\com\sun\faces\application\annotation\DelegatedEJBScanner.java
        Adding jsf-ri\src\main\java\com\sun\faces\application\annotation\EJBHandler.java
        Adding jsf-ri\src\main\java\com\sun\faces\application\annotation\EJBScanner.java
        Sending nbproject\project.xml
        Adding test\web-profile\annotation
        Adding test\web-profile\annotation\ejb
        Adding test\web-profile\annotation\ejb\nbactions.xml
        Adding test\web-profile\annotation\ejb\pom.xml
        Adding test\web-profile\annotation\ejb\src
        Adding test\web-profile\annotation\ejb\src\main
        Adding test\web-profile\annotation\ejb\src\main\java
        Adding test\web-profile\annotation\ejb\src\main\java\com
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\Car.java
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\CarBean.java
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\CarConverter.java
        Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\CarEJB.java
        Adding test\web-profile\annotation\ejb\src\main\resources
        Adding test\web-profile\annotation\ejb\src\main\webapp
        Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF
        Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF\beans.xml
        Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF\glassfish-web.xml
        Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF\web.xml
        Adding test\web-profile\annotation\ejb\src\main\webapp\ejbIntoConverter.xhtml
        Adding test\web-profile\annotation\ejb\src\test
        Adding test\web-profile\annotation\ejb\src\test\java
        Adding test\web-profile\annotation\ejb\src\test\java\com
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile\annotation
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile\annotation\ejb
        Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile\annotation\ejb\Issue2768IT.java
        Adding test\web-profile\annotation\pom.xml
        Transmitting file data ...................
        Committed revision 11701.

        Show
        Manfred Riem added a comment - Applied to 2.2 trunk, svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2768 , r=rogerk, fixes @EJB facade is not injected into the @FacesConverter." Sending common\ant\common.xml Sending jsf-ri\mojarra-jsf-impl.bnd Sending jsf-ri\src\main\java\com\sun\faces\application\annotation\AnnotationManager.java Adding jsf-ri\src\main\java\com\sun\faces\application\annotation\DelegatedEJBScanner.java Adding jsf-ri\src\main\java\com\sun\faces\application\annotation\EJBHandler.java Adding jsf-ri\src\main\java\com\sun\faces\application\annotation\EJBScanner.java Sending nbproject\project.xml Adding test\web-profile\annotation Adding test\web-profile\annotation\ejb Adding test\web-profile\annotation\ejb\nbactions.xml Adding test\web-profile\annotation\ejb\pom.xml Adding test\web-profile\annotation\ejb\src Adding test\web-profile\annotation\ejb\src\main Adding test\web-profile\annotation\ejb\src\main\java Adding test\web-profile\annotation\ejb\src\main\java\com Adding test\web-profile\annotation\ejb\src\main\java\com\sun Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\Car.java Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\CarBean.java Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\CarConverter.java Adding test\web-profile\annotation\ejb\src\main\java\com\sun\faces\test\webprofile\annotation\ejb\CarEJB.java Adding test\web-profile\annotation\ejb\src\main\resources Adding test\web-profile\annotation\ejb\src\main\webapp Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF\beans.xml Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF\glassfish-web.xml Adding test\web-profile\annotation\ejb\src\main\webapp\WEB-INF\web.xml Adding test\web-profile\annotation\ejb\src\main\webapp\ejbIntoConverter.xhtml Adding test\web-profile\annotation\ejb\src\test Adding test\web-profile\annotation\ejb\src\test\java Adding test\web-profile\annotation\ejb\src\test\java\com Adding test\web-profile\annotation\ejb\src\test\java\com\sun Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile\annotation Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile\annotation\ejb Adding test\web-profile\annotation\ejb\src\test\java\com\sun\faces\test\webprofile\annotation\ejb\Issue2768IT.java Adding test\web-profile\annotation\pom.xml Transmitting file data ................... Committed revision 11701.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            marfous
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: