p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional BlazeDS: Creating Rich Internet Applications with Flex and Java
This is the forum to discuss the Wrox book Professional BlazeDS: Creating Rich Internet Applications with Flex and Java by Shashank Tiwari; ISBN: 978-0-470-46489-2

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional BlazeDS: Creating Rich Internet Applications with Flex and Java section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2009, 12:10 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 02 problems getting tutorial to work

Am trying to get the chapter 02 example to work but having problems. Environment is Windows XP using the 60 day free trial version of "Adobe Flex Builder 3", "blazeds-turnkey-3.2.0.3978.zip", and "BlazeDS_book_code_464892complete.zip".
Using that software, the book's tutorial on pages 59 (figures 2.11, 2.12, and 2.13) is useless because nothing matchesl. The book's screenshots of the figures are wildly different than the screens that appear when you (quote) "start up your Flex Builder IDE and create a new Flex project. Choose to create a project with a J2EE server and specify the parameters as shown in Figure 2-11"

Last edited by RobertGloverJr : November 1st, 2009 at 03:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 1st, 2009, 03:13 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default the secret to chapter 02 revealed

I finally figured out that chapter 02 screens shots will match what you see if you first install Eclipse 3.4 (the version for JEE named "eclipse-jee-ganymede-SR2-win32.zip") and then install the Flex3 plug-in (named "FB3_WWEJ_Plugin.exe") on top of that base Eclipse.

