Solved

Attribute validation error for tag CFSelect.

Posted on 2011-03-21
9
1,102 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
  • 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now