[webbeans-commits] Webbeans SVN: r1284 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Jan 29 09:40:51 EST 2009


Author: pete.muir at jboss.org
Date: 2009-01-29 09:40:51 -0500 (Thu, 29 Jan 2009)
New Revision: 1284

Modified:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
Log:
check if the product is serializable!

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-01-29 13:33:26 UTC (rev 1283)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-01-29 14:40:51 UTC (rev 1284)
@@ -200,13 +200,13 @@
       {
          return;
       }
-      if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()))
+      if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()) && !isSerializable())
       {
          if (injectionPoint.getMember() instanceof Field)
          {
             if (!Reflections.isTransient(injectionPoint.getMember()))
             {
-               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans");
+               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans\n\nProducer: " + this.toString() + "\nInjection Point: " + injectionPoint.toString());
             }
          }
          else if (injectionPoint.getMember() instanceof Method)




More information about the weld-commits mailing list