Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31393

Re: using two different versions of JAR files

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: using two different versions of JAR files
Date Fri, 27 Mar 2015 18:58:45 -0400
Organization A noiseless patient Spider
Lines 55
Message-ID <mf4nc0$pv8$1@dont-email.me> (permalink)
References <06d02c2a-6d23-47a9-bcb2-7bd710c9c385@googlegroups.com> <mevgep$ss3$1@dont-email.me> <1ca55065-50ad-41c9-ad2b-435f6ae491df@googlegroups.com> <mf23di$l3e$1@dont-email.me> <mf2674$uov$1@dont-email.me> <mf26kk$hh$1@dont-email.me> <2b132a2c-1421-41b6-b95b-02697b69dcf6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Fri, 27 Mar 2015 22:59:12 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="c50a9e5d554cfaba13eda1c71e805135"; logging-data="26600"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zD44KvcY3OoHM5oRL66mWhvk28EQMSQE="
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0
In-Reply-To <2b132a2c-1421-41b6-b95b-02697b69dcf6@googlegroups.com>
Cancel-Lock sha1:6yrbxg6snaxr6WUm2xaNH29G8gs=
Xref csiph.com comp.lang.java.programmer:31393

Show key headers only | View raw


On 03/27/2015 04:41 PM, John wrote:
> On Thursday, March 26, 2015 at 8:02:29 PM UTC-4, Jeff Higgins wrote:
>> On 03/26/2015 07:53 PM, Jeff Higgins wrote:
>>> On 03/26/2015 07:05 PM, Jeff Higgins wrote:
>>>> On 03/26/2015 09:18 AM, John wrote:
>>>>> On Wednesday, March 25, 2015 at 7:31:33 PM UTC-4, Jeff Higgins wrote:
>>>>>> On 03/25/2015 03:27 PM, John wrote:
>>>>>>> Hi:
>>>>>>>
>>>>>>> Our JAVA programs are running as plugins inside a framework from a
>>>>>>> company called "ABC". They use a JAR suppose called "xyz-1.0.3.jar".
>>>>>>>
>>>>>>> Our JAVA programs need to use newer version, xyz-1.0.5.jar, because
>>>>>>> we found some bug inside xyz-1.0.3.jar
>>>>>>>
>>>>>>> The company "ABC" won't upgrade their JARS.
>>>>>>>
>>>>>>> In our code, when loading com.opq.rst.Hello.class, how can we make
>>>>>>> sure it is not loaded from xyz-1.0.3.jar and it is loaded from
>>>>>>> xyz-1.0.9.jar?
>>>
>>> In your code test for the presence of the bug.
>>> If found you are using the buggy jar.
>>>
>>>>>>>
>>>>>>> Thank you very much.
>>>>>>>
>>>>>> <https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html>
>>>>>>
>>>>>>
>>>>>
>>>>> I have scanned through the document. I don't get any hints.
>>>>>
>>>> Huh. Did you get as far as:
>>>> <https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779>
>>>>
>>>>
>>>> The crux of your problem seems to be your assertion:
>>>> "The company "ABC" won't upgrade their JARS."
>>>> Too bad.
>>>>
>>>
>> Well, it seems your entire upstream needs to get busy
>> in support of their downstream customers (you).
>
> I think my scenario is not rare. The company ships out their framework with certain version of 3rh party library files(JARS). Regardless they are buggy or not, the users of the framework should not be tied to use the same version of the library if the same library is needed by the users, correct?
> My original question is that I want to user NEWER version of JAR. Can I? I think this is classloader question.
> TomCat comes with certain version log4j.jar. The user's program also uses log4j.jar, suppose. The user should not need to care which version this TomCat release is using, because the classloader order in TomCat has been reversed: classloader searches locally first for the specific class, if not found, then delegates to the parent.
>
> In contrast, in normal situation, it is delegated to the parent first, if not found, search locally.
>
I will still say that attempting to get your framework vendor
to upgrade to a newer library version will be your best bet.
Classloader solutions will be tricky at best, then fragile, to broken.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

using two different versions of JAR files John <xsli2@yahoo.com> - 2015-03-25 12:27 -0700
  Re: using two different versions of JAR files John <xsli2@yahoo.com> - 2015-03-25 13:24 -0700
  Re: using two different versions of JAR files Jeff Higgins <jeff@invalid.invalid> - 2015-03-25 19:30 -0400
    Re: using two different versions of JAR files John <xsli2@yahoo.com> - 2015-03-26 06:18 -0700
      Re: using two different versions of JAR files Jeff Higgins <jeff@invalid.invalid> - 2015-03-26 19:05 -0400
        Re: using two different versions of JAR files Jeff Higgins <jeff@invalid.invalid> - 2015-03-26 19:53 -0400
          Re: using two different versions of JAR files Jeff Higgins <jeff@invalid.invalid> - 2015-03-26 20:00 -0400
            Re: using two different versions of JAR files John <xsli2@yahoo.com> - 2015-03-27 13:41 -0700
              Re: using two different versions of JAR files Jeff Higgins <jeff@invalid.invalid> - 2015-03-27 18:58 -0400

csiph-web