Friday May 30, 2008
GlassFish and jMaki @ RailsConf Today
![]() |
I was originally planning to give my first talk at Rails
Conf on "Rails
powered by GlassFish and jMaki". But I cannot travel for
personal reasons and instead Craig
McClanahan, who is an excellent speaker, has graciously
agreed to speak. Craig has been involved with Rails, GlassFish and
jMaki
for a long time so feel free to poke hime at the talk, in the exhibit
hall and afterwards. |
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Thursday May 29, 2008
Screencast #25: Project SocialSite - Enabling Social Network in your Application
![]() |
Project
SocialSite
makes it easy to add social networking features to your existing web
applications or community sites (running on Java, PHP or Ruby) and turn
it into an OpenSocial
container. It comes with a comprehensive and
highly scalable implementation of social graph, integrates seamlessly
with existing identity and authentication mechanism, make it easy to
plug into existing directory server or other user management systems. This screencast shows how to add social networking features such as Friends, Activities, Profile and an OpenSocial-compliant gadget to your application using NetBeans IDE. |
Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
|
Wednesday May 28, 2008
JRuby 1.1.2 released - Getting Started with v3 Gem
JRuby 1.1.2 was released
yesterday - download
here!
The highlights are:
| ~/testbed/
>unzip
~/Downloads/jruby-bin-1.1.2.zip Archive: /Users/arungupta/Downloads/jruby-bin-1.1.2.zip creating: jruby-1.1.2/ creating: jruby-1.1.2/bin/ inflating: jruby-1.1.2/bin/_jrubycleanup.bat inflating: jruby-1.1.2/bin/_jrubyvars.bat . . . inflating: jruby-1.1.2/share/ri/1.8/system/Zlib/crc_table-c.yaml inflating: jruby-1.1.2/share/ri/1.8/system/Zlib/zlib_version-c.yaml inflating: jruby-1.1.2/share/ri/1.8/system/created.rid inflating: jruby-1.1.2/share/ri/1.8/system/fatal/cdesc-fatal.yaml ~/testbed > |
| ~/testbed/jruby-1.1.2
>bin/jruby -S gem
install rails glassfish --no-ri --no-rdoc JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Bulk updating Gem source index for: http://gems.rubyforge.org/ Bulk updating Gem source index for: http://gems.rubyforge.org/ Successfully installed activesupport-2.0.2 Successfully installed activerecord-2.0.2 Successfully installed actionpack-2.0.2 Successfully installed actionmailer-2.0.2 Successfully installed activeresource-2.0.2 Successfully installed rails-2.0.2 Successfully installed glassfish-0.2.0-universal-java 6 gems installed |
| ~/testbed/jruby-1.1.2
>bin/jruby -S gem
list g
*** LOCAL GEMS *** glassfish (0.2.0) |
| ~/testbed/redmine
>../jruby-1.1.2/bin/jruby
-S glassfish_rails redmine-0.7 May 28, 2008 12:07:19 PM com.sun.enterprise.glassfish.bootstrap.ASMain main INFO: Launching GlassFish on HK2 platform May 28, 2008 12:07:19 PM com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient INFO: Cannot find javadb client jar file, jdbc driver not available May 28, 2008 12:07:20 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3000 May 28, 2008 12:07:20 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_protocols_disabled May 28, 2008 12:07:20 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_ciphers_disabled May 28, 2008 12:07:20 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3131 May 28, 2008 12:07:20 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3838 May 28, 2008 12:07:21 PM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot INFO: Admin Console Adapter: context root: /admin May 28, 2008 12:07:21 PM com.sun.enterprise.rails.RailsDeployer registerAdapter INFO: Loading application redmine-0.7 at / May 28, 2008 12:07:21 PM INFO: Starting Rails instances May 28, 2008 12:07:26 PM SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL May 28, 2008 12:07:32 PM com.sun.grizzly.jruby.RubyObjectPool$1 run INFO: Rails instance instantiation took : 11481ms May 28, 2008 12:07:32 PM com.sun.enterprise.v3.server.AppServerStartup run INFO: Glassfish v3 started in 12787 ms |

Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Tuesday May 27, 2008
Sun GlassFish Enterprise Server Solution
This video explains What (is the solution), Why (this solution will
meet your enterprise needs) and How (to obtain the solution) of Sun
GlassFish Enterprise Server Solution.
Read all about Sun
GlassFish Enterprise Server Solution.
Technorati: youtube
glassfish
solution
Posted by Arun Gupta in General | Comments[4]
|
|
|
|
|
Sunday May 25, 2008
My Pet Street - Using the net to protect your pets
![]() |
I never had a pet and will probably never do :) But
this blog is about a noble cause for pets. One of my ex-colleagues, and a good friend, Connie Weisss founded MyPetStreet.com. This site connects the Web 2.0 social community with the real-life needs of pets such as support, services and resources in a physical community. My Pet Street is developed and hosted on several open-source technologies including Apache, My SQL, and Drupal. |
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Friday May 23, 2008
YouTube, Amazon, Flickr, Google Architectures
Some interesting reads of highly scalable architectures ...
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
| Redmine on GlassFish - Ruby-on-Rails Project Management Application
Redmine is a flexible project management web application
written using Ruby on
Rails framework. The feature list
is pretty comprehensive from the usual suspects like multiple projects,
role-based control, forums/wikis/SCM for each project to enterprise
level features such as LDAP-authentication and multiple languages. It
is cross-platform and cross-database and deploys very nicely on GlassFish
v3.
GlassFish v3 modularity and extensibility allows Rails applications to
be deployed without
any modification (no WARing). This blog explains the
steps on how to deploy Redmine on GlassFish and shows some screenshots
later. More
documentation is available in Redmine
Guide.
| ~/testbed/redmine >svn co http://redmine.rubyforge.org/svn/branches/0.7-stable redmine-0.7 |
| ~/testbed/redmine
>sudo mysqld_safe
--user root Starting mysqld daemon with databases from /usr/local/mysql/data |
| ~/testbed/redmine/redmine-0.7
>../jruby-1.1.1/bin/jruby
-S rake db:create (in /Users/arungupta/testbed/redmine/redmine-0.7) |
| ~/testbed/redmine/redmine-0.7
>../jruby-1.1.1/bin/jruby
-S rake db:migrate (in /Users/arungupta/testbed/redmine/redmine-0.7) == 1 Setup: migrating ========================================================= -- create_table("attachments", {:force=>true}) -> 0.2840s -- create_table("auth_sources", {:force=>true}) -> 0.0540s -- create_table("custom_fields", {:force=>true}) -> 0.0430s -- create_table("custom_fields_projects", {:id=>false, :force=>true}) -> 0.0080s -- create_table("custom_fields_trackers", {:id=>false, :force=>true}) -> 0.0500s . . . == 90 ChangeVersionsNameLimit: migrating ====================================== -- change_column(:versions, :name, :string, {:limit=>nil}) -> 0.0220s == 90 ChangeVersionsNameLimit: migrated (0.0220s) ============================= == 91 ChangeChangesetsRevisionToString: migrating ============================= -- change_column(:changesets, :revision, :string, {:null=>false}) -> 0.0210s == 91 ChangeChangesetsRevisionToString: migrated (0.0230s) ==================== == 92 ChangeChangesFromRevisionToString: migrating ============================ -- change_column(:changes, :from_revision, :string) -> 0.0130s == 92 ChangeChangesFromRevisionToString: migrated (0.0150s) =================== |
| JRUBY_HOME="/Users/arungupta/testbed/redmine/jruby-1.1.1" |
| ~/testbed/redmine
>./glassfishv3-tp2/glassfish/bin/asadmin
deploy redmine-0.7 Command deploy executed successfully. |
| May
21, 2008 4:58:30 PM com.sun.enterprise.rails.RailsDeployer
registerAdapter INFO: Loading application redmine-0.7 at /redmine-0.7 May 21, 2008 4:58:30 PM INFO: Starting Rails instances May 21, 2008 4:58:37 PM SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL May 21, 2008 4:58:42 PM com.sun.grizzly.jruby.RubyObjectPool$1 run INFO: Rails instance instantiation took : 11979ms May 21, 2008 4:58:42 PM com.sun.enterprise.v3.deployment.DeployCommand execute INFO: Deployment of redmine-0.7 done is 12091 ms |








Posted by Arun Gupta in web2.0 | Comments[17]
|
|
|
|
|
Thursday May 22, 2008
Socialsite @ Enterprise 2.0 Conference - Add social networking to your community
![]() |
Sun Microsytems
is a sponsor of Enterprise
2.0 Conference (Jul 9-12, 2008, Boston). The conference has regular tutorials, keynotes and general sessions, multiple tracks and pavilion (even a free pavilion pass). They also have Launch Pad that allow companies developing new social networking products to compete for the chance to present them in front of the largest audience in the Enterprise 2.0 community. |
Posted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|
|
Wednesday May 21, 2008
Embeddable GlassFish in Action - Servlet in a Maven project
Kohsuke
announced the embedability
of GlassFish v3 - this is really cool! Now you can run
GlassFish inside an existing JVM, without the need to start it
externally. The API javadocs are available here.
This blog explains how to host a Servlet using these APIs and write a
simple Maven test to invoke the Servlet - all within the same VM.
The blog creates a Maven project using NetBeans but Maven CLI can be
used as well.
In the NetBeans IDE,
if Maven plugin is not already installed, then install it using
"Tools", "Plugins","Available Plugins".




| mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=org.glassfish.embedded.samples -DartifactId=webtier |
| <repositories> <repository> <id>glassfish-repository</id> <name>Java.net Repository for Glassfish</name> <url>http://download.java.net/maven/glassfish</url> </repository> <repository> <id>download.java.net</id> <name>Java.net Maven Repository</name> <url>http://download.java.net/maven/2</url> </repository> </repositories> |
| <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> |
| <dependency> <groupId>org.glassfish.distributions</groupId> <artifactId>web-all</artifactId> <version>10.0-build-20080430</version> </dependency> <dependency> <groupId>org.glassfish.embedded</groupId> <artifactId>gf-embedded-api</artifactId> <version>1.0-alpha-4</version> </dependency> |

