Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1992

JMSContext is not serializable, causing problems for Session and Transaction Scoped CDI beans

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment Visibility
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.2
    • Fix Version/s: 7.0.3
    • Component/s: TomEE Core Server
    • Labels:

      Description

      The JMSContext proxy instance is not Serializable, so creating this bean is not possible:

      @TransactionScoped
      public class JMSPoller implements Serializable, Runnable {
          @Inject
          @JMSConnectionFactory("jms/connectionFactory")
          private JMSContext jmsContext;
      }
      

      This will result in this:

      javax.enterprise.inject.IllegalProductException: A producer method or field of scope @Dependent returns an unserializable object for injection into an injection point Field Injection Point, field name :  jmsContext, Bean Owner : [JMSPoller, WebBeansType:MANAGED, Name:null, API Types:[com.tomitribe.training.jms.JMSPoller,java.lang.Runnable,java.lang.Object,java.io.Serializable], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]] that requires a passivation capable dependency
      	at org.apache.webbeans.inject.AbstractInjectable.inject(AbstractInjectable.java:123)
      	at org.apache.webbeans.inject.InjectableField.doInjection(InjectableField.java:65)
      	at org.apache.webbeans.portable.InjectionTargetImpl.injectFields(InjectionTargetImpl.java:220)
      	at org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:206)
      	at org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:196)
      	at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:126)
      	at org.apache.webbeans.component.ManagedBean.create(ManagedBean.java:67)
      	at org.apache.webbeans.container.SerializableBean.create(SerializableBean.java:129)
      	at org.apache.webbeans.context.creational.BeanInstanceBag.create(BeanInstanceBag.java:76)
      	at org.apache.webbeans.context.AbstractContext.getInstance(AbstractContext.java:159)
      	at org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:125)
      	at org.apache.webbeans.context.CustomPassivatingContextImpl.get(CustomPassivatingContextImpl.java:46)
      	at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:101)
      	at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.get(NormalScopedBeanInterceptorHandler.java:71)
      

        Attachments

          Activity

            People

            • Assignee:
              romain.manni-bucau Romain Manni-Bucau
              Reporter:
              exabrial Jonathan S Fisher

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment