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

Stuck on Flex Test Drive Tut, Unable to invoke CFC testdrive_db

New Here ,
Nov 20, 2010 Nov 20, 2010

Hi peoples

I am new to most of this stuff, just so's you know.

I am following the Testdrive tutorial at

http://www.adobe.com/devnet/flex/testdrivemobile/articles/mtd_1_1.html

I have got down to step 7 which states

Test the setup by browsing to http://{your server:your port}/TestDrive/test/test.html. For a default standalone ColdFusion installation, browse to http://localhost:8500/TestDrive/test/test.html. You should see employee data from the database successfully displayed in a datagrid.

I type the following into my ie8 browser

http://localhost:8500/TestDrive/test/test.html

and i get a dialog box with this error message

faultCode:Server.Processing faultString:'Unable to invoke CFC - Datasource testdrive_db could not be found.' faultDetail:'For details, turn on Robust Exception Information in the ColdFusion Administrator'

Oh and a small blank grid? too

Things I have tried/looked at etc

I turned on Robust Exception in the admin page, but don't know if this helps. I don't see any output anywhere.

I have seen flex2gateway errors but when I type localhost/flex2gateway I get the blank page.

I have made the mods in the tutorial regarding setting property cases etc

er I don't actually know how to perform step 6 Restart the Coldfusion server (I rebooted, don't laugh)

If I dbl click the swf file directly under wwwroot/TestDrive/test I get the following error

faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Security.Error error Error #2048 url: 'http://localhost/flex2gateway/''

My crossdomain.xml file in the wwwroot folder looks like this

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<!--Generic policy file for flex app access, it should be made more restrictive -->

<cross-domain-policy>

<site-control permitted-cross-domain-policies="all"/>

<!-- <allow-access-from domain="*.example.com"/> -->

</cross-domain-policy>

I am running Windows 7 64bit

I have installed CF9

Any help is very gratefully received

Ta Tom

TOPICS
Getting started
2.1K
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 ,
Nov 20, 2010 Nov 20, 2010

The error message says you don't have the data source defined. Do you?

Also: to restart CF, use the Services applet (Windows), or perform some sort of witchcraft (*nix). Haven't used *nix for a while, sorry ;-).

--

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 ,
Nov 20, 2010 Nov 20, 2010

Hi Adam

Yes, the datasource is defined and verified

Thanks for the services tip, should have thought have that.

Any suggestions for checking?

ta

Tom

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 ,
Nov 20, 2010 Nov 20, 2010

Sorry, dunno anything about Flex's integration with CF.  Or indeed anything about Flex at all.

What I'd be doing if faced with this would be to write a CFM template that makes the same CFC call as Flex is doing, and see if you get a better error message.

But I've never seen CF claim a data source doesn't exist when it actually does, though...

--

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 ,
Nov 20, 2010 Nov 20, 2010

Hi Adam

It has just occurred to me, would this question be better placed on a FLEX forum?

Can I cross post?

Ta

Tom

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 ,
Nov 20, 2010 Nov 20, 2010

Well you could try: "nothing ventured nothing gained", etc.

However knowing what people are like, the Flex bods'll see a problem connecting to CF and send you back here 😉

To be honest, I'm not representative of CF developers on the whole: I've been a CF developer for nine years and only in my most recent job (last six months) have I really had to do front-end type stuff.  I'm mostly an application developer, and we've had other people on the team to do UI stuff.  As such I've never really had to get into UI technologies, so have never had to troubleshoot them.

But there'll be plenty of other bods on this board who will know.  It's probably a bit quiet because it's Saturday (or over in the States where everyone lives in the past... still Friday night, probably 😉

--

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 ,
Nov 20, 2010 Nov 20, 2010

Hi Adam

You were right.

I got sent back here by the Flex peeps.

Prophetic really.

So, i have to wait until the USA wake up, as I understand it.

Hey, I can wait, What have I got to lose?

It's only time.

So, any nice, kind, Uncle Samites in the audience?

Thanks

Tom

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 ,
Nov 20, 2010 Nov 20, 2010

Did you try my suggestion of knocking a CFM together to emulate the calls Flex is making, to see if you get better info?

It might also be worthwhile looking @ the CF & JRun logs to see if they cast more light on the scene...

--

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 ,
Nov 20, 2010 Nov 20, 2010

Hi Adam

Thanks for replying.

Unfortunately, I don't know what a CFM template is, let alone knocking one up.

I have had a look at some logs in the admin panel, but confess I don't know where to look for jrun logs.

Sorry for being such a muppet. Kinda reminds me of when I first used a ZX81

I shall trail through the CF tuts. I hate to waste people's time.

I have probably alienated myself from the Flex forum; ho hum

Thanks

Tom

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 ,
Nov 20, 2010 Nov 20, 2010

I know you said that the datasource was defined, but since you seem fairly unfamiliar with CF, I hope you won't object to my asking how you verified that. The datasource is in the CF Administrator - it's separate from the database itself.

Double-clicking on the SWF won't work, because that will cause it to be run using a filesystem path, not through an HTTP URL (as it needs to).

The crossdomain.xml file isn't really important here, as all of the URLs needed come from the same domain.

You might try running the CFC directly:

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

That URL should redirect to a documentation page, which shows the methods you can call. Then, try rerunning the same CFC with additional URL parameters to execute it directly, something like this:

http://localhost:8500/TestDrive/services/EmployeeService.cfc?method=foo&arg1=bar&arg2=baz (methods and arguments will vary, of course)

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC
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 ,
Nov 21, 2010 Nov 21, 2010

Hi David

Many thanks for replying. You are correct in that I am unfamiliar with CF. I have database experience and sql. I usually use Toad or DBvisualiser at work to see schemas. I have no idea how to see a schema for this source.

I verified the source in the admin panel and it came back with "OK"

I ran the CFC as suggested (I didn't know you could do this) and it returned the page as expected. I don't know what this proves though (but something is right). As for running the CFC with additional parameters I would appreciate a little help. I suspect you will need to know the methods and columns? parameters?

In total ignorance, I have tried the following: (with http://)

localhost:8500/TestDrive/services/EmployeeService.cfc?method=getEmployeesSummary

localhost:8500/TestDrive/services/EmployeeService.cfc?method=getEmployeesSummary()

localhost:8500/TestDrive/services/EmployeeService.cfc?method=getEmployeesSummary ( )

localhost:8500/TestDrive/services/EmployeeService.cfc?method=getEmployeesByID&1

And the structure from the CFC page

============================================================

getEmployeesByID

remote Struct getEmployeesByID ( required numeric itemID )

Output: suppressed
Parameters:
itemID: numeric, required, itemID

============================================================

getEmployeesSummary

remote Query getEmployeesSummary ( )

Output: suppressed

============================================================

I thought getEmployeesSummary would be easiest as it doesn't appear to expect parameters

I get the hourglass equivalent on the page for each of the above queries

System info

HotFix version (unknown)

OS Windows 7

Webserver Apache 2.2

Database (Don't know, I thought it was ColdFusion)

many thanks

Tom

 

 

 

 

ColdFusion Version

9,0,1,274733

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 ,
Nov 21, 2010 Nov 21, 2010
LATEST

To run the CFC methods directly from the browser, you'd specify the arguments (if any exist) as URL parameters.

http://localhost:8500/TestDrive/services/EmployeeService.cfc?method=getEmployeesByID&itemID=1

http://localhost:8500/TestDrive/services/EmployeeService.cfc?method=getEmployeesSummary

Now, having seen some of the code of those methods in your post, I think that you might not see any visual results, so the next step would be to invoke them yourself from CF, then viewing the results. You can do this by writing a new .cfm file, and putting something like this in it:

<cfinvoke webservice="http://localhost:8500/TestDrive/services/EmployeeService.cfc?wsdl"

     method="getEmployeesSummary"

     returnvariable="qEmployees">

<cfdump var="#qEmployees#" label="Employees query">

<cfinvoke webservice="http://localhost:8500/TestDrive/services/EmployeeService.cfc?wsdl"

     method="getEmployeesByID"

     itemID="1"

     returnvariable="qOneEmployee">

<cfdump var="#qOneEmployee#" label="First employee">

I haven't tested this code, so it may be incomplete or in error, but it should be pretty close.

You could also test the database directly by copying a query from one of the CFCs and putting it directly in a .cfm page, dumping the results as shown above, and running that.

> Database (Don't know, I thought it was ColdFusion)

ColdFusion is an application server, not a database. I believe that this tutorial uses Apache Derby, which is a Java database that is installed as part of ColdFusion.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

GSA Schedule, and provides the highest caliber vendor-authorized

instruction at our training centers, online, or onsite.

Read this before you post:

http://forums.adobe.com/thread/607238

Dave Watts, Eidolon LLC
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