| package
org.glassfish.embedded.samples.webtier; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Arun Gupta */ public class SimpleServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println("Wow, I'm embedded!"); } } |




| <?xml
version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-name>SimpleServlet</servlet-name> <servlet-class>org.glassfish.embedded.samples.webtier.SimpleServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>SimpleServlet</servlet-name> <url-pattern>/SimpleServlet</url-pattern> </servlet-mapping> </web-app> |

|
private final String NAME = "AppTest"; public void testServlet() throws Exception { int port = 9999; GlassFish glassfish = newGlassFish(port); URL url = new URL("http://localhost:" + port + "/" + NAME + "/SimpleServlet"); BufferedReader br = new BufferedReader( new InputStreamReader( url.openConnection().getInputStream())); assertEquals("Wow, I'm embedded!", br.readLine()); glassfish.stop(); } private GlassFish newGlassFish(int port) throws Exception { GlassFish glassfish = new GlassFish(port); ScatteredWar war = new ScatteredWar(NAME, new File("src/main/resources"), new File("src/main/resources/WEB-INF/web.xml"), Collections.singleton(new File("target/classes").toURI().toURL())); glassfish.deploy(war); System.out.println("Ready ..."); return glassfish; } |





Posted by Arun Gupta in web2.0 | Comments[16]
|
|
|
|
|
Tuesday May 20, 2008
FREE 20-week Ruby-on-Rails Programming Course - with Passion!
![]() |
Sang
Shin and Brian
Leonard are starting a new free online course
of "Ruby, JRuby and Rails Application Development
(with Passion!)". The course is taken online and
will start from Jul 15, 2008. The objective of this course are "This course will go through briefly the basics of Ruby (and JRuby) programming language first. The rest of the course will be devoted to learning Rails functionality such as Active Record, Active Controller, and Active View. Attendees will acquire sufficient knowledge in order to write reasonably sophisticated Rails application upon completion." Read more details here. |
Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Monday May 19, 2008
Benefit of using JRuby-on-Rails: Using Java 2D power within Rails
One of the main advantages of using JRuby-on-Rails instead of
Ruby-on-Rails is to harness the power of Java libraries available in
the Java platform. The Java 2D
API is a set of classes for advanced 2D graphics and imaging,
and provides extensive support for image compositing and alpha channel
images, a set of classes to provide accurate color space definition and
conversion, and a rich set of display-oriented imaging operators.
Jennifer
published a new blog showing image-filtering effect (negative,
grayscale, brigthen, sharpen). Read the complete
entry.
A more comprehensive tutorial for JRuby-on-Rails on GlassFish
v3 TP2 (also Jennifer's work) is available here.
Technorati: rubyonrails
ruby jruby glassfish
v3
java2d
web2.0
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Saturday May 17, 2008
Ask The "JRuby + NetBeans + GlassFish" Experts
![]() |
NetBeans
and GlassFish
have changed the landscape of Ruby,
JRuby and Rails development
and deployment. Code completion, debugging, similar development and
deployment environment and many other features (NetBeans, GlassFish)
together make it a compelling offering. Tor Norbye, Brian Leonard and Charles Nutter are fielding questions on Ruby/JRuby/Rails support in the NetBeans IDE and GlassFish in a week-long Ask The Expert session (May 19-23). A complete archive of the Q&A will be available later. You can submit your question here. |
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Thursday May 15, 2008
Screencast
#WS6 showed how to configure GlassFish in Eclipse IDE. With GlassFish
v3 TP2, the plug-in is also updated. Here are snapshots
showing how easy it is to install GlassFish in Eclipse. The snapshots
follow the steps outlined in screencast
#ws6 anyway.
Download Eclipse
IDE for Java EE Developers and install. Check the version ...

... add a new server (in order to install GlassFish adapter) ...

... click on "Download additional server adapters" ...

... select "GlassFish Java EE 5 Server" adapter ...

... click on "Next >" and follow the steps ...

... the IDE restarts after adapter installation is complete. While the
IDE is restarting, download GlassFish
v3 TP2 and unzip (single zip for multiple platforms). After
the IDE is restarted, add a new server (following the steps above) and
filter on "glassfish" ...

... click on "Next >" and select the location of GlassFish v3
TP2 installation ...

... click on "Finish" to see the following window ...

... click on sideways white triangle in green circle to start GlassFish
and see the output console as ...

See how GlassFish starts up in less than 1 sec - and it is modular
(OSGi
compliant), embedable (run in-VM) and extensible (non-Java apps).
And as Ludo reported,
it also runs in embedded mode.
Technorati: glassfish
eclipse
v3
Posted by Arun Gupta in General | Comments[1]
|
|
|
|
|
Wednesday May 14, 2008
WAR-based
packaging and dispatching of Rails application on Java Application
Servers is going through third iteration based what is used for
packaging and dispatching:
| ~/testbed/jruby-1.1.1
>bin/jruby -S gem
install rails warbler --no-ri --no-rdoc JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Updating metadata for 289 gems from http://gems.rubyforge.org/ .............................................................................................................................. .............................................................................................................................. ..................................... complete Successfully installed activesupport-2.0.2 Successfully installed activerecord-2.0.2 Successfully installed actionpack-2.0.2 Successfully installed actionmailer-2.0.2 Successfully installed activeresource-2.0.2 Successfully installed rails-2.0.2 Successfully installed warbler-0.9.9 7 gems installed |
| ~/testbed/jruby-1.1.1/samples/rails
>../../bin/jruby
-S rails hello -d mysql create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments . . . create doc/README_FOR_APP create log/server.log create log/production.log create log/development.log create log/test.log |
| config.frameworks -= [ :active_record, :active_resource, :action_mailer ] |
| ~/testbed/jruby-1.1.1/samples/rails/hello
>../../../bin/jruby
-S warble JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL jar cf hello.war -C tmp/war . |
| ~/testbed/glassfish/v2ur2/glassfish
>bin/asadmin
start-domain --verbose Starting Domain domain1, please wait. May 13, 2008 11:23:44 AM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand INFO: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java . . . [#|2008-05-13T11:34:13.252-0700|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;4848;|WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 4848|#] [#|2008-05-13T11:34:13.691-0700|INFO|sun-appserver9.1|javax.enterprise.system.core.selfmanagement|_ThreadID=10;_ThreadName=main;|SMGT0007: Self Management Rules service is enabled|#] [#|2008-05-13T11:34:13.718-0700|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Application server startup complete.|#] |
| ~/testbed/jruby-1.1.1/samples/rails/hello
>~/testbed/glassfish/v2ur2/glassfish/bin/asadmin
deploy hello.war Command deploy executed successfully. |
| [#|2008-05-13T11:34:23.330-0700|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;/private/tmp/s1astempdomain1server1547440193/hello.war;|ADM1006:Uploading
the file to:[/private/tmp/s1astempdomain1server1547440193/hello.war]|#] [#|2008-05-13T11:34:26.019-0700|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=15;_ThreadName=Thread-30;|deployed with moduleid = hello|#] [#|2008-05-13T11:34:30.626-0700|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|PWC1412: WebModule[/hello] ServletContext.log():Info: using runtime pool timeout of 30 seconds|#] [#|2008-05-13T11:34:30.626-0700|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|PWC1412: WebModule[/hello] ServletContext.log():Warning: no initial runtimes specified.|#] [#|2008-05-13T11:34:30.627-0700|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|PWC1412: WebModule[/hello] ServletContext.log():Warning: no max runtimes specified.|#] |

| ~/testbed/jruby-1.1.1/samples/rails/hello
>../../../bin/jruby
script/generate controller home index JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL exists app/controllers/ exists app/helpers/ create app/views/home exists test/functional/ create app/controllers/home_controller.rb create test/functional/home_controller_test.rb create app/helpers/home_helper.rb create app/views/home/index.html.erb |
| def
index @greeting = "Hello from Rack!!" # access Servlet Context @server_info = $servlet_context.get_server_info # alternative way to get Servlet Context #@server_info2 = request.env['java.servlet_context'].get_server_info # access Servlet Request @method = request.env['java.servlet_request'].get_method @request_uri = request.env['java.servlet_request'].get_request_uri @protocol = request.env['java.servlet_request'].get_protocol @port = request.env['java.servlet_request'].get_server_port end |
| <%=
@greeting %><br><br> Hosted on "<%= @server_info %>" on port "<%= @port %>"<br> <%= @method %> <%= @request_uri %> <%= @protocol %> |

|
<filter> <filter-name>RackFilter</filter-name> <filter-class>org.jruby.rack.RackFilter</filter-class> </filter> <filter-mapping> <filter-name>RackFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class> </listener> |
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Tuesday May 13, 2008
![]() |
GlassFish Globalization team in Japan has started translating some of my blogs (on reader's request basis) in Japanese. The first installment is now live on GlassFish Wiki. |
Posted by Arun Gupta in General | Comments[3]
|
|
|
|
|
Today's Page Hits: 2011
Total # blog entries: 1002