Miles to go …

November 28, 2007

Metro, jMaki & JRuby/GlassFish Q&A from a Preso – Toronto & Montreal

Filed under: webservices — arungupta @ 4:02 am

I presented on Metro, jMaki and JRuby-on-GlassFish at a partner meeting on Nov 21 in Toronto and Montreal (yeah, both cities in the same day). That makes it 3 cities (the first one being Seattle) total for now!

I’ve given multiple talks all over the world to different types of audience but this was my first experience in terms of talking for 3 hours in the morning, flying to another city and then repeating the sessions. GlassFish (both v2 and v3), NetBeans IDE and Windows Vista behaved properly through all the demos. And my talks are typically demo intensive so it was fun! I enjoyed the overall experience (talking, demos, flying) :)

As always, the fun part was interaction with the audience and I always learn something new every time. And, in order to share the knowledge with you, here is the consolidated list of questions from both the cities:

  1. How much Ajax/jMaki support is available in Portal ?

    The Portal Pack plugin for NetBeans can support JMaki 1.0 for building JSR 168 or JSR 286 portlets that use jMaki widgets. There is no other explicit support on the Portal server for JMaki.

    The portlets using jMaki widgets can be deployed on the Sun Portal Server and they should work without any issues. The only catch is that a slight configuration is required to get these portlets to work with the Portal’s Ajax container. This is to work around the cross-domain Ajax restrictions of the browser.

  2. What is the frequency of adding wrappers of newer version of toolkits, specifically Dojo toolkit ? Can I add/create the wrappers myself ?

    Frequency depends on the toolkits. Dojo revs about every 6 months with the first major rev just last month. Anyone can create and add wrappers to the palette in NetBeans as explained here. Adding to Eclipse is on a per-web app basis and it will be enabled on palette-basis in the near future.

  3. What level of browser support is available for jMaki, especially for the ones that are not mainstream ?

    Here is the list of supported browsers from jMaki’s website:

    • IE 6 and 7 on Windows XP and Vista
    • Firefox 1.5 and 2.x on Solaris, Linux, Windows XP/Vista
    • Safari 2.x and Firefox 1.5 on Mac OS
    Unofficially jMaki runs on:
    • iPhone
    • Opera 9.2+
    • Opera Mobile
    • Older versions of Netscape

    Although the jmaki framework will work on these browsers some widgets may not work (such as those that use SVG) depending on the browser.

  4. When will a .NET version of jMaki be available ?

    If the demand is great we will be more than happy to work to make a version available. The greater the demand the sooner we could do this. If there is interest in the developer community on starting work on a .NET version we could accelerate this process. Please file an RFE if you are interested.

  5. Can the jMaki widgets be rendered to Flash ?

    Absolutely. We previously used some Flash Yahoo Maps and we use Flash for Sound. We are looking at having more media based widgets and it’s only a matter of hours in the day that are slowing us down.

  6. Does jMaki work with Ajax4J and DWR ?
     
    jMaki works fine with DWR find a sample app here:
      https://ajax.dev.java.net/servlets/ProjectDocumentList?folderID=6977&expandFolder=6977&folderID=0

    As for Ajax4JSF (Ajax4J seems to not be active) we should work fine as jMaki widgets can be exposed as fully qualified JSF 1.1 or dynamic faces components. We also work with Facelets (see the jMaki samples for more).

And now for the Metro session:

  1. Is there any tooling for adding Security, Reliability and Transactions for Contract-First development ?

    Yes, this is explained here.

  2. Can the apps using JDK 1.4 as the deployment environment use any of the Metro capabilities ?

    Yes and No :)No because Metro programming model uses annotations heavily and that feature is available in Java SE 5 onwards. Yes because once the production environment is upgraded to Java SE 5 (it should work because of backwards compatibility, always good to check though ;)then you can develop your applications using the JDK 1.4 and deploy them on the upgraded production environment.
  3. How the Web service messages generated by Metro be logged ?

    The different options to log Web service messages in Metro are explained here.
     

And finally for the JRuby-on-GlassFish session:

  1. Other than simplicity and productivity, why should I use JRuby or Ruby at all ?

    Rails is the main reason for Ruby to gain popularity. And JRuby provides the simplicity of Ruby along with power of Java libraries.

  2. Can the number of JRuby instances created by GlassFish be configured ?

    Yes, it can be configured as defined here.

  3. With JRuby 1.0.2, there are significant performance differences between Ruby, Java and JRuby. What is being done to address that ?

    The recent releases of JRuby are much more better performing so it’s recommended to use a more recent release. And with some JRuby Performance Tweaks the performance is at par with C Ruby (MRI). Also see JRuby on Rails Fast Enough for performance benchmark results.

 

Feel free to ask any other questions in Metro Forum and jMaki Forum or GlassFish forum or JRuby user list.

Technorati: conf webservices metro jmaki glassfish jrubyonglassfish ruby jruby netbeans web2.0 q&a

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 27, 2007

FOSS.IN schedules now available – Almost 1600 registrants

Filed under: webservices — arungupta @ 12:02 am

FOSS.IN schedules are finally published, phew!

The conference is starting next Monday and this is living on the edge! This is the 7th year of the conference and I hope the scheduling is done little more in advance next year. This will allows us non-Bangaloreans to plan our activities around FOSS :)

I’ll be giving "Packaging Java Applications for Ubuntu Platform" on Dec 4th, 4pm in A/120. See you there!

I’ll publish the slides here after the talk.

Here are some other talks that I’d like to attend:

Date Topic Time
12/6, Thu FOSS.IN inaguration 10:00am-10:30am
12/6, Thu User to Hacker in 90 minutes: The Tools and Techniques needed to actually contribute to Open Source 3:30pm-5:00pm
12/7, Fri The Virtuous Cycle: Sun’s FOSS philosophy and strategy 11:30am-1:00pm
12/7, Fri Hacking the Fox 3:30pm-5:00pm

I’d like to attend some talks on 12/8 but have to catch a flight in the afternoon. But otherwise the momentum is building pretty strong with almost 1600 registrants.

And then of course, you can find me around the GlassFish booth in the Expo.

Some more rant …

  1. There is no conference planner on the website. You already saw my workaround above :)
  2. Why a Certificate is required for viewing individual session details ? Here is the certificate warning presented by Firefox:

    At least get the certificate by a Trusted Authority :(

Technorati: conf glassfish foss.in sun netbeans ubuntu

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 26, 2007

TOTD #19: How to Add Metro Quality-of-Service to Contract-First Endpoint ?

Filed under: webservices — arungupta @ 5:20 am

This TOTD explains how to add Reliability and Security to a Contract-First Endpoint using NetBeans IDE.

In the Contract-First, the contract, i.e. the WSDL, is defined first as opposed to starting from Java. The Metro programming model starts with a Java Service Endpoint Interface (SEI) and uses Web Service Designer to specify Security, Reliability and Transactions support. This blog uses the WSDL bundled with the fromwsdl sample of Metro download and adds Quality-of-Service attributes to it.

Here are the steps to enable Reliable Messaging to Contract-First endpoint:

  1. In a new Web project, right-click and select "Web Service from WSDL..." as shown below:

  2. Specify the Web Service Name, package name and chose the location of the WSDL as shown below:

    The Web Service port name is chosen for you. Alternatively, you can click on "Browse..." button next to "Web Service Port:" and select the appropriate port.

  3. Click on "Finish" and the Web Services Designer is shown as shown below:

  4. Right-click on the Project and select on "Undeploy and Deploy" to deploy the project.
  5. Expand the "Web Services" tree, select the newly added Web service and right-click on "Test Web Service". The Tester page is shown in a browser with links to the packaged WSDL file and text boxes and buttons to invoke the Web service.
  6. In the Web Services Designer, select "Reliable Message Delivery".
  7. Right-click on the project, select "Clean" to clean all the generated files. Again right-click on the project and then select "Undeploy and Deploy" to deploy the project again.
  8. As in step 5 above, test the Web service. The packaged WSDL now contains the appropriate policy assertions and Reliable Message Delivery is enabled on the endpoint.

As described in screencast #ws7, Security can be added to a Contract-First endpoint using the steps listed above.

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd glassfish webservices netbeans metro wsdl reliability contractfirst

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 21, 2007

GlassFish @ FOSS.IN 2007

Filed under: webservices — arungupta @ 12:02 am

I’ll be attending FOSS.IN, Dec 4-8 in Silicon Valley of India (more popularly known as Bangalore). This is going to be my first formal conference in India so I am excited! Find me and talk anything about GlassFish.

Sun Microsystems has held open systems to be the cornerstone of its business philosophy since the beginning. Today, through shared technology innovation, Sun’s continued commitment to Open Source is reflected in its leadership and key contributions to the many projects including GlassFish, OpenSolaris, OpenOffice.org, GNOME, Grid Engine, java.net, NetBeans, and Mozilla. And here as well, Sun is a Principal Sponsor of the event.

Here are some important links:

  • When ? Dec 4-8, 2007
  • Where ? National Science Symposium Center, Indian Institute of Science, Bangalore
  • Schedule – At this this this is a list of all the events happening with NO date/time/location assigned to them. It seems slightly late knowing that the conference is less than 3 weeks ago. And of course there is no individualized page where I can pick/choose the sessions of my interest.
  • Register here – The registration process is slightly confusing by introducing different kinds of delegates and the way payment is made. It is primitive too because you register on the Web and then pay at the event (no Credit Card payments). The rules are stern, for example no reissuing of conference badge.
  • Know more – Join the Mailing List. The traffic is becoming high as the date is approaching.
  • Live stats of registered attendees is a good. More than 1000 delegates have registered so far with a significant chunk from outside Bangalore (like me :).
  • FOSS.IN is still Looking for Volunteers, help them out!

Where can you find Sun ?

  • Talks
    • "The OpenSolaris Project: Getting Involved" by Jim Grisanzio
    • "PostgreSQL 8.3: a Story of Hundreds of Patches" by Josh Berkus
    • "The Virtuous Cycle: Sun’s FOSS Philosophy and Strategy" by Simon Phipps
    • "OpenJDK and Mobile & Embedded: The First Year" by Roger Brinkley
    • "Packaging Java Applications for Ubuntu Platform" by Harpreet Singh
  • Project Days
    • Open Solaris
    • OpenOffice
  • Sun Booths
  • In the hallways
  • Elsewhere in the conference

Where can you find me ?

  • Around GlassFish Booth in the Expo
  • Likely giving 1 or more BoF
  • Likely giving 1 or more Lightning Talk
  • Taking pictures

What can you do before the event ?

  • Download GlassFish
  • Try one or more screencasts to get a feel
  • Where can you hear the latest and greatest about GlassFish – Of course, TheAquarium. So use your favorite RSS reader and subscribe to it.
  • Find and talk to me about GlassFish, I’d love to hear your feedback.
  • And you can monitor other Sun FOSS.IN bloggers.

And of course, I’m looking forward to feast on Sambar/Dosa – one of the finest dishes in the whole world :)

I’ll be there, will you ? Stay tuned for pictures from the event!

Technorati: conf glassfish foss.in sun netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 20, 2007

Metro and jMaki Q&A from a Preso

Filed under: webservices — arungupta @ 12:02 am

I presented on Metro and jMaki in a invitation-only gathering on Nov 15. The audience in both the sessions was pretty interactive. Even though the sessions were invitation-only, I’m posting some of the questions asked during the sessions along with their answers.

  1. How to build support for jMaki in other languages such as Perl ?

    The best option is to check out jMaki workspace and look at Jmaki.php and XmlHttpProxy.php.

    The basics are relatively easy but not always obvious. There is no runtime spec so it’s hard to get all the little details right: Theming, API keys, and the Proxy behavior are pretty specific. Please feel free to ask a question on jMaki Forums. It would be helpful if you can help us create such a document while adding support for Perl.

  2. Is it possible to point a DataTable widget to a Database table, introspect the database table and auto-generate the rows/columns ?

    Java Persistence API (in Java) and ActiveRecord (in Rails) already serve this purpose. There are detailed instructions for jMaki/JPA and jMaki/ActiveRecord. At this time there are no plans to tie closely to the database. Please file an RFE if you like this feature.

  3. Do we have any comparisons between jMaki and Open Laszlo ?
     
    We need to understand Open Laszlo better to prepare a comparison. At this time no comparison is available.
  4. How are topics implemented ? What is the data structure that implements them ?
     
    The topic name is a String / Regular expression Object. The topic names can also include wildcards (start, include, end with a *). The payload must be an object (strings are objects). https://ajax.dev.java.net/publishsubscribe.html provides some more details.
  5. Do we have any performance data on large data sets – e.g. 15,000 rows in a Data Table widget ?

    Carla has a good sample that explains how pagination can be achieved for large data sets. The real question is "how much can you realistically cache on the client?". There are lots of algorithms and that can be more application logic. If you are going to deal with sets like this then the Dojo Grid is supposed to be good as it handles client-side caching and paging. We’ll be adding it as a widget for the dojo 1.0 push.

  6. Are there any widgets that support streaming video ?

    Not yet but it would be very easy to wrap a widget like that. For example, please look at Sound extension that is available as wrapper over Flash.

  7. How to prevent scripting attack on jMaki-wrapped widgets ?

    jMaki wrappers are very trivial. The data from an external domain is not processed in any manner and instead passed on to the underlying toolkits. We make sure the wrappers are well tested and rely on the underlying toolkits to test their widgets.

And now for the Metro session:

  1. How more recent Metro jars be installed on GlassFish ?

    A stand-alone build of Metro can be downloaded from metro.dev.java.net. This build comes with wsit-on-glassfish.xml script and can be used to override the jars in an existing GlassFish v2 installation.

  2. Why Reliable Messaging is required if TCP/IP already provides reliability ?

    TCP/IP provides reliability at the network level. The Reliable Messaging support in Metro implements a transport-independent messaging protocol (defined by the WS-Reliable Messaging spec) with a SOAP Binding. This allows the SOAP message to be used in alternate transports such as JMS or SMTP. It also enables Reliability between a Client and Endpoint with multiple intermediaries in-between which is not possible with TCP/IP.

  3. Is the "Test Web service" feature available outside NetBeans ?

    The "Test Web service" feature in NetBeans makes use of Tester application in GlassFish. It is a web application that dynamically generates the JSP pages by introspecting the WSDL. Currently it only works only for methods that have primitive types in the signature.

  4. What would it take to run Metro on Embedded Jetty ?

    Servlet-based endpoints can be easily deployed on Jetty as explained here. The different variants of Endpoint.publish() currently runs only on Light-weight HTTP server bundled along with Java SE 6. An RFE has already been filed for this functionality and it will be fixed in a future release of Metro.

  5. Does Metro Security integrate with Active Directory ?

    Even though Metro Security cannot be directly integrated with ActiveDirectory, Authentication can be plugged through the integration of Metro with OpenSSO.

  6. What specific performance improvements have we made in Metro ?

    Here are some of the key performance improvements:

    • Revisited some of the key abstractions. The physical data representation was hidden from the user and yet backed by different implementations such as InputStream, JAXB objects, DOM node, Source, etc.
    • Faster, type-safe read access to commonly used properties such as Target Endpoint Address and SOAPAction. Also lazy reading.
    • Headers are made randomly accessible.
    • Filtering of data was enabled by creating an additional wrapper instead and delaying the actual filtering
    • Mostly JAXB is used to write the JAX-WS payload. There were numerous improvements made in JAXB such as:
      • Collapsing the layers and write directly to OutputStream instead of using StAX.
      • Pre-encode tag names to UTF-8
      • Numbers are converted straight to byte stream
      • Namespace prefixes encoded just once and reused
      • Lazy reading and writing of attachments (for example image is encoded in to JPEG byte stream)

    Metro team also presented a BoF 2526 on these improvements at JavaOne 2006.

  7. How much traffic is bloated because of enabling Reliability or Security ?

    There is a definite bloating of messages that happen when either Reliability or Security or Transactions are enabled. I’ll provide the exact numbers in a later blog but all the messages are clearly defined by the existing specifica
    tions.

Feel free to ask any other questions in Metro Forum and jMaki Forum.

Technorati: conf webservices jmaki glassfish netbeans web2.0 q&a

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 19, 2007

TOTD #18: How to Build The GlassFish v3 Gem for JRuby ?

Filed under: General — arungupta @ 12:02 am

Jerome posted the instructions to build GlassFish v3 Gem for JRuby – very simple and easy. A binary version of Gem is available here.

  1. Software pre-requisite
    1. Subversion client (for example Tigris)
    2. Maven 2.0.x
    3. JRuby 1.0.x (I used JRuby 1.0.2 and lets say installed in JRUBY_HOME).  Make sure JRUBY_HOME/bin is in your path.
  2. Build the Gem
    1. As explained in Jerome’s entry, you can check out complete GlassFish v3 workspace or just the Gem code. Here is how you’ll check out only the Gem code on a Windows machine using Tigris Subversion client:

      And after the check out is complete, you’ll see:

    2. Build the gem by giving the command:

      mvn install

      And success is achieved by seeing the following in the console:

      [INFO] (in C:/workspaces/glassfish/gem/target/dependency/glassfish)
      [WARNING] mkdir -p pkg
      [INFO] Successfully built RubyGem
      [INFO] Name: GlassFish
      [WARNING] mv GlassFish-10.0.0-java.gem pkg/GlassFish-10.0.0-java.gem
      [INFO] Version: 10.0.0
      [INFO] File: GlassFish-10.0.0-java.gem
      [INFO] [install:install]
      [INFO] Installing C:\workspaces\glassfish\gem\target\gem-10.0-SNAPSHOT.jar to C:\Users\Arun Gupta\.m2\repository\org\glassfish\distributions\gem\10.0-SNAPSHOT\gem-10.0-SNAPSHOT.jar
      [INFO] [install:install-file {execution: install-gem}]
      [INFO] Installing C:\workspaces\glassfish\gem\target\dependency\glassfish\pkg\GlassFish-10.0.0-java.gem to C:\Users\Arun Gupta\.m2\repository\org\glassfish\distributions\GlassFish-Gem\10.0-SNAPSHOT\GlassFish-Gem-10.0-SNAPSHOT.gem
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 2 minutes 2 seconds
      [INFO] Finished at: Fri Nov 16 17:56:12 PST 2007
      [INFO] Final Memory: 11M/20M
      [INFO] ------------------------------------------------------------------------

      The Gem is available in target\dependency\glassfish\pkg directory.

  3. Install the Gem
    1. Change to the directory where the Gem is available

      cd target\dependency\glassfish\pkg

    2. Install the Gem as:

      C:\testbed\ruby\jruby-1.0.2\bin\jruby -S gem install GlassFish-10.0.0-java.gem
      Successfully installed GlassFish, version 10.0.0

And use it!

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd v3 jruby ruby rubyonrails glassfish gem jrubyonglassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 18, 2007

Dilbert: Career in Engineering

Filed under: General — arungupta @ 8:43 am

Technorati: dilbert engineering

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 15, 2007

Mephisto with GlassFish v3 Gem

Filed under: web2.0 — arungupta @ 12:02 am

In an Earlier Post, I described how Mephisto (a popular web publishing system based on Ruby on Rails) can be deployed on GlassFish V3. Both JRuby and GlassFish has matured since then and this post will provide the updated instructions to deploy Mephisto using GlassFish v3 Gem.

Here are the exact steps:

  1. Install and Configure JRuby 1.0.2. The GlassFish v3 Gem does not work on Windows (JRUBY-1549) with JRuby 1.0.2 and you need to use the JRuby trunk workaround.
    1. Download and Unzip JRuby1.0.2 (lets say JRUBY_HOME).
    2. Include ‘JRUBY_HOME/bin‘ in your environment PATH.
    3. Install Rails (with all dependencies) in JRuby installation by giving the command:

      C:\workspaces\jruby-trunk>bin\jruby -S gem install rails --include-dependencies --no-ri --no-rdoc
      Bulk updating Gem source index for: http://gems.rubyforge.org
      Successfully installed rails-1.2.5
      Successfully installed activesupport-1.4.4
      Successfully installed activerecord-1.15.5
      Successfully installed actionpack-1.13.5
      Successfully installed actionmailer-1.3.5
      Successfully installed actionwebservice-1.2.5

    4. Install ActiveRecord-JDBC as shown below:

      C:\workspaces\jruby-trunk>bin\jruby -S gem install activerecord-jdbc -y --no-rdoc --no-ri
      Need to update 1 gems from http://gems.rubyforge.org
      .
      complete
      Successfully installed ActiveRecord-JDBC-0.5

  2. Download and Install GlassFish V3 Gem.
  3. Install and Configure Database
    1. Download and install MySQL Community Server 5.0 (lets say MYSQL_HOME).
    2. Start MySQL database by giving the command ‘mysqld-nt --user root --console‘ in MYSQL_HOME/bin directory on Windows or ‘./bin/mysqld_safe‘ from MYSQL_HOME directory on Unix flavors.
    3. In a different shell window, create a database and grant privileges by giving the following commands:
       
      C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqladmin --u root create mephisto_development

      C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 2
      Server version: 5.0.45-community-nt MySQL Community Edition (GPL)

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql> grant all on mephisto_development.* to arun@localhost identified by 'noway';
      Query OK, 0 rows affected (0.00 sec)

      mysql> flush privileges;
      Query OK, 0 rows affected (0.00 sec)

      mysql> quit;
      Bye

  4. Install and Configure Mephisto
    1. Download and Unzip Mephisto 0.7.3.
    2. Install Mephisto as described here. The two steps are summarized below for convenience:
      1. Copy ‘MEPHISTO_HOME/config/database.example.yml‘ to ‘MEPHISTO_HOME/config/database.yml‘. There is no need to specify the JDBC adapter ActiveRecord 0.5 onwards and that allows to use the default database configuration file.
      2. Bootstrap the development database using the command:

        C:\testbed\mephisto-0.7.3>jruby -S rake db:bootstrap -J-DRAILS_ENV=development

        and that shows the following output in the console:

        (in C:/testbed/mephisto-0.7.3)
        mkdir -p C:/testbed/mephisto-0.7.3/config/../log
        -- create_table("assets", {:force=>true})
        -> 0.3330s
        -- create_table("assigned_sections", {:force=>true})
        -> 0.2000s
        -- create_table("cached_pages", {:force=>true})
        -> 0.2980s
        -- create_table("content_versions", {:force=>true})
        -> 0.2130s
        -- create_table("contents", {:force=>true})
        -> 0.2190s
        -- create_table("events", {:force=>true})
        -> 0.2680s
        -- create_table("memberships", {:force=>true})
        -> 0.1890s
        -- create_table("sections", {:force=>true})
        -> 0.1500s
        -- create_table("sessions", {:force=>true})
        -> 0.1200s
        -- add_index("sessions", ["session_id"], {:name=>"sessions_session_id_index"})
        -> 0.3220s
        -- create_table("sites", {:force=>true})
        -> 1.1240s
        -- add_index("sites", ["host"], {:name=>"index_sites_on_host"})
        -> 0.3490s
        -- create_table("taggings", {:force=>true})
        -> 0.1950s
        -- create_table("tags", {:force=>true})
        -> 0.1840s
        -- create_table("users", {:force=>true})
        -> 0.2750s
        -- initialize_schema_information()
        -> 0.2740s
        -- columns("schema_info")
        -> 0.0170s
        copied default theme to C:/testbed/mephisto-0.7.3/config/../themes/site-1...

        ================================================================================

        Thank you for trying out Mephisto 0.7.3: Noh-Varr Edition!

        Now you can start the application with script/server, visit
        http://mydomain.com/admin, and log in with admin / test.

        For help, visit the following:
        Official Mephisto Site - http://mephistoblog.com
        The Mephisto Community Wiki - http://mephisto.stikipad.com/
        The Mephisto Google Group - http://groups.google.com/group/MephistoBlog

  5. Deploy Mephisto on GlassFish v3 Gem as shown below:

    C:\testbed>\workspaces\jruby-trunk\bin\jruby -S glassfish_rails mephisto-0.7.3

    And that shows the following output in the console:

    Nov 14, 2007 6:37:51 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter postConstruct
    INFO: Listening on port 8080
    Nov 14, 2007 6:37:51 PM com.sun.enterprise.v3.services.impl.DeploymentService postConstruct
    INFO: Supported containers : php,phobos,jruby,web
    Nov 14, 2007 6:37:52 PM com.sun.grizzly.standalone.StaticResourcesAdapter <init>
    INFO: New Servicing page from: C:\testbed\mephisto-0.7.3\public
    Nov 14, 2007 6:38:00 PM com.sun.enterprise.v3.server.AppServerStartup run
    INFO: Glassfish v3 started in 9054 ms

  6. Mephisto is now deployed at http://localhost:8080/mephisto-0.7.3

    and shows the following output in GlassFish console:

    Nov 14, 2007 6:24:08 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO:

    Processing MephistoController#dispatch (for 127.0.0.1 at 2007-11-14 18:24:08) [GET]

    Nov 14, 2007 6:24:08 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: Parameters: {"action"=>"dispatch", "controller"=>"mephisto", "path"=>[]}

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;36;1mSQL (0.001000)←[0m ←[0;1mSET SQL_AUTO_IS_NULL=0←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;35;1mSite Columns (0.046000)←[0m ←[0mSHOW FIELDS FROM sites←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;36;1mSite Load (0.010000)←[0m ←[0;1mSELECT * FROM sites WHERE (sites.`host` = 'localhost') LIMIT 1←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;35;1mSite Load (0.017000)←[0m ←[0mSELECT * FROM sites ORDER BY id LIMIT 1←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;36;1mSection Columns (0.010000)←[0m ←[0;1mSHOW FIELDS FROM sections←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;35;1mSection Load (0.005000)←[0m ←[0mSELECT * FROM sections WHERE (sections.site_id =1) AND (sections.`path` = '') LIMIT 1←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;36;1mArticle Columns (0.024000)←[0m ←[0;1mSHOW FIELDS FROM contents←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;35;1mUser Columns (0.013000)←[0m ←[0mSHOW FIELDS FROM users←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;36;1mArticle Load Including Associations (0.027000)←[0m ←[0;1mSELECT contents.`id` AS t0_r0, contents.`article_id` AS t0_r1, contents.`user_id` AS t0_r2, contents.`title` AS t0_r3, contents.`permalink` AS t0_r4, contents.`excerpt` AS t0_r5, contents.`body` AS t0_r6, contents.`excerpt_html` AS t0_r7, contents.`body_html` AS t0_r8, contents.`created_at` AS t0_r9, contents.`updated_at` AS t0_r10, contents.`published_at` AS t0_r11, contents.`type` AS t0_r12, contents.`author` AS t0_r13, contents.`author_url` AS t0_r14, contents.`author_email` AS t0_r15, contents.`author_ip` AS t0_r16, contents.`comments_count` AS t0_r17, contents.`updater_id` AS t0_r18, contents.`version` AS t0_r19, contents.`site_id` AS t0_r20, contents.`approved` AS t0_r21, contents.`comment_age` AS t0_r22, contents.`filter` AS t0_r23, contents.`user_agent` AS t0_r24, contents.`referrer` AS t0_r25, users.`id` AS t1_r0, users.`login` AS t1_r1, users.`email` AS t1_r2, users.`crypted_password` AS t1_r3, users.`salt` AS t1_r4, users.`activation_code` AS t1_r5, users.`activated_at` AS t1_r6, users.`created_at` AS t1_r7, users.`updated_at` AS t1_r8, users.`deleted_at` AS t1_r9, users.`token` AS t1_r10, users.`token_expires_at` AS t1_r11, users.`filter` AS t1_r12, users.`admin` AS t1_r13 FROM contents LEFT O
    UTER JOIN users ON users.id = contents.user_id INNER JOIN assigned_sections ON contents.id = assigned_sections.article_id WHERE ((assigned_sections.section_id = 1)) AND (contents.published_at <= '2007-11-15 02:24:09' AND contents.published_at IS NOT NULL) AND ( (contents.`type` = 'Article' ) ) ORDER BY contents.published_at desc LIMIT 15←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;35;1mSection Load (0.009000)←[0m ←[0mSELECT * FROM sections WHERE (sections.site_id =1) ORDER BY position←[0m

    Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: Completed in 1.12200 (0 reqs/sec) | Rendering: 0.00100 (0%) | DB: 0.16200 (14%) | 200 OK [http://localhost/mephisto-0.7.3]

    Nov 14, 2007 6:24:11 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO:

    Processing AssetsController#show (for 127.0.0.1 at 2007-11-14 18:24:11) [GET]

    Nov 14, 2007 6:24:11 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: Parameters: {"ext"=>"css", "dir"=>"stylesheets", "action"=>"show", "controller"=>"assets", "path"=>"main"}

    Nov 14, 2007 6:24:11 PM sun.reflect.NativeMethodAccessorImpl invoke0
    INFO: ←[4;36;1mSite Columns (0.030000)←[0m ←[0;1mSHOW FIELDS FROM sites←[0m

    Nov 14, 2007 6:24:11 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: ←[4;35;1mSite Load (0.018000)←[0m ←[0mSELECT * FROM sites WHERE (sites.`host` = 'localhost') LIMIT 1←[0m

    Nov 14, 2007 6:24:11 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: ←[4;36;1mSite Load (0.011000)←[0m ←[0;1mSELECT * FROM sites ORDER BY id LIMIT 1←[0m

    Nov 14, 2007 6:24:12 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: Completed in 0.33500 (2 reqs/sec) | Rendering: 0.00100 (0%) | DB: 0.05900 (17%) | 200 OK [http://localhost/mephisto-0.7.3/stylesheets/main.css]

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO:

    Processing AssetsController#show (for 127.0.0.1 at 2007-11-14 18:24:14) [GET]

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: Parameters: {"ext"=>"png", "dir"=>"images", "action"=>"show", "controller"=>"assets", "path"=>"bg"}

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: ←[4;35;1mSite Columns (0.009000)←[0m ←[0mSHOW FIELDS FROM sites←[0m

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: ←[4;36;1mSite Load (0.017000)←[0m ←[0;1mSELECT * FROM sites WHERE (sites.`host` = 'localhost') LIMIT 1←[0m

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: ←[4;35;1mSite Load (0.007000)←[0m ←[0mSELECT * FROM sites ORDER BY id LIMIT 1←[0m

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: Sending data bg.png

    Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
    INFO: Completed in 0.27900 (3 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.03300 (11%) | 200 OK [http://localhost/mephisto-0.7.3/images/bg.png]

  7. The exact same application can be easily deployed on WEBrick as shown below:

    C:\testbed\mephisto-0.7.3>\testbed\ruby\jruby-1.0.2\bin\jruby script\server
    => Booting WEBrick...
    => Rails application started on http://0.0.0.0:3000
    => Ctrl-C to shutdown server; call with --help for options
    [2007-11-14 18:17:57] INFO WEBrick 1.3.1
    [2007-11-14 18:17:57] INFO ruby 1.8.5 (2007-11-01) [java]
    [2007-11-14 18:17:58] INFO WEBrick::HTTPServer#start: pid=11245030 port=3000
    127.0.0.1 - - [14/Nov/2007:18:18:11 PST] "GET / HTTP/1.1" 200 1326

    In this case, Mephisto gets deployed at http://localhost:3000 and WEBrick console shows the following:

    - -> /
    127.0.0.1 - - [14/Nov/2007:18:18:14 PST] "GET /stylesheets/main.css HTTP/1.1" 200 3168
    http://localhost:3000/ -> /stylesheets/main.css
    127.0.0.1 - - [14/Nov/2007:18:18:17 PST] "GET /favicon.ico HTTP/1.1" 200 0
    - -> /favicon.ico
    127.0.0.1 - - [14/Nov/2007:18:18:16 PST] "GET /images/bg.png HTTP/1.1" 200 142
    http://localhost:3000/stylesheets/main.css -> /images/bg.png

This shows how a popular Ruby application can be deployed on WEBrick or GlassFish V3 Gem without any change.

Let us know if you have tried other Rails applications on GlassFish v3 by leaving a comment.


="1">Technorati: glassfish mephisto rubyonrails ror
jrubyonglassfish v3 gem ruby jruby

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 14, 2007

TOTD #17: Backing Up your Blog Posts on Roller

Filed under: General — arungupta @ 12:02 am

This TOTD explains how to back up your blog posts hosted on Roller-based installations. The instructions are borrowed from Rich’s original post.

  1. Download blogapps-examples (1.0.4 as of this writing).
  2. Go to the directory blogapps-examples-1.0.4\java and invoke ant.
  3. Go to blogapps-examples-1.0.4\java\ex02\dist\grabber directory and edit config.properties to match your settings. My config file looks like:

    download_dir=./bsc_saved
    blog_apitype=metaweblog
    blog_username=arungupta
    blog_password=<my password>
    blog_id=arungupta
    blog_url=http://blogs.sun.com/roller-services/xmlrpc
    max_entries=1000

  4. If you are running behind a firewall, add proxy host and port information to Grabber.bat as:

    java -Dhttp.proxyHost=<proxy host> -Dhttp.proxyPort=<proxy port> -classpath %_cp_% com.manning.blogapps.extra02.Grabber %1 %2 %3

  5. And run the script Grabber.bat.

All the blog entries are locally stored in the directory specified in config.properties (./bsc_saved in this case). And a convenient grabber-index.html page is generated that indexes all the entries.

There are multiple directories in my blog resources. Moreover I’d like to link the resources to my backed up blog posts as well. So backing up resources seems like a slightly more involved process so I’ll try that later. Otherwise Grabber is very cool and convenient for those in-flight and airport lounge times :)

Please leave suggestions on other TOTD that you’d like to see. A complete archive is available here.

Technorati: totd blogs roller grabber

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 13, 2007

JavaOne 2008 – CFP Closes Nov 16

Filed under: webservices — arungupta @ 12:02 am

It’s that time of year again! JavaOne 2008 is scheduled for May 6-9, 2008 in Moscone Center, San Francisco, California.

JavaOne 2008 Call For Papers closes Nov 16 (this Friday). This is your chance to reach out to more than 15,000 developers and share the cool technology that you are working on. The three step process to submit the paper is:

  1. Read the Topics
  2. Understand the Criteria
  3. Submit Paper

You can submit either a Technical Session (TS), Birds-of-Feather session (BOF) or Panel Session (PS). The detailed difference between each of these is explained here but the key difference is that a TS is a more formal presentation where as BOFs are more informal geared towards interactivity with the audience. In a PS multiple domain experts discuss a hot topic and audience may be allowed to ask questions.

Have a look at JavaOne 2007 site archive.

Once again, the Call for Papers deadline is Friday, Nov 16, 2007, so if you have a talk you would like to submit, please do so asap.

Technorati: conf javaone

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Older Posts »

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress