Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-588

RunnableDecorator incorrectly assumes >0 Runnable beans

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 1.0.1.Final
    • None
    • Java SE Support
    • None
    • Hide

      Not sure about a simple way, but in my case I got it when I tried to use WeldSE features inside a glassfish 3 web project (my unit tests inside the web project use WeldSE so in essense my web project can work as WAR in glassfish and as an app outside glassfish). I guess the mix of weld jars may cause this problem to surface? Problem seemed to go away if I added the dummy class as described in the workaround.

      Show
      Not sure about a simple way, but in my case I got it when I tried to use WeldSE features inside a glassfish 3 web project (my unit tests inside the web project use WeldSE so in essense my web project can work as WAR in glassfish and as an app outside glassfish). I guess the mix of weld jars may cause this problem to surface? Problem seemed to go away if I added the dummy class as described in the workaround.
    • Hide

      As a workaround I declared this class in my app and it worked again:
      @Singleton
      public class DummyRunnable implements Runnable {
      @Override
      public void run() {}
      }}

      Show
      As a workaround I declared this class in my app and it worked again: @Singleton public class DummyRunnable implements Runnable { @Override public void run() {} }}

    Description

      The class org.jboss.weld.environment.se.threading.RunnableDecorator incorrectly assumes that there will be at least one bean that implements Runnable.

      If there are no beans that implements Runnable then an error like this will happen:
      org.jboss.weld.DeploymentException: Injection point has unstatisfied dependencies. Injection point: field org.jboss.weld.environment.se.threading.RunnableDecorator.runnable; Qualifiers: [@javax.enterprise.inject.Default()]
      at org.jboss.weld.Validator.validateInjectionPoint(Validator.java:232)
      at org.jboss.weld.Validator.validateBean(Validator.java:80)
      at org.jboss.weld.Validator.validateRIBean(Validator.java:100)
      at org.jboss.weld.Validator.validateBeans(Validator.java:282)
      at org.jboss.weld.Validator.validateDeployment(Validator.java:267)
      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:389)
      at org.jboss.weld.environment.se.Weld.initialize(Weld.java:81)
      at org.jboss.weld.environment.se.StartMain.go(StartMain.java:45)
      at org.jboss.weld.environment.se.StartMain.main(StartMain.java:57)

      I guess the field "runnable" inside this class should be changed to use Instance<Runnable> instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mmc41 Morten Christensen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: