0


I'm trying to deploy very simple Rails application to Oracle WebLogic server. It's just a default application created by a command like "jruby -S rails new myapp".
It works fine if I run a development server ("jruby -S rails server"). But when I deploy it to WebLogic, I receive an exception:

org.jruby.rack.RackInitializationException: no method 'getInstance' for arguments (org.joda.time.tz.CachedDateTimeZone) on Java::OrgJodaTimeChrono::GJChronology


My environment:
OS: Windows 8.1
Java: Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
jRuby: jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b
WebLogic: 12.1.2
Rails: 4.0.2
Warbler: 1.4.0

Kurt Holz
  • 25
  • 1
  • 4

1 Answers1

-1

this is a common issue with WebLogic caused by conflicting JodaTime (jar) library.

it's fixable by adding a weblogic.xml descriptor and telling WL to "prefer" (Java) classes from WEB-INF/lib details at the wiki : https://github.com/jruby/jruby-rack/wiki/Deploying-with-WebLogic

kares
  • 7,076
  • 1
  • 28
  • 38
  • did you check that *weblogic.xml* was put in the .war under WEB-INF ? – kares Jan 19 '14 at 20:08
  • Yes! I checked it both in the generated war and in a WebLogic folder where it was deployed.
    In addition I noticed that there is no joda-time*.jar file neither in the jRuby folder nor in my app folder. Can it be a reason of my trouble?
    – Kurt Holz Jan 20 '14 at 05:00
  • joda classes are there part of `jruby-core.jar` this must be a WL configuration issue than - you need to verify that it is truly preferring application classes instead of those in WL's CP, there might be a WL setting somewhere that still disables it or something - you should know better since you have the server at your fingerprints! – kares Jan 20 '14 at 05:49
  • Heh, I rebooted WebLogic and now everything works fine. :)
    Thanks!
    – Kurt Holz Jan 20 '14 at 11:21