Phil 1.26.2011

8:30 – 4:30 VISIBILITY

  • First big(ish) snow of the year
  • Meeting with Matt and Anne still appears to me on for this afternoon – nope canceled. Maybe Friday.
  • Working on debugging remote objects
  • Got it all working. Here’s how you do it:
    1. You will need a workingversion of Tomcat. But it needs to be stopped. We’re going to be running it from within Eclipse
    2. Download and install the Eclipse Web Tools Package. You don’t need the SDK version. The update site for helios is here:
    3. Open the Window->Show View->Other… then inside the view three find Sever->Servers view
    4. Inside the Servers view, create a new Server. You should be able to select the Tomcat version that you want. You will also need to point it at the version of Tomcat you have installed.
    5. Right-click on your Server and select Open to bring up the “Overview” configuration screen as a tab in your editor. Under Server Locations, select the “Use Tomcat Installation (takes control of Tomcat installation)
    6. Create a new project of type Web->Dynamic Web Project. I named mine RemoteObjectTestbed
    7. Set the properties->Java Build Path source tab to have the Default output folder to XXX/WEB-INF/classes, where XXX is the name of the directory you’re deploying to. Note that you have to type this in, you CAN”T point and click.
    8. Add the project to the server by right-clicking on the server in the server view. That brings up a dialog that allows you to select web projects and move them over to the server.
    9. Since I was debugging a project that I had already started using MavenAssist, I copied over a bunch of stuff. These files get placed in the WebContent folder. THis is the folder that you pointed to in step 7. :
      • The files that get deployed are under the Program Files folder in your web project.
        • Add a lib folder and fill it with all the jars you need to run flex (take from a working version)
        • Add a flex folder and put the flex xml files from a working project
        • Under web inf, copy a web.xml file
      • If you’ve copied everything over correctly, you should be able to start the server by right clicking on the Server in the Servers view and selecting “Start” or “Debug”. If you navigate to http://localhost/XXX/messagebroker/amf you should get a nice blank screen, not a 404 or some other crappy result. If everything works, turn off the server before continuing.
      • Create package(s) under the “Java Resources:src” folder for your code. These packages will need to be the same as what’s in the remoting-config.xml file. These are your remote objects.
      • To debug the remote object, place your breakpoints and start the server in debug mode. Starting the server appears to reload the entire project so if you have a Flex project dropping its output in the XXX folder, you’ll have to rebuild.
    10. At this point you should be able to debug both side of the application.
  • OK, back to actually making things.
  • The data is coming over the wire as an ASObject. Inside it is a hashmap. All types work correctly except for the uint, which comes over as an int. Based on this info, I’m going to add a String to the base class that defines the table name. Then the object contains everything it needs to create a table in its hashmap. No creation of XML is required.
  • Spent a while wondering why some items weren’t appearing in the variables view of the java hashmap. Wound up creating a Set and looking at the variables there. They all show up, so I guess I’m just blind…