Welcome Guest Search | Active Topics | Members | Log In | Register

Technical Article: Building a Data-Driven Flex/Java app in < 5 Minutes Options · View
mcoderkat
Posted: Friday, April 08, 2011 7:30:58 AM

Rank: Ultra Midnight Coder
Groups: Member

Joined: 6/15/2008
Posts: 108
Points: 108
Location: Colorado
Need a little help building your first data-driven Flex to Java app? Ken Nelson from San Clemente Technology and member of our WebORB community just had his technical article posted on the Adobe Developer Connection site. This article will help you jump-start your Flex-Java application development. Here is a link to Ken's article:

http://www.adobe.com/devnet/flex/articles/datadriven-flex-java-applications.html
ntyler
Posted: Thursday, April 28, 2011 9:33:29 AM
Rank: Newbie Coder
Groups: Member

Joined: 4/28/2011
Posts: 6
Points: -79
Location: McLean, VA
I posted this in the comments on the article but people here might have a better idea of what the issue is. I followed all the steps in this article and ran into the following issue. Upon initial load of the application, I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at weborb.messaging::WeborbMessagingClient/connect()[/Users/mark/dev/weborb/Java/build/tmp/weborbswc/weborb/messaging/WeborbMessagingClient.as:292]
at weborb.data::DataServiceClient$/subscribe()[/Users/mark/dev/weborb/Java/build/tmp/weborbswc/weborb/data/DataServiceClient.as:120]
at weborb.data::DataMapperProxy()[/Users/mark/dev/weborb/Java/build/tmp/weborbswc/weborb/data/DataMapperProxy.as:29]
at weborb.data::DataMapper()[/Users/mark/dev/weborb/Java/build/tmp/weborbswc/weborb/data/DataMapper.as:284]
at test.w4j.weborb.Codegen::_ContactDataMapper()
at test.w4j.weborb::ContactDataMapper()
at test.w4j.weborb.Codegen::_DataMapperRegistry/get Contact()[C:\Users\nathan.tyler\Adobe Flash Builder 4\W4jArticle\src\test\w4j\weborb\Codegen\_DataMapperRegistry.as:16]
at test.w4j.weborb::ActiveRecords$/get Contact()[C:\Users\nathan.tyler\Adobe Flash Builder 4\W4jArticle\src\test\w4j\weborb\ActiveRecords.as:10]
at W4jArticle/refresh()[C:\Users\nathan.tyler\Adobe Flash Builder 4\W4jArticle\src\W4jArticle.mxml:32]
at W4jArticle/___W4jArticle_Application1_creationComplete()[C:\Users\nathan.tyler\Adobe Flash Builder 4\W4jArticle\src\W4jArticle.mxml:8]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:12528]
at mx.core::UIComponent/set initialized()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1627]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]


After dismissing this, I can click on "Retrieve" and successfully pull in the data. Any thoughts?
ntyler
Posted: Friday, April 29, 2011 11:06:41 AM
Rank: Newbie Coder
Groups: Member

Joined: 4/28/2011
Posts: 6
Points: -79
Location: McLean, VA
Mark Piller posted in the article comments to ensure that

-services "/absolute-path-to-weborb-install-directory/webapp/WEB-INF/flex/weborb-services-config.xml"

is included in the compiler arguments. I noticed flash builder 4 is setting this argument by default to services-config.xml rather than weborb-services-config.xml. Changing this value solved the problem for me. Thanks Mark!
Paul |-|
Posted: Friday, March 30, 2012 10:35:32 PM
Rank: Newbie Coder
Groups: Member

Joined: 3/30/2012
Posts: 2
Points: 6
Location: Vancouver
Hi there,

I know, this topic is kinda old but I still have the same problem and I'm totally surprised that I'm, obviously, the only one.

All comes back to this article http://www.adobe.com/devnet/flex/articles/datadriven-flex-java-applications.html

Yes, I've read the comments and I saw the solution. But I have no file called weborb-services-config.xml, just the services-config.xml which is maybe the same one. But it's not working.

The init of the mapper is failing on the first call. On the second invoke, everything is fine. The function is called by a button click. And If I put the ActiveRecords.News.findAll() directly as dataprovider of a e.g. datagrid, everything works fine.

public function loadData():ArrayCollection
{
var responder:mx.rpc.Responder;
responder = new mx.rpc.Responder( gotData, gotError );
return ActiveRecords.News.findAll( responder );
}

That's my called function and the error is:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at weborb.messaging::WeborbMessagingClient/connect()[/Volumes/HD2/nightly_builds/wojava/build/tmp/weborbswc/weborb/messaging/WeborbMessagingClient.as:292]
at weborb.data::DataServiceClient$/subscribe()[/Volumes/HD2/nightly_builds/wojava/build/tmp/weborbswc/weborb/data/DataServiceClient.as:120]
at weborb.data::DataMapperProxy()[/Volumes/HD2/nightly_builds/wojava/build/tmp/weborbswc/weborb/data/DataMapperProxy.as:29]
at weborb.data::DataMapper()[/Volumes/HD2/nightly_builds/wojava/build/tmp/weborbswc/weborb/data/DataMapper.as:48]
at starchat.Codegen::_NewsDataMapper()
at starchat::NewsDataMapper()
at starchat.Codegen::_DataMapperRegistry/get News()[C:\development\projects\webOrbTest2\src\starchat\Codegen\_DataMapperRegistry.as:74]
at starchat::ActiveRecords$/get News()[C:\development\projects\webOrbTest2\src\starchat\ActiveRecords.as:34]
at webOrbTest2/loadData()[C:\development\projects\webOrbTest2\src\webOrbTest2.mxml:36]
at webOrbTest2/findAllCtl_clickHandler()[C:\development\projects\webOrbTest2\src\webOrbTest2.mxml:51]
at webOrbTest2/___webOrbTest2_Button1_click()[C:\development\projects\webOrbTest2\src\webOrbTest2.mxml:59]


Any solutions or ideas?

Thanks,
Paul
Paul |-|
Posted: Friday, March 30, 2012 10:38:13 PM
Rank: Newbie Coder
Groups: Member

Joined: 3/30/2012
Posts: 2
Points: 6
Location: Vancouver
I forgot:

WebOrb 4.5 for Java
Flex 4.6
Tomcat 7.0.25
java version "1.7.0_02"
Mark Piller
Posted: Thursday, April 05, 2012 12:51:09 PM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
Make sure to reinstall WebORB with the RTMP feature enabled. The file will show up after that.

Regards,
Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.134 seconds.