You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/10/18 01:00:17 UTC

svn commit: r1185425 - in /tapestry/tapestry5/trunk/tapestry-ioc/src: main/java/org/apache/tapestry5/ioc/internal/ main/resources/org/apache/tapestry5/ioc/internal/ test/java/org/apache/tapestry5/ioc/

Author: hlship
Date: Mon Oct 17 23:00:17 2011
New Revision: 1185425

URL: http://svn.apache.org/viewvc?rev=1185425&view=rev
Log:
TAP5-1117: Exception message when binding a service interface (and service implementation not found) is confusing

Modified:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ServiceBinderImpl.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties
    tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/IntegrationTest.java

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java?rev=1185425&r1=1185424&r2=1185425&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java Mon Oct 17 23:00:17 2011
@@ -256,11 +256,6 @@ final class IOCMessages
         return MESSAGES.format("no-proxy-provider", serviceId);
     }
 
-    static String noConventionServiceImplementationFound(Class clazz)
-    {
-        return MESSAGES.format("no-convention-service-implementation-found", clazz.getName(), clazz.getName());
-    }
-
     static String contributionForNonexistentService(ContributionDef cd)
     {
         return MESSAGES.format("contribution-for-nonexistent-service", cd, cd.getServiceId());

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ServiceBinderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ServiceBinderImpl.java?rev=1185425&r1=1185424&r2=1185425&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ServiceBinderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ServiceBinderImpl.java Mon Oct 17 23:00:17 2011
@@ -187,7 +187,8 @@ public class ServiceBinderImpl implement
                 throw new RuntimeException(IOCMessages.noServiceMatchesType(serviceClass));
             } catch (ClassNotFoundException ex)
             {
-                throw new RuntimeException(IOCMessages.noConventionServiceImplementationFound(serviceClass));
+                throw new RuntimeException(String.format("Could not find default implementation class %sImpl. Please provide this class, or bind the service interface to a specific implementation class.",
+                        serviceClass.getName()));
             }
         }
 

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties?rev=1185425&r1=1185424&r2=1185425&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties Mon Oct 17 23:00:17 2011
@@ -68,6 +68,5 @@ no-autobuild-constructor=Class %s does n
 overlapping-service-proxy-providers=Setting a new service proxy provider when there's already an existing provider. This may indicate that you have multiple IoC Registries.
 unexpected-service-proxy-provider=Unexpected service proxy provider when clearing the provider. This may indicate that you have multiple IoC Registries.
 no-proxy-provider=Service token for service '%s' can not be converted back into a proxy because no proxy provider has been registered. This may indicate that an IoC Registry has not been started yet.
-no-convention-service-implementation-found=No service implements the interface %s. Please provide the implementation %sImpl or bind the service interface to a service implementation.
 contribution-for-nonexistent-service=Contribution %s is for service '%s', which does not exist.
 contribution-for-unqualified-service=Contribution %s is for service '%s' qualified with marker annotations %s, which does not exist.
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/IntegrationTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/IntegrationTest.java?rev=1185425&r1=1185424&r2=1185425&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/IntegrationTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/IntegrationTest.java Mon Oct 17 23:00:17 2011
@@ -449,8 +449,8 @@ public class IntegrationTest extends IOC
             unreachable();
         } catch (RuntimeException ex)
         {
-            assertMessageContains(ex, "No service implements the interface " + StringTransformer.class.getName()
-                    + ". Please provide");
+            assertMessageContains(ex, "Could not find default implementation class org.apache.tapestry5.ioc.StringTransformerImpl.",
+                    "Please provide this class, or bind the service interface to a specific implementation class.");
         }
     }