Solved

Cannot create interface. Cannot create the MYFILENAME ColdFusion interface.

Posted on 2013-11-06
3
274 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 400 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 100 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

785 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