Solved

Cannot create interface. Cannot create the MYFILENAME ColdFusion interface.

Posted on 2013-11-06
3
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

623 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