Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24331

[GSS](7.4.z) @Resouces are not injected in local EJB after fixing WFLY-11566

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 7.4.6.GA
    • EJB
    • None
    • True
    • Deployment failure
    • False
    • Workaround Exists
    • Hide

      As a workaround, can you wrap the bean that is returned by the BeanInitializer @Config class into some kind of wrapper? For instance, this appears to work:

      @Configuration
      public class BeanInitializer {
      	@Bean
      	public HelloWorld helloWorld() {
                 ...
      			InitialContext context = new InitialContext();
      			final HelloWorld helloWorld = HelloWorld.class.cast(context.lookup("java:app/hello-ejb/HelloWorldBean!com.example.HelloWorld"));
      			return new HelloWorld() {
      				public String sayHello() {
      					return helloWorld.sayHello();
      				}
      			};
                  ...
      	}
      }
      

      The point is that the object returned by the producer method, which is going to be turned by Spring into a Spring managed bean, should not be the EJB proxy itself.

      Show
      As a workaround, can you wrap the bean that is returned by the BeanInitializer   @Config  class into some kind of wrapper? For instance, this appears to work: @Configuration public class BeanInitializer { @Bean public HelloWorld helloWorld() { ... InitialContext context = new InitialContext(); final HelloWorld helloWorld = HelloWorld. class. cast (context.lookup( "java:app/hello-ejb/HelloWorldBean!com.example.HelloWorld" )); return new HelloWorld() { public String sayHello() { return helloWorld.sayHello(); } }; ... } } The point is that the object returned by the producer method, which is going to be turned by Spring into a Spring managed bean, should not be the EJB proxy itself.
    • Hide

      Steps to reproduce.

      1. Install jboss EAP 7.4.6
      2. Deploy attached ear - test-jboss.ear

      Expected: Deployment should pass.

      Actual: Deployment fails with below exception

      Show
      Steps to reproduce. Install jboss EAP 7.4.6 Deploy attached ear - test-jboss.ear Expected: Deployment should pass. Actual: Deployment fails with below exception

      Deployment failing after applying Update 2 or later to EAP 7.4 with :

      No qualifying bean of type 'javax.ejb.SessionContext' available: expected at least 1 bean which qualifies as autowire candidate.

      The same ear works fine in jboss EAP 7.4 Update 1 and starts failing if we upgrade to 7.4 Update 2. Also fails with 7.4 Update 6

      We have checked the revision history for jboss 7.4 Update 2 and found that the commit https://github.com/wildfly/wildfly/commit/178b026d6ebdcb8cef757c045492dbd81f70af33 made for WFLY-11566 could be the reason for this failure. 

      We tried replacing wildfly-ee-7.4.6.GA-redhat-00002.jar from modules overlay to wildfly-ee-7.4.0.GA-redhat-00005.jar and then deployment works fine. 

      Let us know if this is the bug in 7.4 Update 2 onwards or are we missing something?

        1. jboss-7.4.6.log
          64 kB
        2. jboss-test.ear-src.zip
          17 kB
        3. test-jboss.ear
          15.81 MB

              thofman Tomas Hofman
              nigawih623 Nigar Sigar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: