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

cfobject en Application.cfc

New Here ,
May 04, 2020 May 04, 2020

Copy link to clipboard

Copied

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

apereirn_0-1588629714189.png

en Application.cfc defino de la siguiente forma:

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

Views

1.5K

Translate

Translate

Report

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 Expert , May 05, 2020 May 05, 2020

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>

 

Votes

Translate

Translate
LEGEND ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

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,

 

^ _ ^

Votes

Translate

Translate

Report

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 Expert ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

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">

Votes

Translate

Translate

Report

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 ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 Expert ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

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>

 

Votes

Translate

Translate

Report

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 ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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
Documentation