Skip to main content
Participant
January 6, 2011
Question

Problem with cfcexplorer.cfc

  • January 6, 2011
  • 3 replies
  • 6342 views

I'm actually working through a Flash Builder demo here (http://www.adobe.com/devnet/flex/testdrive/articles/1_build_a_flex_app2.html).

I got to the point of adding the service - i entered the rds password, hit next and got the following error:
 
The CFC file is invalid. Possible causes can be found by accessing: http://localhost:8500//CFIDE/componentutils/cfcexplorer.cfc?method=getCFCMetaData&name=EmployeeService&path=%2FSecretFarmer.com%2Fwww%2Ftestdrive%2Fservices%2FEmployeeService.cfc">http://localhost:8500//CFIDE/componentutils/cfcexplorer.cfc?method=getCFCMetaData&name=EmployeeService&path=%2FSecretFarmer.com%2Fwww%2Ftestdrive%2Fservices%2FEmployeeService.cfc 
 
When I browse to that URL I get the following:
 
The value returned from the getCFCMetaData function is not of type struct.
If the component name is specified as a return type, it is possible  that either a definition file for the component cannot be found or is  not accessible.
  
Resources:
 
     * Check the ColdFusion documentation to verify that you are using the correct syntax.
     * Search the Knowledge Base to find a solution to your problem.
 
Browser    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Remote Address    0:0:0:0:0:0:0:1%0
Referrer    http://localhost:8500//CFIDE/componentutils/cfcexplorer.cfc?method=getCFCMetaData&name=EmployeeService&path=%2FSecretFarmer.com%2Fwww%2Ftestdrive%2Fservices%2FEmployeeService.cfc 
Date/Time    05-Jan-11 08:59 PM
Stack Trace
 
 
coldfusion.runtime.UDFMethod$InvalidReturnTypeException: The value  returned from the getCFCMetaData function is not of type struct.
  at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:429)
  at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
  at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
  at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
  at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
  at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
  at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
  at coldfusion.filter.ComponentFilter.invoke(ComponentFilter.java:187)
  at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)
  at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
  at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
  at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
  at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
  at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
  at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
  at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
  at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
  at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
  at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
  at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
  at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:138)
  at coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:289)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
  at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
  at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
  at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
  at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
  at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
  at jrun.servlet.FilterChain.service(FilterChain.java:101)
  at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
  at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
  at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
  at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
  at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
  at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
  at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
  at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
  at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

