Issue1550

classification
Title: Jar conflict with JRuby 1.4
Type: Severity: normal
Components: Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amak, emblemparade, fwierzbicki, nriley
Priority: Keywords:

Created on 2010-02-05.15:20:49 by emblemparade, last changed 2012-03-19.21:41:00 by fwierzbicki.

Messages
msg5499 (view) Author: Tal (emblemparade) Date: 2010-02-05.15:20:49
Jython POSIX won't work when JRuby 1.4 is in the classpath:

java.lang.NoSuchFieldError: LoadNow

The specific conflict seems to be over jnr-posix.jar.
msg5500 (view) Author: Tal (emblemparade) Date: 2010-02-05.15:30:01
OK, figured it out. Add this to the build.xml jar-complete task:

<rule pattern="jni.**" result="org.python.jni.@1"/>

Can any of the committers do this?
msg5533 (view) Author: Tal (emblemparade) Date: 2010-02-15.21:44:56
On second look, my solution is not working, because jarjar cannot deal with packages which have a "-" in them.

I've opened a bug in jarjar about it. Any other ideas how to rename these classes for the complete jar?
msg5534 (view) Author: Tal (emblemparade) Date: 2010-02-15.22:33:29
Third look. ;)

I built a patched version of jarjar that does support dashes in package names, and used it to build Jython. Still no good -- it seems that the JNI specific stuff is hardcoded in jnr-posix.jar.

The solution for me, for now, is to ship Prudence with Subversion builds of both Jython and JRuby, since they use compatible JFFI libs.

But I think it's still important to find a way to fix Jython so that it plays nicely with others.
msg5537 (view) Author: Nicholas Riley (nriley) Date: 2010-02-16.23:49:48
From IRC:

17:43  wmeissner> sabi: yes - the problem is that the jaffl.jar and
                  jnr-posix.jar in jython are more recent than the ones in jruby
17:43  wmeissner> well, in jruby-1.4 anyway
17:43  sabi> sure, but the idea would be that jython could use jarjar to
             maintain its own copy of jaffl/jnr-posix so it doesn't conflict
17:43  sabi> is there any reason that couldn't happen?
17:44  sabi> or would the native bits conflict?
17:44 * sabi really doesn't know too much about how these things work
17:44  wmeissner> the native bits should be ok ... jaffl might be tricky, it
                  loads its provider via reflection, so that might break
17:45  wmeissner> and unfortunately, you can't jarjar rename jffi at all, since
                  it has jni methods
17:46  sabi> yargh. ok.
17:46  sabi> is jffi at least relatively stable? :)
17:46  wmeissner> I'm really not sure why renaming all the stuff in /jni makes 
                  any difference to that bug
17:46  sabi> i think it's causing jython to not be able to find jni any more
17:47  wmeissner> jffi should have a version 1.0 out soon
17:47  sabi> er jffi or whatever
17:47  sabi> so it probably never even tries to load it
17:47  wmeissner> and given that 0.6 has been stable for 6 months or so, I'd 
                  say it should be ok for another 6 ... or 12 .. or more 
                  hopefully
17:47  sabi> ok. so hopefully the next time jruby and jython release, 
             everything should be good
17:48  wmeissner> yes.  I'm trying to round up people to compile the stubs on 
                  $favourite_platform

So hopefully this will be resolved before we release 2.5.2.  Sorry about the inconvenience.
msg5538 (view) Author: Nicholas Riley (nriley) Date: 2010-02-16.23:50:29
17:49  wmeissner> technically he could also fix the problem by rebuilding 
                  jruby-1.4 with the latest jaffl.jar
17:50  wmeissner> jaffl is pure-java, and relatively api-backward-compatible
17:50  wmeissner> and is where the jnr-posix problem is from
msg5539 (view) Author: Tal (emblemparade) Date: 2010-02-17.03:08:01
Thanks, guys. For now Prudence will ship with svn snapshots of both projects, for greater glory.

Speaking of which, JRuby 1.4 gave me considerable grief in its JSR-223 support. But that's a story for another night.
msg6847 (view) Author: Alan Kennedy (amak) Date: 2012-03-19.19:57:17
Was this resolved for 2.5.2, which has already been released?
msg6850 (view) Author: Tal (emblemparade) Date: 2012-03-19.19:59:08
Yes! Let's close.
msg6889 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-03-19.21:41:00
Hurray! Closing.
History
Date User Action Args
2012-03-19 21:41:00fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg6889
nosy: + fwierzbicki
2012-03-19 19:59:08emblemparadesetmessages: + msg6850
2012-03-19 19:57:17amaksetnosy: + amak
messages: + msg6847
2010-02-17 03:08:02emblemparadesetmessages: + msg5539
2010-02-16 23:50:29nrileysetmessages: + msg5538
2010-02-16 23:49:50nrileysetnosy: + nriley
messages: + msg5537
2010-02-15 22:33:30emblemparadesetmessages: + msg5534
2010-02-15 21:44:56emblemparadesetmessages: + msg5533
2010-02-05 15:30:01emblemparadesetmessages: + msg5500
2010-02-05 15:20:50emblemparadecreate