The book should have said that that installation of Eclipse 3.4 needs to be manually configured for a Tomcat Server. (The author apparently configured his Eclipse 3.4 to use JBoss AS, which is a little more confusing but it's the same idea).

The book should have stated that the chapter's tutorial cannot be followed if instead the "FB3_win.exe" ("FLEX BUILDER 3 PROFESSIONAL") is used.

Another thing the book should have said is that the BlazeDS turnkey installation ("blazeds-turnkey-3.2.0.3978.zip") is great to try out, but for the purposes of the chapter 02 tutorial you should download "blazeds-bin-3.2.0.3978.zip" and copy the war file it contains (blazeds.war) into the "webapps" directory of that plain Tomcat6 install that you need to manually configure in Eclipse (Or else find that blazeds.war in the turnkey version of BlazeDS and manually copy it to the webapps directory of the plain Tomcat install).

The steps above will result in figures 2-11 and 2-12 matching exactly, the only difference being that the dropdown for "Target runtime" shows "Apache Tomcat v6.0" as an option instead of Jboss, which makes sense now
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old November 1st, 2009, 04:21 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default another chapter 02 problem

Chapter 02 on page 62 says to modify file "remoting-services.xml" to add a "destination" element, but there is no file by the name of "remoting-services.xml" is the chapter's sample project.

The only reasonable alternative is to assume the author meant to say that file "remoting-config.xml" should be updated.

Unfortunately, the book does not say where within the file to make the requested update.

Lacking instructions, I tried adding the entry to the bottom of file "remoting-config.xml" as shown below.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" 
    class="flex.messaging.services.RemotingService">

    <adapters>
        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
    </adapters>

    <default-channels>
        <channel ref="my-amf"/>
    </default-channels>
    
    <destination id="helloService">
       <properties>
           <source>problazeds.ch02.HelloService</source>
       </properties>
    </destination>

</service>
When I then choose to run "HelloBlazeDS.xml" as a Flex Application it comes up okay in a browser (http://localhost:8080/HelloBlazeDS/HelloBlazeDS.html) but when data is typed in and then the button is clicked after entering the test data, the message "Fault Send Failed" appears in an alert box.

Interestingly, if I change the entry in the xml above to a deliberately invalid service name (i.e, id="helloServiceXXXX") and then rebuild, publish, and restart Tomcat the error message changes from "Fault Send Failed" to error message: "Destination 'helloServce' either does not exist or the destination has no channels defined...".

Ironically, the author ends chapter 02 with the observation: "The example is simple and further explanation may be redundant, so I will stop right here"

Last edited by RobertGloverJr : November 1st, 2009 at 05:43 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old November 1st, 2009, 05:17 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 02 - importing war file blazeds.war

I spent 7 hours today trying to get the example in chapter 02 to work, and have to give up at this point and hope Mr. Tiwari will post some suggestions. He writes that he wanted to keep the example in chapter 02 simple. Yet he did not even include a screen print of what the final product looks like when it is actually run. He states that in all future examples he will show how to build it without an IDE. Yet the next example, 50 pages later, is on page 102 and he begins, "As a first step I create a Flex project in Flex Builder". He does not include any instruction whatever for building it without an IDE, and once again he does not include any screen shots of what the finished example looks like.

It is going to be very hard to take the rest of this book seriously until this "easy" first sample program in chapter 02 can somehow be coerced to work.

Calling Mr. Tiwari! Are you there?

Last edited by RobertGloverJr : November 1st, 2009 at 05:53 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old November 1st, 2009, 06:18 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 02 problem - diagnostic information

By altering the book's cryptic error message handler in the chapter 02 example, I have managed to change the text message from the author's to the following. (Before showing the output, I first show the change made to the author's original "handleFault" function.

Does anyone have any idea why this is occurring? If the author can't help us get this first, simple example in chapter 02 to work, I have to really wonder....

Code:
       public function handleFault(event:FaultEvent):void {
            Alert.show(event.fault.faultString + "--" + event.message, "Fault");
        }


Code:
Send failed--(mx.messaging.messages::ErrorMessage)#0
  body = (Object)#1
  clientId = (null)
  correlationId = "227A8FDA-A379-0BAB-ECC2-B1CCEDD23FC9"
  destination = ""
  extendedData = (null)
  faultCode = "Client.Error.MessageSend"
  faultDetail = "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf'"
  faultString = "Send failed"
  headers = (Object)#2
  messageId = "00C5C461-48EE-BF59-72E5-B1CCEE20EDB1"
  rootCause = (mx.messaging.events::ChannelFaultEvent)#3
    bubbles = false
    cancelable = false
    channel = (mx.messaging.channels::AMFChannel)#4
      authenticated = false
      channelSets = (Array)#5
        [0] (mx.messaging::ChannelSet)#6
          authenticated = false
          channelIds = (Array)#7
            [0] "my-amf"
          channels = (Array)#8
            [0] (mx.messaging.channels::AMFChannel)#4
          clustered = false
          connected = false
          currentChannel = (mx.messaging.channels::AMFChannel)#4
          initialDestinationId = (null)
          messageAgents = (Array)#9
            [0] (mx.rpc::AsyncRequest)#10
              authenticated = false
              autoConnect = true
              channelSet = (mx.messaging::ChannelSet)#6
              clientId = (null)
              connected = false
              defaultHeaders = (null)
              destination = "helloService"
              id = "E1F92372-EF17-18C5-FFB7-B1CCE3C0D84A"
              reconnectAttempts = 0
              reconnectInterval = 0
              requestTimeout = -1
              subtopic = ""
      connected = false
      connectTimeout = -1
      enableSmallMessages = true
      endpoint = "http://localhost:8080/WebContent/messagebroker/amf"
      failoverURIs = (Array)#11
      id = "my-amf"
      mpiEnabled = false
      netConnection = (flash.net::NetConnection)#12
        client = (mx.messaging.channels::AMFChannel)#4
        connected = false
        objectEncoding = 3
        proxyType = "none"
        uri = "http://localhost:8080/WebContent/messagebroker/amf"
      piggybackingEnabled = false
      polling = false
      pollingEnabled = true
      pollingInterval = 3000
      protocol = "http"
      reconnecting = false
      recordMessageSizes = false
      recordMessageTimes = false
      requestTimeout = -1
      uri = "http://{server.name}:{server.port}/WebContent/messagebroker/amf"
      url = "http://{server.name}:{server.port}/WebContent/messagebroker/amf"
      useSmallMessages = false
    channelId = "my-amf"
    connected = false
    currentTarget = (mx.messaging.channels::AMFChannel)#4
    eventPhase = 2
    faultCode = "Channel.Connect.Failed"
    faultDetail = "NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf'"
    faultString = "error"
    reconnecting = false
    rejected = false
    rootCause = (Object)#13
      code = "NetConnection.Call.Failed"
      description = "HTTP: Status 404"
      details = "http://localhost:8080/WebContent/messagebroker/amf"
      level = "error"
    target = (mx.messaging.channels::AMFChannel)#4
    type = "channelFault"
  timestamp = 0
  timeToLive = 0
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old November 1st, 2009, 07:42 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to fix the author's final mistake chapter 02

Here is the final piece of the picture. The example in chapter 02 is doomed to always fail because the author neglected to explain that the "channel-definition id='my-amf'" part of file services-config.xml needs to be changed in the way I show below.

Code:
   <channels>

        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8080/HelloBlazeDS/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>2
... snip ...

   </channels>
With this last fix, example 02 works okay. Below I show how that portion of the xml looks without the fix shown above. You can see at once it could never possibly work:

Code:
 
 <channels>
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
... snip ...
 </channels>
How could the author have omitted such a crucial instruction? Perhaps Mr. Tiwari will explain himself here in the forum.

Below I show the message that displays in example 02 after I type the word "HELLO!!!" into the text box and then click the button. Notice how the author was in such a hurry that he did not even bother to polish the source code of his example to put a space before the response message.

Code:
Hello from JavaReceived your message:HELLO!!!

Last edited by RobertGloverJr : November 1st, 2009 at 07:59 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old November 9th, 2009, 02:22 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 02 Examples and Explanation

Dear Robert,
First my apologies for not noticing the set of questions from you earlier than this morning. Second, I am sorry the chapter 02 example caused so much trouble.

I made a few assumptions about the readers, which I understand from your comments was perhaps not appropriate. I will be happy to reword the text in the next version of the book, but for now, I will be try and post a fully annotated code download and will be very happy to address the questions as they arise.

Thanks for your patience and please feel free to ask any more questions that you may have here on the forum, on my blog -- www.shanky.org, or on email -- whatever works better for you.

Thanks, Shashank
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old November 10th, 2009, 01:00 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Oct 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another possible problem and fix

Hello RobertGloverJr,

I also had a hell of a time with getting, what should be a simple, example program up and running. For me, the problem turned out to be an incorrect value for the "serverContextRoot" attribute in the project .flexproperties file. I'm using Flex 3.4 sdk in Eclipse and when I created a new project, it set "WebContent" as the value:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flexProperties flexServerType="8" flexWarLocation="E:/Downloads/Adobe/BlazeDS/blazeds-bin-3.2.0.3978/blazeds.war" serverContextRoot="/WebContent" serverRoot="E:/Eclipse_Workspace/HelloBlazeDS/WebContent" serverRootURL="http://localhost:8080/HelloBlazeDS" toolCompile="true" useServerFlexSDK="false" version="1"/>
Once I made the change to:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flexProperties flexServerType="8" flexWarLocation="E:/Downloads/Adobe/BlazeDS/blazeds-bin-3.2.0.3978/blazeds.war" serverContextRoot="/HelloBlazeDS" serverRoot="E:/Eclipse_Workspace/HelloBlazeDS/WebContent" serverRootURL="http://localhost:8080/HelloBlazeDS" toolCompile="true" useServerFlexSDK="false" version="1"/>
I was able to make the correct remoting calls to BlazeDS.

I come from a Flex background and I'm new to the whole BlazeDS/Java world. That being said, I hope this helps future BlazeDS learners out there.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #9 (permalink)  
Old November 12th, 2009, 01:05 PM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 02 annotated code

Quote:
Originally Posted by Shashank Tiwari View Post
Dear Robert,
I made a few assumptions about the readers, which I understand from your comments was perhaps not appropriate. I will be happy to reword the text in the next version of the book, but for now, I will be try and post a fully annotated code download and will be very happy to address the questions as they arise.
Thanks, Shashank
Shashank, I would appreciate it if when you issue an annotated code download, you add support in the example for that "pojo" you included in the sample but never actually used in the sample.

I.e., I wish you could change the sample FLEX app to have two buttons: one button to exercise the passing back and forth of a String (which is all the current example does), and a second button to exercise the passing of information through that "pojo" you included in the sample code but never actually used in the sample.

Ultimately, what I would really like you to provide is an example of using a "pojo" to pass data back and forth from client to server that has properties that are representative of the most common data types that a professional programmer would need to use in a simple (but professional) application.

The only data type used in any of the properties of the "pojo" in the example in chapter 04 are of type "Double". I would really appreciate a code example that uses a "pojo" whose properties are of other types, for example "Map", "List", "Set", "Array", and a property that is itself a "pojo".

I realize you write at length about this in your book at a very advanced level, but really I think I speak for many of your readers in saying it would be very helpful to have actual code examples of using these types of pojo's that could actually be run in a sample application.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #10 (permalink)  
Old November 12th, 2009, 03:11 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 02 annotated code

RobertGloverJr,
Thanks for your comments and suggestion. I will surely work on putting together a good annotated example that illustrates many of the different data types in a POJO. I will work on this next week (post Tuesday) as am extremely busy this week and then caught up with Flex (Flash) Camp Wall Street -- http://www.flexcampwallstreet.com -- next week Monday and Tuesday. Thanks for patience and feedback.

Thanks, Shashank
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 Ctrl+F5 don't work, F5 does work? jimboak BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 June 29th, 2008 04:46 AM
Example code for Chapter 8 doesn't work! urlsing BOOK: ASP.NET 2.0 MVP Hacks and Tips 0 March 5th, 2008 01:49 PM
02 IN 01 Desktop App (App+Wind Handler) pk_ocp .NET Framework 2.0 0 February 26th, 2008 02:58 PM
a example of chapter doesn't work. mizimizi Classic ASP XML 2 October 19th, 2003 02:27 PM
Beginner - Access '02 Autonumber sequencing logic? Mita Access 10 September 25th, 2003 04:46 PM



All times are GMT -4. The time now is 06:36 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc