Tapestry
  1. Tapestry
  2. TAPESTRY-2517

A failed service injection into a component field is visible in the browser as a spurious error about field _$resources

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.13
    • Fix Version/s: 5.0.15
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The error was that I was injecting a service but hadn't bound it in my AppModule. Scanning down the console, I found the exception:

      Caused by: java.lang.RuntimeException: Error obtaining injected value for field com.formos.blog.pages.blog.BlogIndex.blogDAO: No service implements the interface com.formos.blog.services.BlogDAO.
      at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:68)
      at $ComponentClassTransformWorker_11b13c8fa72.transform($ComponentClassTransformWorker_11b13c8fa72.java)
      at $ComponentClassTransformWorker_11b13c8fa68.transform($ComponentClassTransformWorker_11b13c8fa68.java)
      at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:161)
      ... 98 more
      Caused by: java.lang.RuntimeException: No service implements the interface com.formos.blog.services.BlogDAO.
      at org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:523)
      at org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:44)
      at org.apache.tapestry5.internal.services.ServiceInjectionProvider.provideInjection(ServiceInjectionProvider.java:40)
      at $InjectionProvider_11b13c8fa74.provideInjection($InjectionProvider_11b13c8fa74.java)
      at $InjectionProvider_11b13c8fa6d.provideInjection($InjectionProvider_11b13c8fa6d.java)
      at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:57)

      However, the exception in the web browser was:

      java.lang.RuntimeException
      Class com.formos.blog.pages.blog.BlogIndex contains field(s) (_$resources) that are not private. You should change these fields to private, and add accessor methods if needed.

      Stack trace

      • org.apache.tapestry5.internal.services.InternalClassTransformationImpl.verifyFields(InternalClassTransformationImpl.java:294)
      • org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadMemberNames(InternalClassTransformationImpl.java:256)
      • org.apache.tapestry5.internal.services.InternalClassTransformationImpl.<init>(InternalClassTransformationImpl.java:151)
      • org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:154)
      • org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:182)
      • javassist.Loader.findClass(Loader.java:340)

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development