Thursday, February 14, 2008

Deploy Flex App as a WAR file on Tomcat.

1. Build the Flex app, say "HelloWorld".
2. Create a temp directory.
3. Copy everything out of the Flex HelloWorld bin directory to temp.
4. In temp create a META-INF and WEB-INF directory.
5. In temp type: jar cvf HelloWorld.war *
6. Use the Tomcat Manager web application to deploy the HelloWorld.war file.

Can't upload war files to Tomcat on Windows.

You try to use the Manager to upload a war file. It fails with the following message:


root cause:
"java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

The real root cause is that Tomcat on Windows missing the commons-io jar file the Tomcat manager code needs to work.


Fix:
1. Download commons-io-1.4.jar.
2. Place the file in /common/lib
3. Restart Tomcat.

Note the last step is very important. The Tomcat manager won't be able to use the functionality in commons-io to upload war files until you do this.

Wednesday, February 6, 2008

Google should just buy AOL and Alta-Vista

Instead of whining about Microsoft's bid on Yahoo Google should just up the ante and go after AOL and Alta-Vista.

Vote Early - Not

OK. I learned my lesson. I did the mail-in thing early and my guy dropped out. I'm not doing that again!

Monday, November 19, 2007

InstantRails MySQL Pending...

Click the MySQL button. Kill it. It will automatically restart.

Friday, November 16, 2007

7 Steps To A Ruby On Rails Application

1.Install Ruby and Rails

  • I'm using Ubuntu and did this with the Synaptic package manager.
  • I'm also going to try InstantRails, http://rubyforge.org/frs/?group_id=904


2. Generate the application's framework.

$ cd <work_root>
$ rails MyApp
$ cd MyApp


3. Create a Controller.
$ script/generate controller MyControl
NOTE: With Windows and Instant Rails, preface the script commands with ruby.

4. Edit the Controller. Add an action, some_action
$ gedit app/controllers/my_control_controller.rb

class MyControlController < ApplicationController
def some_action
@time = Time.now
end
end


5. Add the view associated with the action.
$ gedit app/views/my_control/some_action.rhtml

<html>
<head>
<title>Action!</title>
</head>
<body>
<ul>
<li>It is now <%= @time -%>
</ul>
<body>
</html>

6. Start the server.
$ script/server
NOTE: With Windows and Instant Rails, preface the script commands with ruby.

7. View the result in a browser.
http://localhost:3000/my_control/some_action


Note: (From Agile Web Development with Rails by Dave Thomas and David Heinemeier Hansson)

In Ruby, the convention is to have variable names where the letters are all lowercase and words are separated by underscores. Classes and modules are named differently:
there are no underscores, and each word in the phrase (including the first) is
capitalized.

Rails controllers have additional naming conventions. If our application has a store controller, then the following happens.
  • Rails assumes the class is called StoreController and that it’s in a file named store_controller.rb in the app/controllers directory.
  • •It also assumes there’s a helper module named StoreHelper in the file store_helper.rb located in the app/helpers directory.
  • It will look for view templates for this controller in the app/views/store directory.
  • It will by default take the output of these views and wrap them in the layout template contained in the file store.rhtml or store.rxml in the directory app/views/layouts.

Tuesday, November 13, 2007

Ruby on Rails - changing the default IP, server startup

How to get informative error pages:
$ script/server --environment=development

How to get informative error pages and access from a different box:
$ script/server --binding=<your IP goes here> --environment=development

The default, if you start with script/server you get the following:
$ script/server --binding=127.0.0.1 --environment=production