glassfish
  1. glassfish
  2. GLASSFISH-20273

CDI String Producer is visible to the application

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 4.0_b83
    • Fix Version/s: None
    • Component/s: cdi
    • Labels:
      None

      Description

      String injection fails:

      @Inject
      private String something;

      Causes the following exception:

      at com.ibm.jbatch.container.cdi.BatchProducerBean.produceProperty(BatchProducerBean.java:46)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod.invokeOnInstance(InvokableAnnotatedMethod.java:97)
      at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:77)
      at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:71)
      at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:97)
      at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:187)
      at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:190)
      at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:711)
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:769)
      at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:88)
      at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:368)
      at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:377)
      at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72)
      at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60)
      at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66)
      at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:142)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
      at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64)
      at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:97)
      at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:158)
      at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103)
      at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:93)
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:82)
      at com.abien.stringproducerinterference.StringInjectionTarget$Proxy$_$$_WeldClientProxy.getMessage(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
      at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
      at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
      at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
      at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
      at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:227)
      at com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:150)
      at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
      ... 37 more

      The erroneously exposed @Producer also causes the introduction of application producer (ambiguous dependency error).

      The problem seems to be caused by the batch component. However right now it is not possible to chooose a batch "component" from the Jira menu.

        Activity

        Hide
        jjsnyder83 added a comment -

        You must qualify String injections because the new Batch jar has a String producer. The batch String produce is qualified.

        Show
        jjsnyder83 added a comment - You must qualify String injections because the new Batch jar has a String producer. The batch String produce is qualified.

          People

          • Assignee:
            jjsnyder83
            Reporter:
            abien
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: