Cannot create interface. Cannot create the MYFILENAME ColdFusion interface.

Posted on 2013-11-06
Medium Priority
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



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


Open in new window

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

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

Open in new window

Question by:xeondxb
LVL 53

Accepted Solution

_agx_ earned 1600 total points
ID: 39630848

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


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

Then create an instance of that component.

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

Author Comment

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 ?

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


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Suggested Courses

597 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