Skip to main content
Participant
May 4, 2020 10:03 PM UTC
Answered

cfobject en Application.cfc

necesita declarar cfobject en Application.cfc, pero me da el siguiente error:

en Application.cfc defino de la siguiente forma:

<cfobject component="geti_des.proc.dominioAD" name="dominioAD">

    This topic is closed to new replies. Start a new post to keep the conversation going.
    BKBK
    BKBKCorrect answer
    Community Expert
    May 5, 2020 3:54 PM UTC

    You should in fact move from Application.cfm to Application.cfc. In any case, that has nothing to do with the error.

     

    Is the component path /geti_des/proc.dominioAD.cfc valid? Try the following:

     

    <cfif fileExists(expandPath("/geti_des/proc/dominioAD.cfc"))>
        <cfinvoke component="geti_des.proc.dominioAD" method="consDominioAD" returnvariable="qDominioAD">
    <cfelse>
    Componente no encontrado en esta ruta.
    </cfif>

     

    5 replies

    Participant
    May 5, 2020 3:24 PM UTC

    Gracias, hice la prueba de esa forma pero sigue dando el mismo error;
    Si ese mismo código lo utilizo en un Application.cfm si me funciona

    <cfobject component="geti_des.proc.dominioAD" name="dominioAD">

    Y el llamado lo realizó de esta forma:

    <cfinvoke component="#dominioAD#" method="consDominioAD" returnvariable="qDominioAD">

    Pero lo que quiero es pasar todo a un Application.cfc

    Translate
    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    May 5, 2020 3:54 PM UTC

    You should in fact move from Application.cfm to Application.cfc. In any case, that has nothing to do with the error.

     

    Is the component path /geti_des/proc.dominioAD.cfc valid? Try the following:

     

    <cfif fileExists(expandPath("/geti_des/proc/dominioAD.cfc"))>
        <cfinvoke component="geti_des.proc.dominioAD" method="consDominioAD" returnvariable="qDominioAD">
    <cfelse>
    Componente no encontrado en esta ruta.
    </cfif>

     

    Translate
    Participant
    May 5, 2020 5:33 PM UTC

    Según la validación, la ruta del componente si es válida 

    Translate
    BKBK
    Community Expert
    Community Expert
    May 5, 2020 2:56 PM UTC

    Apparently, you want the object dominioAD to be available throughout the application. Hence, across every request and every session and irrespective of the component path.

    If so, then use:

     

    <!--- In Application.cfc --->
    <cfobject component="geti_des.proc.dominioAD" name="application.dominioAD">
    
    <!--- On the CFM page --->
    <cfinvoke component="#application.dominioAD#" method="consDominioAD" returnvariable="qDominioAD">
    
    
    Translate
    WolfShade
    Legend
    May 5, 2020 1:16 PM UTC

    I'm not allowed to delete this.  I keep coming up with questions, but then re-read your post and they get answered.

     

    If the code you provided from within your application.cfc is as it currently exists, you're missing equal signs.  If not, I'm not sure what to do.

     

    V/r,

     

    ^ _ ^

    Translate