• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1186
  • Last Modified:

Attribute validation error for tag CFSelect.

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
henderxe
Asked:
henderxe
  • 4
  • 3
  • 2
2 Solutions
 
Brijesh ChauhanStaff IT EngineerCommented:
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
 
gdemariaCommented:
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
 
henderxeAuthor Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gdemariaCommented:
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
 
henderxeAuthor Commented:
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
 
gdemariaCommented:
>  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
 
Brijesh ChauhanStaff IT EngineerCommented:
>  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
 
gdemariaCommented:
>  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
 
henderxeAuthor Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now