Solved

Cannot create interface. Cannot create the MYFILENAME ColdFusion interface.

Posted on 2013-11-06
3
270 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:myselfrandhawa
myselfrandhawa 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

758 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

18 Experts available now in Live!

Get 1:1 Help Now