Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Duplicate attribute error

Community Beginner ,
Nov 30, 2007 Nov 30, 2007
I'm invoking a component method to do an update when a form is posted (CFMX 7.0.2, Windows Server 2003).
However, when I try to invoke the method I get the error:

A duplicate attribute "METHOD" has been encountered. Attributes with the same
name cannot be provided more than once.

The problem is that I'm -not- declaring the attribute more than once. The
offending code is listed below.

The error line number marks the last <cfinvokeargument> tag as the location
of the error. The "method" attribute is only listed once, so I'm not sure why it
would say that I've used it multiple times. Any ideas as to what I'm doing wrong?
Thanks in advance.

Joel
3.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Dec 03, 2007 Dec 03, 2007
I finally figured it out. A method in the cfc I was calling actually had the error (and it was a duplicate "method" attribute). I didn't find it sooner because the method that had the error wasn't the method I was calling; it just happened to be in the same cfc. The error message was just pointing me to the wrong place. Apparently CF does some sort of parsing to every function in a cfc, regardless of whether that method is being called at the time. Thanks for your help.
Translate
New Here ,
Nov 30, 2007 Nov 30, 2007
i'm clutching at straws here but it might be possible the method updatethread or some of your other method names in your cfc are used somewhere internally by coldfusion, it might be a reserved word.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 30, 2007 Nov 30, 2007
Yeah, I was thinking the same thing. I tried changing the name of the method and all its arguments to see if it worked, but didn't have any success. I'm having this problem on three methods in particular that work in a similar manner to the original code. However, I'm not having any trouble with other methods in the same cfc that I wrote a few months ago that do roughly the same type of work. I'm at a loss, because the error is being generated in the cfm page that calls the cfc, rather than the actual method itself.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 30, 2007 Nov 30, 2007
It sounds likely to me that the error you are seeing isn't actually related to the problem.

Try checking your <cfqueryparam> and your <cfargument> tags to make sure all the atrributes are correct within your method.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 03, 2007 Dec 03, 2007
LATEST
I finally figured it out. A method in the cfc I was calling actually had the error (and it was a duplicate "method" attribute). I didn't find it sooner because the method that had the error wasn't the method I was calling; it just happened to be in the same cfc. The error message was just pointing me to the wrong place. Apparently CF does some sort of parsing to every function in a cfc, regardless of whether that method is being called at the time. Thanks for your help.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources