Solved

Cannot create interface. Cannot create the MYFILENAME ColdFusion interface.

Posted on 2013-11-06
3
273 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 15

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now