Any assistance would be appreciated.  Using Coldfusion 9.0.1 on MacBook Pro, Flashbuilder 4.0.1

    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    February 6, 2011

    @JohnAtNook

    Some clarity is in order. Regarding debugging cfcexplorer.cfc, the cfcatch I gave has an omission, I'm afraid. You should try something like

    <cfcatch type="coldfusion.runtime.CfJspPage$NoSuchTemplateException">
         <cfset error.message="<h4>Component not found</h4>The  component definition file for component '#HTMLEditFormat(name)#' cannot  be found on this server.">
        <cfreturn error>
    </cfcatch>

    <cfcatch type="any">

         <cfset error = cfcatch>
         <cfreturn error>
    </cfcatch>

    I wont be surprised if you find irregularities. For a start, ColdFusion should have caught the coldfusion.runtime.UDFMethod$InvalidReturnTypeException. Report any findings to the CF team.

    I am assuming naturally that you have backed up the original cfcexplorer before beginning these games! As Adam quite rightly says, it isn't wise to go tinkering in ColdFusion's underbelly without backup.

    Secondly, about your custom CFC, EmployeeService. You should check whether there is a difference between the path relative to the ColdFusion web root, and the path of the project in Flash Builder.  The CFEclipse, CF Builder and Flash Builder IDEs store file metadata, which may get corrupted. It might help to navigate to the menu Project, and to Clean the project.

    Participating Frequently
    February 6, 2011

    I tell you this....without getting into all of this, I expect a company as large as Adobe, when they post a demo/tutorial online for people to learn a new tool and technology, that the darn thing should work without having to edit their 'core', behind the scenes code. So a little wrist-slap on Adobe's part, they can do better.

    Anyway, it is some cool technology...just going to take addtional work and study to get the feel of how all this works together.

    Appreciate all the time and help folks, look forward to getting into some addtional Flex challenges.

    If any of you can recommend some additional learning resources, that would be very helpful !

    Thanks again, this was fun!

    GK

    BKBK
    Community Expert
    Community Expert
    February 5, 2011

    JohnAtNook,

    It is likely that your problem too is caused by a cfcatch block that doesn't return a struct.

    Inspiring
    February 5, 2011

    Mate, the CFC he's showing us code from is part of CF (/CFIDE/componentutils/cfcexplorer.cfc): it's not his code.  And, also, I'd be hesitant to change core CF files. No matter how badly written they are.

    Anyway, the issue here is not that file, it's the code calling that file.  The CFC path being passed-in is invalid.

    --

    Adam

    BKBK
    Community Expert
    Community Expert
    February 6, 2011

    Adam Cameron. wrote:

    Mate, the CFC he's showing us code from is part of CF (/CFIDE/componentutils/cfcexplorer.cfc): it's not his code.  And, also, I'd be hesitant to change core CF files. No matter how badly written they are.

    The path you show is of the explorer, which ColdFusion runs when you wish to explore your custom CFC. I was talking about JohnAtNook's own custom CFC, called EmployeeService.cfc,

    Participating Frequently
    February 5, 2011

    I am working through the tutorial as well (Build a Flex app in an Hour)...and getting the same error/problem.  Here's the code (cfc component) that is failing:

    <cffunction name="getCFCMetaData" returnType="struct" output="no" access="remote"                

    hint="Returns MCDL document representing the specified component.">

    <cfargument name="name" type="string" required="no" />

    <cfargument name="path" type="string" required="no" />

    <cftry>

    <cfscript>

    if ( IsDefined('arguments.path') and arguments.path neq '' )

    {

    // we are trimming the extension if provided with path. because of

    // 76373. We want to use GetComponentMetadata method as it gives advantage

    // over GetMetadata, in terms of not initializing the object to get metadata.

    // but Flex builder request come to call this method directly which have .cfc appended in the path.

    var trimmedPath = HTMLEditFormat(arguments.path);

    var indexOfCFC = FindNoCase("cfc.",reverse(trimmedPath)); // "cfc." = reverse(".cfc")

    if (indexOfCFC eq 1) // trimmedPath ends with .cfc

    {

    trimmedPath = Left(trimmedPath, len(trimmedPath) - 4); // Remove .cfc

    }

    return getComponentMetaData(trimmedPath);       <----- returning a strucrt?...looks like a string maybe

    }

    else if( isDefined('arguments.name') )

    {

    //This name should be a fully qualified name.

    return getComponentMetaData(HTMLEditFormat(name));     <-----  and/or here ??

    }

    </cfscript>

    <cfcatch type="coldfusion.runtime.CfJspPage$NoSuchTemplateException">

    <cfoutput><h4>Component not found</h4>

    The component definition file for component '#HTMLEditFormat(name)#' cannot be found on this server.</cfoutput>

    </cfcatch>

    </cftry>

    </cffunction>

    Inspiring
    February 5, 2011
    return getComponentMetaData(trimmedPath);       <----- returning a strucrt?...looks like a string maybe

    If you look @ the docs for getComponentMetadata() - http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d9a.html - you'll see it does return a struct.  And, also, if that was actually the problem the method would never work.

    However, looking at the "logic" (if it can be called that) in that method, if there's a coldfusion.runtime.CfJspPage$NoSuchTemplateException exception, then the method doesn't return anything, which would cause the error you're seeing.

    So I guess that's what the problem is the code is falling through to the <cfcatch> block, which is itself shonkily written, and causing its own wee error.

    Perhaps take the try/catch out and get a better idea of what the exception actually is.  Or dump out the cfcatch struct in the CFCATCH block, and follow it with a CFABORT.

    --

    Adam

    Participating Frequently
    February 5, 2011

    Adam, thanks for the reply!

     

    I did go to the docs and saw the return struct being proper after I posted...replied to the post. 

     

    I am simply trying to get thru step-by-step one of Adobe's online tutorials (Build an app in an hour) that came with FlashBuilder 4.   Shouldn't this all work without all this trouble and confusion (Adobe thoroughly testing)???

     

    I appreciate your reply....it appears others are experiencing the same error as well...isn't there a fix beyond additional try/catch ideas?

     

    GK