1

I keep encountering a "The method was not found in component" error upon restarting CF services. Upon stopping and starting again this method will then be fine.

The method not found happens to be the most recently added function to a CFC that has been in production for years. None of the other functions in that CFC are throwing errors just this one. I have attempted clearing caches, etc. All CFC are defined in Application.cfm.

Has anyone encountered this issue or have any advice or solution?

Thanks.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
AShoes
  • 23
  • 6
  • 1
    is this webservice related at all? – Dan Roberts Aug 20 '20 at 20:31
  • Are you saying that restarting the CF service a second time fixes it, or is the subsequent restart just a restart of your CF application using a specific URL, without restarting the whole CF service? If the former, does restarting CF service a third time break it again and restarting a fourth time fix it again? If the latter, is there anything more you can reveal about how you are instantiating CFCs in application.cfm, and about the method that was recently added, and whether there is any code that attempts to call this method during application start? – Sev Roberts Aug 24 '20 at 13:40
  • Asking those questions because the only time I've ever seen similar sounding symptoms was due to dependencies between different components with instances persisted in the application scope, where someone had been careless about the order of initialization. Eg where method `i()` in `later.cfc` was called during the initialization of `earlier.cfc` - or when trying to set a value inside a cfc's `variables.` scope (thus outside of the `init`) where the value is reliant on calling a method in an application-scoped instance of a component that does not exist yet at compile-time. – Sev Roberts Aug 24 '20 at 13:50
  • @SevRoberts If seems restarting causes the issue more than stopping the service, waiting a minute and then starting. This is usually how I remedy the error. We initiate the CFCs in application using: for example. There are no links between this function and any others. It is simply called at the top of a page and used within to return values from a query. – AShoes Aug 25 '20 at 14:27

1 Answers1

2

The method not found happens to be the most recently added function

  • Is the method marked access="private"?
  • Is the method marked access="package"?
  • Is the method spelled correctly?
  • Is the reference to the method spelled correctly?
  • Can other methods in the same CFC be called?
  • Are you sure you've deployed that file change to production?
  • Have you checked the actual file on the server to make sure the method is there?
  • Have you verified that your CF Admin is pointing to the correct mapping path?
  • Is that path where this CFC is actually located?
  • In CF admin, is "Component cache" unchecked?
Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44
  • The first paragraph of the question, especially the 2nd sentence, makes many of these questions moot. – Dan Bracuk Aug 21 '20 at 11:26
  • Thank you for the reply Adrian. I think most of this wouldn't apply as Dan mentioned about. This function works most of the time, this issue only occurs on a reboot or restart of services and only for this single function within the same CFC. – AShoes Aug 21 '20 at 12:40