Solved

Attribute validation error for tag CFSelect.

Posted on 2011-03-21
9
1,116 Views
Last Modified: 2012-05-11
All of a sudden (hadn't previously), I started getting the following error:

-------------------------------  START ERROR -----------------------------------------------
Exception
Message       Attribute validation error for tag CFSelect.
Detail       The value of the attribute Query, which is currently application.getMailingList, is invalid.
Extended Info       
Tag Context       R:\aihtc\ART_TEST\views\cfm\exportReports\idListGeneration\contactDetailsDisp.cfm (73)
R:\aihtc\ART_TEST\views\cfm\exportReports\idListGeneration\idListGeneration.cfm (45)
R:\aihtc\ART_TEST\views\cfm\exportReports\exportReports.cfm (203)
C:\inetpub\wwwroot\MachII\framework\ViewContext.cfc (107)
C:\inetpub\wwwroot\MachII\framework\EventContext.cfc (468)
C:\inetpub\wwwroot\MachII\framework\commands\ViewPageCommand.cfc (85)
C:\inetpub\wwwroot\MachII\framework\EventHandler.cfc (81)
C:\inetpub\wwwroot\MachII\framework\RequestHandler.cfc (379)
C:\inetpub\wwwroot\MachII\framework\RequestHandler.cfc (327)
C:\inetpub\wwwroot\MachII\framework\RequestHandler.cfc (271)
C:\inetpub\wwwroot\MachII\framework\RequestHandler.cfc (201)
C:\inetpub\wwwroot\MachII\mach-ii.cfm (123)
R:\aihtc\ART_TEST\index.cfm (9)
------------------------------------------ END ERROR ----------------------------------------------

Here's the form field layout:

----------------------------------------- START FORM ----------------------------------------------
<fieldset  id="countDetailsStep5" style="height:auto; width:auto; display:none; "> 
        <legend>Step 5:  Mail List</legend>
        <cfoutput>
        <div class="mailList">
            <div style="width:65%; float:left; border:0px solid red;">  
               <cfform name="explist">
               <span class="checkBoxLabel">Include Mailing List:</span>                  
                               
                <cfselect id="includeMailingList"  name="includeMailingList[]"  multiple="yes" size="1"
                    query="application.getMailingList"
                    value="code"  
                    display="description"
                    bindonload="true"
                    editable="yes"
                    class="selectStyle" style="width:auto;"/>                                            
                <input type="hidden" id="includeMailingList_hdn" name="includeMailingList_hdn"   />                          
               </cfform>
            </div>
            <div style="width:18%; float:right">                      
                <input type="button"  class="buttonStyle" value="Generate List" onclick="showStep4(#queryID#,'IsListIncludeSpouseID','Yes','#fromReport#')"><br />
            </div>
        </div>
        </cfoutput>
     </fieldset>
------------------------------------------  END FORM ---------------------------------------------

   And here's the query the form points to:

------------------------------------- START QUERY ----------------------------------------------
<cfif NOT IsDefined("APPLICATION.getMailingList")>
              <cfquery name="APPLICATION.getMailingList"  datasource="#db.dbName#"  username="#db.dbUserName#" password="#db.dbPassword#">
                        select mail_list_code_code code, mail_list_code_code||' - '||short_desc description, short_desc,mail_list_group_code
                    from tms_mail_list_code
                    where status_code = 'A'
                    order by short_desc
                </cfquery>    
        </cfif>
------------------------------------------- END QUERY -----------------------------------------------

I did some research which suggested that there's a known problem with the CFSELECT tag.

Incidently, it doesn't matter if I replace the entire application (folder) with backups, even from last year (2010), I still get the same error.

Any ideas on how to fix this?

Thanks!

   
0
Comment
Question by:henderxe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 35183875
Any reason to name the query as APPLICATION. ? it might be probably looking for a APPLICATION scope variable rather than the query, just as a test, just have the query above the cfselect, name the query without the APPLICATION. and check if it works...

    <cfquery name="getMailingList"  datasource="#db.dbName#"  username="#db.dbUserName#" password="#db.dbPassword#">
                        select mail_list_code_code code, mail_list_code_code||' - '||short_desc description, short_desc,mail_list_group_code
                    from tms_mail_list_code
                    where status_code = 'A' 
                    order by short_desc
                </cfquery>

Open in new window

0
 
LVL 39

Expert Comment

by:gdemaria
ID: 35183888
It's very interesting having a query in the application scope.  The entire application for all users use this same query?

I am wondering where this code... is located in your files?   It seems it would have to be in your applicaton.cfc/.cfm file.  Is that where it is?   Either that or it would be in the same file as the form..  ?

<cfif NOT IsDefined("APPLICATION.getMailingList")>
              <cfquery name="APPLICATION.getMailingList"  datasource="#db.dbName#"  username="#db.dbUserName#" password="#db.dbPassword#">
                        select mail_list_code_code code, mail_list_code_code||' - '||short_desc description, short_desc,mail_list_group_code
                    from tms_mail_list_code
                    where status_code = 'A'
                    order by short_desc
                </cfquery>    
        </cfif>

0
 

Author Comment

by:henderxe
ID: 35184160
Yes, the APPLICATIONS scope is used to load "multiselect" drop down menus throughout the application, primarily because some of them are rather large (e.g. geographic areas, degrees, etc).   Loads much faster for users.

Were running the MACH-II framework with Coldfusion, and upload the data into the APPLICATIONS scope via a scheduled "event".   The query I posted in my initial post is one of may queries in that file (getAppScopeDataDAO.cfc).   Process is initiated by the following event:

--------------------------------------  BEGIN EVENT --------------------------------------------------
<cfcomponent extends="MachII.framework.Listener" displayname="scheduledTasks" hint="scheduledTasks" output="false">

      <cfset basePath = "#GetDirectoryFromPath(replace(expandPath("./"), "\","/","ALL"))#">
       <cfset baseFolder =   "#GetFileFromPath(left(basePath,len(basePath)-1))#">
      <cffunction name="configure" access="public" returntype="void" output="false">      
                <cfset db = StructNew() />
                  <cfset  dbName = getProperty("dbName")>  <!--- getting dbname from machii.xml  --->
             <cfset dbUserName = getProperty("dbUserName")>
             <cfset  dbPassword = getProperty("dbPassword")>
            <cfset  variables.appScopeDataObject = createObject("component","#baseFolder#.model.scheduled.getAppScopeDataDAO").init(dbName, dbUserName,dbPassword)/>
      </cffunction>
   
      <cffunction name="getNewQueryAppScopeData" access="public" returntype="void">
             <cfset success = variables.appScopeDataObject.newQueryAppScopeData() />
          <cfset getLog().info("Data has been loaded into Application Scope. Result=#success#") />
      </cffunction>
</cfcomponent>
-------------------------------------------------END EVENT ----------------------------------------------------

  It has always worked fine (since July 2010).   For some unknown reason (although could be due to changes made elsewhere in the program), it stopped working for the first time today.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 39

Expert Comment

by:gdemaria
ID: 35184247
Is the failure happening when you first load the page, or after a while..

I am wondering if the application scope is timing out, the function has to rerun when the application times out

0
 

Author Comment

by:henderxe
ID: 35184440
It appears to fail almost "instantly".  The application itself loads normally, but when I click on ANY of the options, it immediately generates the error.

By the way, I did try removing the "application" preceding the query name (e.g. getMailingList), but get the same error.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 35184500
>  I did try removing the "application" preceding the query name (e.g. getMailingList), but get the same error.

It wouldn't help to remove this unless you placed the query in the same file as the CFSELECT


You should try to ensure that that part of the code is running, the part that creates the CFQUERY

I am guessing that it is defined in this function?   Try adding a flag inside with an abort, this will tell you (1) that you are getting to the right spot and (2) whether or not the variable is being set..


<cffunction name="getNewQueryAppScopeData" access="public" returntype="void">
   <cfset success = variables.appScopeDataObject.newQueryAppScopeData() />

    <cfif IsDefined("APPLICATION.getMailingList")><h1>APP DEFINED</h1>
    <cfelse><h1>APP NOT DEFINED</h1>
    </cfif> <cfabort>


   <cfset getLog().info("Data has been loaded into Application Scope. Result=#success#") />
</cffunction>

0
 
LVL 11

Accepted Solution

by:
Brijesh Chauhan earned 250 total points
ID: 35186196
>  I did try removing the "application" preceding the query name (e.g. getMailingList), but get the same error.

It wouldn't help to remove this unless you placed the query in the same file as the CFSELECT


Yes, you need to place it in the same file as cfselect, I have mentioned it in my first post, to have it above the cfselect code...

You can also try out to BIND the cfc in cfselect...something like

<cfselect name="state" bind="cfc:bindFcns.getstates()" bindonload="true">

0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 250 total points
ID: 35186245
>  but when I click on ANY of the options, it immediately generates the error.

You aren't referring to the SELECT's tags options are you?   The SELECT tag never loads because of this error, is that correct?   Or is the page (with the SELECT tag) loading, and the errors when you click the "Generate" button?

>  <cfselect id="includeMailingList"  name="includeMailingList[]"  multiple="yes" size="1"
                    query="application.getMailingList"
 
I would remove the [] from the name of this tag, unless it's part of some coding methodology
0
 

Author Comment

by:henderxe
ID: 35189021
Problem solved -- but solution unbelievable!

I noticed on the server that 21GB (of 24GB) of RAM was being used.  Normally, only about 5GB of RAM is used leaving approximately 19GB "available".

So . . . I rebooted the server, and the problem went away.   Wish I had thought of it earlier - makes a lot of sense since the query was dependent on information in memory (APPLICATION scope), which wasn't there.

   But I'm very appreciative of not only the rapid response by you both, but also helping me in starting the process of analyzing possible solutions, as well as my getting a better understanding of the problem.

    Thanks again!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CFdocumnet font issue 5 47
Coldfusion session variables in scheduled job 1 373
Coldfusion combining queries 15 78
coldfusion cfloop help 6 36
This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question