openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r892511 - /incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java
Date Sat, 19 Dec 2009 22:10:10 GMT
Author: struberg
Date: Sat Dec 19 22:10:10 2009
New Revision: 892511

URL: http://svn.apache.org/viewvc?rev=892511&view=rev
Log:
OWB-203 improve logging if injected EE resources like @Resource or @PersistenceUnit cannot
be found

we will not at least log an INFO about this fact.


Modified:
    incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java

Modified: incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java?rev=892511&r1=892510&r2=892511&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java
Sat Dec 19 22:10:10 2009
@@ -57,6 +57,9 @@
         {
             PersistenceContext context = field.getAnnotation(PersistenceContext.class); 
          
             obj = getPersistenceContext(context.unitName());
+            if (obj == null) {
+            	logger.info("Could not find @PersistenceContext with unit name " + context.unitName());
+            }
         }
         
         else if (field.isAnnotationPresent(PersistenceUnit.class))
@@ -64,6 +67,9 @@
             PersistenceUnit annotation = field.getAnnotation(PersistenceUnit.class);
             
             obj = getPersistenceUnit(annotation.unitName());
+            if (obj == null) {
+            	logger.info("Could not find @PersistenceUnit with unit name " + annotation.unitName());
+            }
         }
         else if(field.isAnnotationPresent(Resource.class))
         {
@@ -71,6 +77,10 @@
             try
             {
                 obj = context.lookup("java:/comp/env/"+ resource.name()); 
+                if (obj == null) {
+                	logger.info("Could not find @Resource with name " + resource.name());
+                }
+
             }
             catch(Exception e)
             {



Mime
View raw message