-
Website
http://blog.adsdevshop.com/ -
Original page
http://blog.adsdevshop.com/2007/06/10/deploy-your-first-jruby-on-rails-app-to-glassfish/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Ryan Price
2 comments · 1 points
-
webfugitive
1 comment · 1 points
-
Mark W. Schumann
2 comments · 1 points
-
ReinH
1 comment · 6 points
-
paulklipp
6 comments · 1 points
-
-
Popular Threads
-
Does Offshoring Really Save Money?
1 week ago · 8 comments
-
Introduction to Scrum for Managers Webinar
3 days ago · 2 comments
-
If You Don’t Focus on Business Value, Don’t Adopt Agile
3 weeks ago · 12 comments
-
Add a Call to Action to Your WordPress Posts with WP Post Footer
3 weeks ago · 6 comments
-
Pay (A Little) Attention to Competitors
3 weeks ago · 4 comments
-
Does Offshoring Really Save Money?
1) current version of the mysql connector is 5.0.6, not 5.0.4 (but obviously it's just whatever you have)
2) goldspike makes some assumptions about the name of the jar files you tell it to add. the default name of the mysql connector when you download the binary version ends in -bin (after the version). you should rename it to mysql-connector-java-5.0.6.jar and make sure it's in your JRUBY_HOME/lib directory (make sure to add that to your .bash_profile or equivalent startup script)
Thanks for catching that. Ironically, I have the 5.0.6 in my jruby/lib directory. I have updated the tutorial. Thanks for the goldspike info as well.
My database.yml was using variables as well (production was pointing to development for DRY sake) but the Java YAML parser complained and I had to copy the entire development setting to production as well. Only then my app ran in Glassfish.
Even then it didn't ran 100%: my testbed app was a slightly customized Redmine and file uploading still didn't work. I still didn't figured out what was the reason for that.
On the other hand I also had to patch ActiveRecord-JDBC because it recognizes :boolean as tinyint(1) and bit(1) but it complained about 'bit', so I added that to the adapter as well (through opening its class in environment.rb). Only then the unit and funcional tests passed. But the integration testes failed miserably return HTTP 500. Probably something in the CGI support that I still didn't figure out.
Anyone had the same trouble? I want to share some experiences on that. If anyone can read portuguese, take a look at my detailed report at (http://www.akitaonrails.com/articles/2007/06/10...). All the patches I applied to my working copy are there as well.
I am sorry to hear that you ran into so many issues. I thank you for posting them here, and hope that your experience will help others in your shoes. You do bring up a good point as well - the proper application of JRuby.
I have been talking a lot with friends (other developers both Java and Ruby/Rails) about when to use JRuby. I will keep the opinions for another post, however, the consensus was "if it ain't broke don't fix it." In other words, if your Rails app works well running on Mongrel+Apache or whatever your setup is, leave it there. Do you need to plug into Java libraries? If the answer is yes, then go for it, but keep testing as you go.
Thank you again for the post of your experience.
By the way, I had to download the latest Goldspike plugin once I started using JRuby 1.0. In addition, I had to include the path to jruby/lib in my $PATH.
http://www.developer.com/lang/article.php/3669041
Check out the JRuby mailing lists. I have seen people discussing it on the "user" list.
http://xircles.codehaus.org/projects/jruby/lists
javax.servlet.ServletException: Could not load Rails. See the logs for more details.
org.jruby.webapp.RailsFactory.makeObject(RailsFactory.java:131)
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)
org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:144)
org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.jruby.webapp.FileServlet.doGet(FileServlet.java:102)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
if RUBY_PLATFORM =~ /java/
require 'rubygems'
RAILS_CONNECTION_ADAPTERS = %w(jdbc)
end
Put that under the "require File.join" line. If that doesn't work let me know. Thanks.
Thank you for the great feedback. We are working on turning this tutorial into a screencast and should have it released soon.
http://blogs.sun.com/arungupta/entry/ruby_on_ra..., http://blogs.sun.com/arungupta/entry/database_e... and http://blogs.sun.com/arungupta/entry/database_e...
I'm working on a screencast version of these tutorials using NetBeans 6 M10.
Thanks,
-Arun
Thanks for posting your tutorials. They have definitely helped me out. I look forward to the screencasts for NetBeans as well.
Enjoy!
If one controller action is a bit slow (eg. 10 seconds long) the other actions don't render anything (no response from GlassFish, only a blank page).
To test it simply put "sleep 10" before render into an action controller code...
Does someone have tested this simple case ?
Thanks in advance !
This tutorial was really very worth and deserve to be bookmarked :)
It was very very helpful
like the article. A note about the java version that runs by default on Mac OS X, you can switch versions using the '/Applications/Utilities/Java Preferences' application - just drag the version you want as your default to the top of the list (there's a list for applets and another for applications). I'd advise against changing things in /System/Library/Frameworks unless you really know what your doing (I have and subsequently screwed up my java installation - stopped me from using java, thankfully TimeMachine came to the rescue).