Re: PL/Java new build plugin

From: Kartik Ohri <kartikohri13(at)gmail(dot)com>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Re: PL/Java new build plugin
Date: 2020-07-18 17:24:56
Message-ID: CAASLQ4MqSVnhK_GMgq03HcmOKk7a-v7b4L0yfPbtRO=mpqoQtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

I found this resource
http://blog.chalda.cz/2018/02/17/Maven-plugin-and-fight-with-classloading.html.
Using it I modified my mojo code to update the class loader. It didn't
work. I also used the ClassLoaderUtils referred in to view what resources
the class loader was loading.

This is the output from a standalone program where I call the script engine
to print the name of all script engines it can find. It is able to find
Oracle Nashorn.
[jdk(dot)internal(dot)loader(dot)ClassLoaders$AppClassLoader(at)5bc2b487]
hashCode=1539486855
-> loader resource: null
-> loader resource element: file:/home/amcap1712/Desktop/
-> loader resource element:
jar:file:/usr/share/java/java-atk-wrapper.jar!/META-INF
[jdk(dot)internal(dot)loader(dot)ClassLoaders$PlatformClassLoader(at)78308db1]
hashCode=2016447921
-> loader resource: null
-> loader resource element:
jar:file:/usr/share/java/java-atk-wrapper.jar!/META-INF
context class
loader=[jdk(dot)internal(dot)loader(dot)ClassLoaders$AppClassLoader(at)5bc2b487]
hashCode=1539486855

This is the output from the mojo where it is not able to find any script
engine.
java(dot)net(dot)URLClassLoader(at)14840ffe] hashCode=344199166
-> loader resource: null
-> loader resource element:
jar:file:/usr/share/java/java-atk-wrapper.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/pljava/pljava-pgxs/target/pljava-pgxs-0.0.1-SNAPSHOT.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/Downloads/idea-IC-193.6911.18/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/Downloads/idea-IC-193.6911.18/lib/idea_rt.jar!/META-INF
[ClassRealm[plugin>org.postgresql:pljava-pgxs:0.0.1-SNAPSHOT, parent:
jdk(dot)internal(dot)loader(dot)ClassLoaders$AppClassLoader(at)42a57993]]
hashCode=402683266
-> loader resource: null
-> loader resource element:
jar:file:/usr/share/java/java-atk-wrapper.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/pljava/pljava-pgxs/target/pljava-pgxs-0.0.1-SNAPSHOT.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/Downloads/idea-IC-193.6911.18/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar!/META-INF
-> loader resource element:
jar:file:/home/amcap1712/Downloads/idea-IC-193.6911.18/lib/idea_rt.jar!/META-INF
context class loader=[java(dot)net(dot)URLClassLoader(at)14840ffe] hashCode=344199166

What surprised me is that the only entry in the first case is present in
the second case but still the second fails, Am I missing something here ?

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Chapman Flack 2020-07-18 18:01:28 Re: PL/Java new build plugin
Previous Message Chapman Flack 2020-07-18 13:56:16 Re: PL/Java new build plugin