Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problem with cfcexplorer.cfc

New Here ,
Jan 06, 2011 Jan 06, 2011

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=EmployeeServi...">http://localhost:8500//CFIDE/componentutils/cfcexplorer.cfc?method=getCFCMetaData&name=EmployeeServi... 
 
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=EmployeeServi... 
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

6.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

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)???

Well you'd think so, wouldn't you?  However it's clear from that code that it was't written by someone who's a particularly talented programmer, so It doesn't surprise me it doesn't work very well.

However the code generally works: if it's given valid inputs, it'll run fine.  The problem is with how it's being called, not specifically that it's written sloppily.

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

I'm not suggesting that's a fix, I'm suggesting it's a troubleshooting step to work out what's going wrong.  It's the calling code that has a problem, not this code.  What is the code that's calling this method?

But anyway, all that code is for is viewing the auto-generated API documentation for a CFC.  It's not going to be essential for whatever you're doing, surely?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

Slight variation on Adam's answer.  Instead of dumping the cfcatch struct in the function, return it to the caller.  Do the dump and abort in the caller.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

Not sure how to do all that, I am new to Flex.

 

Not trying to be rude...Is anyone at Adobe support familiar with the "build an app in an hour" tutorial, and understands the problem?

 

Thanks!  GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

People from adobe support are not the ones who answer questions on this forum.  Generally speaking, it is a better idea to test cfc's using ColdFusion first, because it's simpler and gives you more flexibility.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

OK, the first thing to get clear in your head is this has nothing to do with Flex (either the issue you're asking about, or this forum).  Flex is a language for creating SWF files; the code you're calling is CFML - ColdFusion.  The two have nothing to do with each other, other than the fact CFML can be used for the "server" side of things to the SWFs "client side" in a client/server situation.

Like I asked before... where's YOUR code... the code you're running that's making this call to CFCExplorer.cfc..?  It's that code that's wrong.

PS: contrary to the occasional suggestion otherwise, these forums really aren't monitored by Adobe Support, so there's no point directing questions to them here.  If you want to talk to Adobe Support, you need to contact them directly.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

Gotcha...thanks Adam, I thought you were responding as an Adobe support...my bad.

 

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

Nup, these forums are community-driven.  I'm just a CF developer who's looking for anything to distract him from the work I should be doing this evening... 😉

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

I appreciate your time....

So here goes....you are asking for 'my' code (the CF code doing the calling)...  Don't have any, what I am doing is using all the wizards as part of the tutorial, everything is being generated in the background.

In the lesson, you drag a grid and 2 buttons on to the workspace (create the UI).  Then the next step is to "Connect to Data/Service" (in this case a CFC), using a wizard...this is the point where I am getting the errors.  Here is the code from "cfexplorer.cfc" that is getting the error, :

<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);

}

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

{

//This name should be a fully qualified name.

return getComponentMetaData(HTMLEditFormat(name));

}

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

Here's a picture of the error message...when I go to the URL that is listed in the error message, the next picture is the corresponding error message from CF...

error_message1.jpg

error_message2.jpg

So I'm not sure at this point where any of the code that is being run/generated is within FB 4., or where/what to do to try to understand and resolve the problem.

Thanks for any ideas

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

Ah, I see.

I've never used FB, so am not familiar with its wizards.  Which doesn't help 😉

However, we can still troubleshoot this a bit.

Can you browse to http://localhost:8500/services/EmployeeService.cfc ?

To be able to generate the metadata for the CFC, CF has to be able to find it.  It's looking on that path.  Is that where it is?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

Yes...I had to add 'TestDrive' to the path you provided, that is the name of the flex project:

http://localhost:8500/TestDrive/services/EmployeeService.cfc

Here what I get (partial screen capture), looks like it finds it ok...it does appear to list all the component functions, 9 functions alltogether:

message3.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

Yes...I had to add 'TestDrive' to the path you provided, that is the name of the flex project:

http://localhost:8500/TestDrive/services/EmployeeService.cfc

OK, so why is your code trying to refer to it as /services/EmployeeService.cfc?  That's what your problem is.  I guess you're not writing any "code" per se, but you might not be following the instructions in the wizard or the tutorial properly?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

Help me out...where is my code referring to " /services/EmployeeService.cfc?"   I don't see any code, anywhere Adam ...

Anyway...turns out now that my CF server was not running, and now I can't get it to start, security problems.  Very frustrtated....

I think I am going to abandon Flex for now...stick with CF.

Thanks!   GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

No....server was running...I was mistaken.

OK, I'm not giving up yet, just getting frustrated !

It looks like it is firing the error message in the catch block...component can't be found (that's why I thought the server wasn't running).

What in the world could be causing this service not to be found, I point to it with the wizard just fine (now that that is working)...but it just isn't returning (showing) the methods.

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

@Adam

My apologies...I'm with you now...I see the code in the ERROR message I included above (little hard to catch at first)...why didn't you point me there Bud?

Anyway....need to figure out where the wizard is not using the correct PATH....what code is being generated.  :{

gettin there...

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

My apologies...I'm with you now...I see the code in the ERROR message I included above (little hard to catch at first)...why didn't you point me there Bud?

Hey, you pointed it out to me!  I was just reading what you posted... 😉

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2011 Feb 05, 2011

Anyway....need to figure out where the wizard is not using the correct PATH....what code is being generated.  :{

Are you sure you haven't missed a step where you set a path or a mapping or something?  Or you're creating your stuff in a different dir from when the tutorial says?  I've been tripped up by that sort of stuff before...

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2011 Feb 05, 2011

SUCCESS!

OK Adobe...I don't know  :{

All I did was copy and pasted the 'services' folder up one level to the wwwroot, and it worked!

Yet the wizard (I don't know if I would call it that...) is still looking under the project's named folder, one level down.

So it takes making a duplicate folder of the services where the CFC resides to make this thing work.

The wizard looks for and will only accept this location:

C:\ColdFusion9\wwwroot\TestDrive\services\EmployeeService.cfc  (it looking for the project name in the path, "TestDrive")

But you have to fake it out and do this as well, make a copy and paste it one level up:

C:\ColdFusion9\wwwroot\services\EmployeeService.cfc

Something fishy about FB4....anyway....I'm there.

Thanks for the help fellow CF peeps!

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2011 Feb 05, 2011

gkane0120 wrote:

SUCCESS!

OK Adobe...I don't know  :{

All I did was copy and pasted the 'services' folder up one level to the wwwroot, and it worked!

Yet the wizard (I don't know if I would call it that...) is still looking under the project's named folder, one level down.

So it takes making a duplicate folder of the services where the CFC resides to make this thing work.

The wizard looks for and will only accept this location:

C:\ColdFusion9\wwwroot\TestDrive\services\EmployeeService.cfc  (it looking for the project name in the path, "TestDrive")

But you have to fake it out and do this as well, make a copy and paste it one level up:

C:\ColdFusion9\wwwroot\services\EmployeeService.cfc

Something fishy about FB4....anyway....I'm there.

Thanks for the help fellow CF peeps!

GK

Perhaps a mapping in the ColdFusion Administrator pointing to that path?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 06, 2011 Feb 06, 2011

It looks to me like it's expecting C:\ColdFusion9\wwwroot\TestDrive\ to be the web root for this app, whereas you've got C:\ColdFusion9\wwwroot\ set..?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 08, 2011 Feb 08, 2011

Test reply...

 

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 08, 2011 Feb 08, 2011

Hey all...just a quick reply and apology to everyone (incl. Adobe).

 

I reloaded and started everything from the beginning (folder setup, you were right Adam), and all worked just fine, no problems!

 

I learned something from our discussions though, thanks again!

 

GK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources