Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cannot create interface. Cannot create the MYFILENAME ColdFusion interface.

Posted on 2013-11-06
3
Medium Priority
?
293 Views
Last Modified: 2013-11-10
im trying to create interface in coldfusion continues im getting this error.

-----------------------------------------------------------


Cannot create interface.
 
 Cannot create the IUser ColdFusion interface.  
 
 The error occurred in C:/ColdFusion10/cfusion/wwwroot/ASSET/Components/Install.cfm: line 27
 
25 : 			
26 : 			<cfscript>
27 : 		  		CreateSUser = createObject("component", "IUser");
28 : 		  		SuperUserFmData = CreateSUser.SuserPushToDb(CreateUser);
29 : 			</cfscript>

 

Open in new window




----------------------------------------------------------


IUser.cfc
<cfinterface>

	<cffunction name="SuserPushToDb"  returntype="string" >
		<cfargument name="SuperUserFmData" type="struct" required="yes">		
	</cffunction>

</cfinterface>

Open in new window


Install.cfm
<!--- Submit Action   --->
<cfif isdefined("submit")>
	<cfparam name="SuperUserFmData" default="Record Inserted in Database Successfully!" >		

	<cfscript>
      CreateUser= StructNew();
	  </cfscript>
      
	  	<cfloop index="i" list="#form.fieldnames#">  
             	
           <cfif i NEQ "Submit">
	       		<cfscript>
	               StructInsert(CreateUser, i, Evaluate(i));
	             </cfscript>
			</cfif>
                  
		</cfloop>		
			
			<cfscript>
		  		CreateSUser = createObject("component", "IUser");
		  		SuperUserFmData = CreateSUser.SuserPushToDb(CreateUser);
			</cfscript>
			
</cfif>

Open in new window

0
Comment
Question by:xeondxb
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 1600 total points
ID: 39630848
EDIT:

> CreateSUser = createObject("component", "IUser");

Interfaces aren't meant to be instantiated. They just define a set of rules (or functions) that other components will actually implement. So I don't think you can create one w/createObject, which explains the error message.

You need to create a concrete component that implements the interface:

YourConcreteComponent.cfc

<cfcomponent  implements = "IUser" >
      <cffunction name="SuserPushToDb"  returntype="string" >
       <!--- .... must implement IUser methods here  --->
      </cffunction>
</cfcomponent>

Then create an instance of that component.

     CreateSUser = createObject("component", "YourConcreteComponent");
0
 

Author Comment

by:xeondxb
ID: 39636535
thank you understood! can you tell me one more small thing these kind of error where we can find more descriptive details in logs or console ?

is their any debugging tool used for Coldfusion ?

Thanks
0
 
LVL 16

Assisted Solution

by:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 400 total points
ID: 39637841
There are many:

You can use cfdump, cftimer, cftrace, cflog and you can use cftry. cfcatch blocks to dump the values out and display on the screen

Thanks
0

Featured Post

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.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

963 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