Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Problem running contact manager app

Avatar

Level 2
I am trying to run the contact manager sample app and receive
the following client side error:



[MessagingError message='Unknown destination
'cfcontact-default' for service with id 'data-service'.']

at mx.messaging.config::ServerConfig$/getProperties()

at mx.data::Metadata$iinit()

at mx.data::ConcreteDataService$iinit()

at mx.data::ConcreteDataService$/getService()

at mx.data::DataService$iinit()

at contactmgr/::initApp()

at contactmgr/___Application1_creationComplete()

at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.core::UIComponent/set initialized()

at mx.managers::LayoutManager/::doPhasedInstantiation()

at Function/
http://adobe.com/AS3/2006/builtin::apply()

at mx.core::UIComponent/::callLaterDispatcher2()

at mx.core::UIComponent/::callLaterDispatcher()



I cant seem to find any files that reference
cfcontact-default. Ideas? Thanks!!
9 Replies

Avatar

Level 2
u should write the context path in the server.xml and the
transaction factory.

u should import necessary jar files for the transaction to
happen.



Vasibe

Avatar

Level 2
Hmm the problem was 'cfcontact-default' should have just been
'cfcontact'.



Now to another problem when running this example. On load i'm
receiving an error:



[Flex] [ERROR] Exception when invoking service: data-service

with message: Flex Message (flex.data.messages.DataMessage)

operation = fill

id = null

clientId = 18DA1C41-745B-B4C3-06F6-1AAADC0DDB31

correlationId =

destination = cfcontact

messageId = A48465C9-0AEB-7E91-4A1F-1AAADC17AB89

timestamp = 1155793607813

timeToLive = 0

body =

[



]

hdr(DSEndpoint) = cf-dataservice-rtmp

exception: flex.data.adapters.AdapterException: Error
invoking fill-method 'fill' for destination cfcontact: Permission
denied



Here is the code which it is choking on:



private function initApp():void

{

contacts = new ArrayCollection();

ds = new DataService("cfcontact");

ds.addEventListener(ResultEvent.RESULT, resultHandler);

ds.addEventListener(DataServiceFaultEvent.FAULT,
faultHandler);

ds.addEventListener(DataConflictEvent.CONFLICT,
conflictHandler);

ds.autoCommit = false;

var token:AsyncToken = AsyncToken(ds.fill(contacts));

token.kind = "fill";

}





Would someone be kind enough to explain why i am receiving
this error? Thanks!!!

Avatar

Level 2
hi

this is because the transaction is failed it is not invoking
data service method

<Transaction
factory="org.objectweb.jotm.UserTransactionFactory"
jotm.timeout="60"/>

</Context>

u paste this code in the server.xml and restart the server.

thanks

vasibe

Avatar

Level 2
A couple questions.



1. Where is server.xml? I cant find this file anywhere



2. Why do the pre-installed samples work fine without
this?

Avatar

Level 2
If you are running on Tomcat, they you'll have server.xml and
need to add transaction support by installing the JOTM pacakge and
including the definition in server.xml.



If you're not running on Tomcat, that information is not
relevant.



If you're running on JRun or any other J2EE server,
transaction support is already included.



In terms of debugging your original issue,



'exception: flex.data.adapters.AdapterException: Error
invoking fill-method 'fill' for destination cfcontact: Permission
denied'



Based on the logging statements, you can see that the fill
request got to the FDS server. The next step is to determine if the
request got to the cfcontact object. Are you able to add debug
logging statements and or debug the method you've defined for fill
on your cfcontact definition?

Avatar

Level 2

quote:




Originally posted by:
CathyM


The next step is to determine if the request got to the
cfcontact object. Are you able to add debug logging statements and
or debug the method you've defined for fill on your cfcontact
definition?





Unfortunatly i am not really sure how to go about debugging.
Although in the setup documentations for "Using Coldfusion with
Flex - Part 1" number 11 says the flex console should output:



"[Flex] [CFDataServicesAdapter] Configuring CFC adapter for
destination cfcontact"



after making the necessary changes to
data-management-config.xml. Flex doesn't output this, is it safe to
assume this is another way of telling me that Flex is unable to
communicate with my Coldfusion server?

Avatar

Level 3
Hi Dr.,



Did you follow step 6 on page 2 of Tom J's article to the
letter (editing services-config.xml's <logging> section)? Are
you seeing any debug Flex output in the console?



Best,

Seth

Avatar

Level 2
I did. However nowhere in the article did it mention to
replace {server.name} in the services-config.xml file with your
servername/host/ip. Doing this fixed the problem.

Avatar

Level 2
I have followed everything to the T. Somehow i got this
working once, but no i cant get it to work again! I don't know what
else to do.., i assume that im having problems because FDS and CF
arnt communicating as i am continuing to receive:



"error invoking fill-method 'fill' for destination
cfcontact-default: permission denied"



i also noticed when that im receiving an error requested
resource /samples/messagebroker/cfamfpolling
(%2fsamples%2fmessagebroker%2cfamfpolling) not found



not sure if this has anything to do with it, and also i keep
reading that some people get it to work by replaceing
{server.name}:{port} in services-config.xml, ive tried everything,
not sure what else to do. Thanks.