Flex + BlazeDS + ColdFusion + SQL
Ok, I'm relatively new to this whole Flex thing -- I've been
through a few tutorials, written a few apps, but I'm still unclear
on a few things.
I just want to write an app that reads record(s) from an SQL
database, and allows the user to modify and update those record(s).
Should be extremely simple, and yet somehow it's been overly
complicated by a dozen layers of (seemingly unnecessary) software.
So here are my questions:
#1) Why can't Flex talk to an SQL database directly? Why do I
need ColdFusion for this?
#2) What the heck is BlazeDS? (Yes, I've read the FAQ and I
still don't understand why I need it.) If I'm running BlazeDS, do I
really need ColdFusion? If so, why?
#3) In the BlazeDS FAQ, it mentions something about accessing
server-side Java objects -- so do I need to install JavaEE on top
of CF and the SQL database now, too?
It just seems so overly complicated for such a simple task.
If someone could explain all this to me, I would greatly
appreciate it.
"Laurence MacNeill" <[email protected]>
wrote in message
news:[email protected]...
>
quote:
Originally posted by:
riesvantwisk
>
> 1) Flex (AIR) can talk to SQLite directly and I believe
there is a MySQL
> driver (Also air??) that can talk to MySQL directly.
Other databases are
> not
> supported.
> The main reason for this is that flex (browser) needs a
client/server
> architecture. It more or less is the same reason that
javascript doesn't
> talk
> to any DB directly. And the reason is that http protocol
is the 'standard'
> to
> communicate between a web-browser and a remote server,
works across
> firewalls
> etc... For AIR there are simple no drivers yet, but I
believe some are
> currently in development.
> Ok, so basically if I want web functionality in my Flex
app, I have to use
> CF
> because HTTP breaks the direct connection between the
Flex app and the SQL
> database. Fine...
>
>
>
>
quote:
2) If you want to use Blaze-DS then you need java on the
server.
> Blaze-DS
> is your middle layer that accepts a AMF request and
passes the request to
> a
> pojo. Blaze-DS makes it simple to make that middle layer
you hate so much.
> It
> can do more, like sending messages to attached clients
from the
> server.
> Got no idea what a 'pojo' is. Or really what an AMF
request is. I know
> AMF
> has something to do with remote-control of clients, or
something like
> that?
>
>
>
>
quote:
3) TO use Blaze-DS you can use a simple tomcat server if you
want to,
> and I
> believe on the of the Blaze-DS samples even comes with
tomcat.
> Got no idea what a 'Tomcat server' is either. Never even
heard of it.
>
>
>
>
quote:
The whole system is not really over-complex ... <SNIP>
... May be you
> can
> explain what environment you are running?
> Yeah, I'll need my app to run in both a web-browser and
on a desktop.
> It's
> the main reason I chose Flex, since it's just a simple
re-compile to go
> from
> web to desktop (as long as I'm not interested in
Air-specific
> local-filesystem
> calls, which I'm not because all our data is going to be
stored on the web
> server.) Technically I could run everything through a
Flash-equipped
> web-browser -- but why bother with using a web-browser
on local intranet
> machines? Just takes up extra bandwidth on the local
network. So we'll
> run
> the app in Air on local machines, and customers will run
it through their
> Flash-equipped web-browsers on their home machines.
>
> But I still don't get why BlazeDS is needed. What does
it do, exactly?
> And
> how hard is it to set up all the J2EE and Tomcat stuff
(whatever the heck
> Tomcat is) before you're able to run BlazeDS? It just
seems like such a
> hassle. (Heck, CF is enough of a hassle -- I can't even
get that to
> install
> without killing IIS...)
BlazeDS handles all the messaging for you. If you don't need
your apps to
be informed of stuff without making server request, you can
use literally
any back end under the sun, ASP, PHP, even good ole CGI.
Similar Messages
-
How save & retrive data from database using flex, coldfusion, sql server
hi , i am very new in flex, i am trying to insert data in
database using flex2, coldfusion, sql server. any one can help me
please. or give me any example.Hi try to goto the following sites, you will get some
direction to think
http://weblogs.macromedia.com/pent/archives/2006/11/example_of_flex.cfm
http://pdxphp.org/node/258
Good Luck -
Flex and Coldfusion error handling
Hello! I was wondering if someone could point me in the right direction regarding error handling in a Flex app thats using an HTTPSERVICE RPC to a Coldfusion component.
If a user is entering form data in Flex and clicks submit... the data is sent via the HTTPSERVICE send method as XML to the CFC. But what if there is a Coldfusion SQL insert statement error? Say a user enters a character in a number field (now i know the best thing to do would be to have actionscript ensure that the values entered are numbers but lets keep that aside just for this example). How could I alert the user to let them know the CFC encountered a SQL error? Or better yet... alert them that everything went "A" ok and their data was successfully submitted.
I originally thought to put CFTRY and CFCATCH around the CFC code. I could do that fine, but had trouble passing back a message string so that FLEX could use it in an Alert.Show window.
Thanks!
-BosDogHey Mike,
Sorry after I posted I thought "this may be a question for CF guys as well".
I definitely use and love RemoteObjects. Its great for binding to datagrids and to run SQL to return data from the server back to Flex. I've struggled with successfully passing variables from Flex to CF using RemoteObject though. Say a dataform with 5 text fields & 2 combo box dropdowns.
I think you may have forgotten to post the link to the article for me to read... i didnt see it in your last post?
Thanks! -
Anyone know how to gernerate CRUD applications with flex and coldfusion?
Anyone know how to gernerate CRUD applications with flex and
coldfusion? I am working with a remote coldsfusion installation
with MS SQL and I don't have RDS.You might investigate "squidhead". It is CF based. I'm not
sure if it has any Flex related features.
http://squidhead.riaforge.org/ -
How do I save a file to a server using flex and coldfusion?
How do I save a file to a server using flex and coldfusion?
On the CF side I might need to use this:
<cffile action="UPLOAD" filefield="Filedata"
destination="#expandpath('..\somepath)#"
nameconflict="overwrite">
And on the flex side I might need to use something like this:
var sendVars:URLVariables = new URLVariables();
sendVars.action = "upload";
var request:URLRequest = new URLRequest();
request.data = sendVars;
request.url = _strUploadScript;
request.method = URLRequestMethod.POST;
_refUploadFile = new FileReference();
_refUploadFile = _arrUploadFiles[_numCurrentUpload].data;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS,
onUploadProgress);
_refUploadFile.addEventListener(Event.COMPLETE,
onUploadComplete);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR,
onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
onUploadSecurityError);
_refUploadFile.upload(request, "file", false);
I just don't know how to put it all together in Coldfusion.try this...
http://cf-creations.co.uk/blog/index.cfm/2008/9/20/Flex--File-Upload-Form--Part-One--Build ing-The-Initial-Form -
Problem in RPC call (flex,blazeds,spring,H2,tomcat,eclipse)
Hi, I've problem displaying value from backend onto the flex UI. I'm using Flex,BlazeDS, Spring, H2 in my applicaiton (testdrive app).
I've basically added another flex project to the testdrive app i downloaded. everything is working fine except the intended rpc invoke.
pls find the code snippets for the related change below :
1. FlexHelloWorld.mxml
private function resultHandler(event:ResultEvent):void
//used for debugging - shows details about result
//returned by the Java class method
Alert.show("success... in flex");
Alert.show( ObjectUtil.toString(event.result) );
<mx:RemoteObject id="ro" destination="helloServiceDestination" result="resultHandler(event)" fault="faultHandler(event)"/>
<mx:Panel x="25" y="10" width="653" height="407" layout="vertical" title="Test Flex 3 Using Java" borderColor="#008040" fontFamily="Arial" fontWeight="bold" fontSize="13">
<mx:Text text="Click The Button To Test Getting Data Into Flex From A Java Class" fontWeight="bold" width="250"/>
<mx:Button label="Get Hello World Mesg From Java!" click="ro.getHelloWorld()"/>
</mx:Panel>
2. remoting-config.xml in flex
<destination id="helloServiceDestination" channels="my-amf">
<properties>
<source>org.springframework.flex.samples.example.HelloWorld</source>
</properties>
</destination>
3. flex-servlet.xml in spring
<flex:remoting-destination ref="helloServiceDestination" />
4. app-config.xml in spring
<bean id="helloServiceDestination" class="org.springframework.flex.samples.example.HelloWorld">
</bean>
5. HelloWorld.java
package org.springframework.flex.samples.example;
* TODO Document HelloWorld
* <p />
* @author Vinod.Jayakumar
public class HelloWorld {
public String getHelloWorld(){
return "HelloFromJava";
expected result : http://localhost:1977/testdrive/FlexHelloWorld.html on click of button in the screen a alert message "HelloFromJava" should be shown but i get the following error message :
(mx.rpc::Fault)#0
content = (null)
errorID = 0
faultCode = "InvokeFailed"
faultDetail = "Couldn't establish a connection to 'helloServiceDestination'"
faultString = "[MessagingError message='Destination 'helloServiceDestination' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']"
message = "faultCode:InvokeFailed faultString:'[MessagingError message='Destination 'helloServiceDestination' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']' faultDetail:'Couldn't establish a connection to 'helloServiceDestination''"
name = "Error"
rootCause = (null)
Request you all to provide your valuable inputs. I know there's really something silly which has gone wrongHi jvk180:
Firstly, you should either need to define the destination in remoting-config.xml or in app-context.xml, but and in both places.
Secondly, the error indicates that it is missing the channel information.
Option 1:
Assuming your bean "helloServiceDestination" uses other Spring beans, then:
1. The right place to declare the destinations is in app-context.xml.
2. In that case, you need to also define the channels that the destination will be exposed over. See documentation for how to do that.
3. In your remote object declaration, you need to pass the channel set that gets used as well.
<mx:ChannelSet id="cs">
<mx:AMFChannel url="http://<yourServerName>:<yourServerPort>:/<yourContextRoot>/messagebroker/amf"/>
</mx:ChannelSet>
<mx:RemoteObject id="ro" destination="helloServiceDestination" channelset="{cs}" result="resultHandler(event)" fault="faultHandler(event)"/>
Option 2:
If you declare your destination, in remoting-config.xml, then you need to compile your swf with services-config.xml. Refer to documentation for how to do that.
Hope that helps.
Rohit -
Dynamic value objects in flex and coldfusion 9
I'm writing a program for a company that does registrations for conventions and trade-shows. The problem I'm having is that each different client wants to store different data for each show. Most of the data is the same (attendee's name, address, etc...), but each show has some customizations that it wants to have... So each database for each show is going to be different...
Right now, the only way I know how to transfer data from Flex to ColdFusion is via a Value Object. (Well, the only good way to do it, that is.) My problem comes when a client wants a particular database customized. I have MANY questions about this...
1) How do I tell my Value Object what fields we've added to or changed in the database without re-writing the entire VO (in both the .AS and .CFC files) and re-compiling my program? In other words, I need a dynamic VO that changes automatcially with the database.
2) If there is a way to dynamically create a VO in Flex (and from a few blog posts I've seen, it seems there is a way), how do I tell CF9 what the structure of that dynamically-created VO is? Without re-writing a bunch of .CFC files every time I add or change a field in the database, that is...
3) How do I reference the dynamically-created fields in my Flex program? Right now, for example, I can define a variable called attendeeInfo as type attendeeInfoVO, and then reference things like attendeeInfo.first_name, attendeeInfo.last_name, etc... How do I reference a field programmatcially when I don't know what it's going to be called beforehand?
4) How do I make my program display/modify those dynamically-created fields? Right now, using the attendeeInfo example above, I can create a TextInput with an id="firstNameInput" and just say firstNameInput.text = "{attendeeInfo.first_name}". That won't work when I have no clue how many dynamically-created fields there are, or even what kind of data they're going to store... How do I deal with this?
5) Is there something other than VOs that would fit this situation better? Am I limiting myself by using VOs in the first place? Is it just plain impossible to do this with VOs? And if so, what are my alternatives? I need a structured object that can be passed around with a single reference -- I absolutely DO NOT want to pass a bunch of references to a bunch of different variables -- that's why I used VOs from the very beginning.
6) Can I simply PAY someone at Adobe for one-on-one help here? Do they have experts that you can "buy" for a few hours? What's the charge for that, if such a thing is available? Or, is this problem well-explained somewhere on the Web, and I just haven't found it yet?
I'm very confused here, and it seems like I might have to re-write a ton of code, which I'm not looking forward to... Ugh... I appreciate any help you can give me...
Thanks,
Laurence MacNeill
Mableton, Georgia, USAThis blog post is pretty close to what I want:
http://justinjmoses.wordpress.com/2008/10/10/flex-dynamic-bindable-value-objects/
So there are the dynamic value objects I was looking for. But the blog-poster is using LINQ and .Net 3.5. I'm using ColdFusion9.
So, how do I get ColdFusion9 to deal with that? How do you get CF9 to recognize the fact that you've changed the VO, and deal with it appropriately?
Thanks,
L. -
My coldfusion service crashes intermitantly and when I check
the application logs the error that I see for the time frame is the
one below. Does anyone know where I might begain to solve this?
Thanks!
Error Executing Database
Query.coldfusion.sql.DatabaseConnectionException: Timed out trying
to establish connection The specific sequence of files included or
processed is: E:\wwwroot\lifeworks\default.cfmI'm no expert, but thought I would try to be helpful.
I was getting this same error on a regular basis.
The short term fix was to restart the ODBC server service.
The long term fix was twofold:
1. I recreated the ODBC connection in ColdFusion
Administrator to use the system connection (I was using the SA and
PW for login).
2. I created a second user ODBC connection as well as the
system one under ODBC in Windows Server 2003.
I haven't had the problem since.
I also read a pretty good set of "stuff" to try from the help
area:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17277
Hope this helps. -
Substr function not working in coldfusion sql
Hi all,
I am using coldfusion 7.0.2 with oracle 10g. I've the
following simple query
select substr(colname,1,3) from tablename
this query works fine if i run it using TOAD or SQLPLUS but
when i run this query in coldfusion script i get the following
error
[Table (rows 9 columns SUBSTR(colname,1,3)):
[SUBSTR(colname,1,3): coldfusion.sql.QueryColumn@fc7be7] ] is not
indexable by SUBSTR(colname
can anybody tell me why it doesn't work in coldfusion but
works fine in sqlplus?
thank youThere's no such thing as "coldfusion sql" (sic). Everything
between the
<cfquery> tags is simply resolved (ie: CF runtime
statements between
pound-signs) and passed straight to the DB drivers, and
thence to the DB
itself. CF does no SQL processing at all.
Your error kind of suggests a syntac error AFTER the query
has been
executed though.
Could you post some code, and point out which precise line is
erroring?
Adam -
Flex - BlazeDS - Java: int are set to 0 when they should be kept to NULL.
Hi everyone, I'm having an issue with Flex -> BlazeDS -> Java.
When I pass an object to Java through BlazeDS, my variables of type int are automatically set to 0 if they are NULL or NAN. Is there a way to keep them as NULL ?
Thanks everyone.Please refer to --
https://bugs.adobe.com/jira/browse/BLZ-305 -
Hello, friends!
I'm new to both Flex and Java.
I'm trying the most simple tutorials (
http://www.adobe.com/devnet/livecycle/articles/blazeds_gettingstarted.html),
and doing everything according, but I can't put the Flex working
with the BlazeDS.
I post my doubt on BlazeDS forum, but no one has even
answered.
The question is, when I run my MXML application, I can see
through the Firebug that the 404 (not found) error occurs on "
http://localhost:8080/myfirst/messagebroker/amf".
Until now, I don't even know if the problem is on my MXML
app, on my Java classes, on the config xml files or in my server.
Does anyone know where could be the problem? Or could someone
point out a beginners Flex + BlazeDS tutorial?
Thank you,
CaioToOn!http://localhost:8080/myfirst/messagebroker/amf
is the servlet mapping that should be defined in web.xml
make sure tomcat is running, blazeDS is deployed and most
imporantly try accessing
http://localhost:8080/myfirst/messagebroker/amf".
with browser, if blazeDS is deployed you get blank page, if not
than servlet and or/tomcat is not running
based on url :
http://localhost:8080/myfirst/messagebroker/amf".
conclusions are following :
you have webapplication context named "myfirst" deployed
inside webapps directory of tomcat,
(assuming you use tomcat). -
Flex preventing ColdFusion server from logging exceptions!
Hello all,
Whenever I invoke a CFC from Flex, if the CFC throws an
exception, that exception is not logged in the ColdFusion server
logs. I built an html page that invokes the same page, and when the
exception is thrown it is indeed logged on the server.
Why is Flex preventing ColdFusion from logging the
exceptions!?I've never realized that but you can add a cflog tag to your
CFC or debug the error taking a look at the stacktrace withing FB
debugger. -
Help with Flex - PHP - and SQL Server
Good afternoon,
I have been working on this problem for over a week and am at
my wit's end. I am trying to create an application that will allow
me and my fellow statisticians to share code easily. The
technologies at my disposal are Flex, PHP and SQL Server 2005. The
web server is IIS. I have downloaded and installed the PHP driver
for SQL Server 2005 and am able to query the database and generate
XML. The problem I'm having is that I can't return the XML from PHP
to Flex.
If I execute the php code in a web browser and view the
source, it looks like XML. I can then cut and paste the exact same
code into an xml file and read it in from the harddisk and the tree
will populate. Can anyone please help me? I don't have flex builder
so I it's hard for me to use trace and view what is going on.
Thanks in advance,
Eric GravesThanks for the suggestion. I have tried every permutation of
e4x path notation I can think of. You're right, you're not supposed
to need the root level as that's supposed to be returned in the
result. So you should only need to reference first level after the
root. When I do this and launch the .SWF I get a completely empty
tree.
I think the problem lies somewhere in my understanding of
what format Flex needs returned from a HTTPRequest. It's my
understanding that it just needs to be XML. As far as I can tell,
that's what I'm sending it. On the PHP side, does it have to be
cast a special way? Everything I've seen just shows people using
ECHO to output the XML data. -
Coldfusion.sql.DatabaseConnectionException
After two years having database connections running without
any problems, i'm now since three month faced
with the following error intermittently .
"Coldfusion.sql.DatabaseConnectionException"
In total i've got 12 different dadabase connections running,
where 8 of them are receiving opload data from
Oracle in a batch process running in the night.
However there is only ONE database what is generating this
error.
The size of the data base is not that big, it is only 6 MB
at this moment, and i do not expect a big increase
of this base.
How can I get this fixed.
ThanksI'm no expert, but thought I would try to be helpful.
I was getting this same error on a regular basis.
The short term fix was to restart the ODBC server service.
The long term fix was twofold:
1. I recreated the ODBC connection in ColdFusion
Administrator to use the system connection (I was using the SA and
PW for login).
2. I created a second user ODBC connection as well as the
system one under ODBC in Windows Server 2003.
I haven't had the problem since.
I also read a pretty good set of "stuff" to try from the help
area:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17277
Hope this helps. -
BlazeDS - Coldfusion 8 error - Deploy Samples - 404 error - Help
I have BlazeDs running locally Great,
I've run through the BlazeDs - Coldfusion 8 Installation/configuration notes, but I'd getting Failed to send error's
http://cfserver.hull.ac.uk/ds-console/
http://cfserver.hull.ac.uk/samples/index.htm
I carn't see whats wrong with it !
Any help please.Couuld someone give me some suggestions?
Maybe you are looking for
-
Hi friends , i am facing to find the bug in an user exit.ur experiences can help me to fix that easily . Scenario : when we click on save in me21n or me22n , it prompts a dilogue box for reason codes , for each PO created in case of me21n and fo
-
How do you set up more than one Personal domain name to your .Mac account
I have registered 3 domain names changed all the cnames to web.mac.com. Now on the menu to set Personal domain on my .Mac account it only lets you add 0ne Domain name? How do we add more or is there a limit?
-
HI SAP Gurus we are going to apply SAP notes , today do i need any furthur configuration required for that or SPS will already configured, plese help me out thank you in advance
-
How do I get rid of a false paper jam notice on officejet Pro 8500 909A?
I called tech support and viewed paper jam video. Did all the recommended steps however paper jam message continues to be displayed. There is absolutely no paper jam any where. Can someone suggest what else I can try to resolve my problem.
-
Tips for ensuring iOS compatibility?
Are there any tips for ensuring that iWork Pages on the Mac is limited to the functionality and fonts supported by the iOS Pages app?