Monday, September 28, 2009

Problem with Warbler

While I was building the war/ear file I was facing problem at the building time as well as after deployment. Here I tried to mention all those problems:

1) Warbler doesn't copy .specifications file: When we execute gems:unpack:dependencies it creates .specifications file for each gem in your vendor/gems folder. Then when we execute 'war' task it doesn't copy this file into the war file. I solved this problem by adding following line in the config/warble.rb file

config.includes = FileList["vendor/gems/*/.specification"]

2) I was getting Don't know how to build task '' when log folder was there: This is something wired I got when I added the gem 'composite_primary_keys'. There are two solutions for this
  • rename the log folder to some other name and then execute the war task
  • in your warble.rb file use config.gems = []
3) After deployment I was getting undefined method `new' for "Rack::Lock":String: After googling I came to following solution
  • download jruby-complete-1.3.1.jar from here in lib folder
  • download jruby-rack-0.9.5-20090625.190033-5.jar from here in lib folder
  • in config/warble.rb file add following lines
    config.java_libs.delete_if {|f| f =~ /jruby-rack/ || f =~ /jruby-complete/ }
    config.java_libs += FileList["lib/*.jar"]
4) Cannot load gem at [SYSTEM_JRUBY_CACHE_PATH] in MY_APP_FOLDER: I was getting this error when I started using 'composite_primary_keys' gem and trying to execute the war task by jruby rake. The version of this jruby rake is 0.8.7. After some analysis and testing with different version of rake I have identified that if I use older rake (version less then 0.8.4) then the problem is gone. Other thing that you can do is in your warble.rb file use config.gems = []
Some helpful links:

http://kenai.com/jira/browse/JRUBY_RACK-18
http://stufftohelpyouout.blogspot.com/2009/06/how-to-get-warbler-to-include-custom.html
http://stufftohelpyouout.blogspot.com/2009/07/fix-ioerrorio-errorbroken-pipestrange.html
http://wiki.oracle.com/thread/3104945/Error+during+jruby-rack+initialization

No comments: