| Newsgroups |
gmane.comp.java.netbeans.modules.openide.devel |
| Message-ID |
<[email protected]> |
--Apple-Mail=_7FA5BBC4-C6C7-4306-8F94-05B2727D2CD8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
I don=E2=80=99t know the answer to this =E2=80=94 best would be if =
you=E2=80=99d put a small demo app that reproduces this on GitHub. Then =
someone will be able to take a look and suggest solutions.
Thanks,
Geertjan Wielenga | Principal Product Manager
Phone: +31620320056 |=20
Oracle Developer Tools
ORACLE Netherlands | Hertogswetering 163-167 | 3543 AS Utrecht | =
Netherlands
Oracle is committed to developing practices and products that help =
protect the environment
> On 3 Nov 2017, at 21:30, cobusve <[email protected]> wrote:
>=20
> I have ModuleA which Optionally needs ModuleB. What I mean is that I =
want to
> use a class in Module B only if it exists, if not I am OK with that, =
we just
> do not use it.
>=20
> Essentially I want to do in Module A:
>=20
> try { ModBClass foo =3D new ModBClass();}
> catch (NoClassDefFoundError) ...
>=20
> And then going forward not use the functionality when not present.
>=20
> What I have tried :
>=20
> I can make this happen using reflection, but that is too ugly to =
accept.
> There must be a better way !
>=20
> I have compiled ModuleA, which results in info.xml containing
> "OpenIDE-Module-Module-Dependencies=3D"ModuleB". If this is present =
the module
> will not install. If I remove it the module installs but does not =
load. If I
> add OpenIDE-Module-Recommends=3D"ModuleB" it still installs and does =
not load.=20
>=20
> I get an error dialog stating=20
> "Warning - could not install some modules: ModuleA - The module named
> ModuleB was needed and not found."
>=20
> All I find in the logs is "Warning - could not install some modules:
> ModuleA - The module named ModuleB was needed and not found."
>=20
> Note that when I run/debug the ModuleA project from the IDE it opens a
> NetBeans instance and runs just fine and works as expected when =
ModuleB is
> present and also when it is not present.
>=20
> It seems like the process of loading of ModuleA in Netbeans IDE when =
running
> normally does some additional checks which prevents the module from =
loading.=20
>=20
> So where is the magic sauce ? If I understood what Netbeans is doing =
when
> loading the module I could try and figure it out. My modules do not =
contain
> any class member properties or statics so just loading the module =
should not
> trigger any errors. It seems almost like the Netbeans module loader is
> re-checking my imports, so how do I tell it that I know what I am =
doing do
> not worry ?
>=20
> ps. This is similar to the case described here=20
> =
http://netbeans-org.1045718.n5.nabble.com/Optional-module-dependency-td302=
7893.html
>=20
>=20
>=20
> --
> Sent from: =
http://netbeans-org.1045718.n5.nabble.com/Netbeans-RCP-Platform-Users-Open=
-API-f3018772.html
--Apple-Mail=_7FA5BBC4-C6C7-4306-8F94-05B2727D2CD8
Content-Type: multipart/related;
type="text/html";
boundary="Apple-Mail=_B8C96068-FA2E-4231-ABA2-71FC6D684D80"
--Apple-Mail=_B8C96068-FA2E-4231-ABA2-71FC6D684D80
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space;"><div class=3D""><br =
class=3D""></div><div class=3D"">I don=E2=80=99t know the answer to this =
=E2=80=94 best would be if you=E2=80=99d put a small demo app that =
reproduces this on GitHub. Then someone will be able to take a look and =
suggest solutions.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Thanks,</div><br class=3D""><div class=3D""><span><img =
apple-inline=3D"yes" id=3D"F3617BAF-738B-45A0-9115-5EF1A24AE111" =
src=3D"cid:[email protected]" class=3D""></span><br =
class=3D"">Geertjan Wielenga | Principal Product Manager<br =
class=3D"">Phone: +31620320056 | <br =
class=3D"">Oracle Developer Tools<br class=3D""><br class=3D"">ORACLE=
Netherlands | Hertogswetering 163-167 | 3543 AS Utrecht =
| Netherlands<br class=3D""><span><img apple-inline=3D"yes" =
id=3D"9A8409AB-9951-4F05-96F1-C45672071573" =
src=3D"cid:[email protected]" class=3D""></span><br =
class=3D""><br class=3D"">Oracle is committed to developing practices =
and products that help protect the environment<br class=3D""></div><br =
class=3D""><blockquote type=3D"cite" class=3D"">On 3 Nov 2017, at 21:30, =
cobusve <<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>> wrote:<br class=3D""><br =
class=3D"">I have ModuleA which Optionally needs ModuleB. What I mean is =
that I want to<br class=3D"">use a class in Module B only if it exists, =
if not I am OK with that, we just<br class=3D"">do not use it.<br =
class=3D""><br class=3D"">Essentially I want to do in Module A:<br =
class=3D""><br class=3D"">try { ModBClass foo =3D new =
ModBClass();}<br class=3D"">catch (NoClassDefFoundError) ...<br =
class=3D""><br class=3D"">And then going forward not use the =
functionality when not present.<br class=3D""><br class=3D"">What I have =
tried :<br class=3D""><br class=3D"">I can make this happen using =
reflection, but that is too ugly to accept.<br class=3D"">There must be =
a better way !<br class=3D""><br class=3D"">I have compiled ModuleA, =
which results in info.xml containing<br =
class=3D"">"OpenIDE-Module-Module-Dependencies=3D"ModuleB". If this is =
present the module<br class=3D"">will not install. If I remove it the =
module installs but does not load. If I<br class=3D"">add =
OpenIDE-Module-Recommends=3D"ModuleB" it still installs and does not =
load. <br class=3D""><br class=3D"">I get an error dialog =
stating <br class=3D"">"Warning - could not install some modules: =
ModuleA - The module named<br class=3D"">ModuleB was needed and not =
found."<br class=3D""><br class=3D"">All I find in the logs is "Warning =
- could not install some modules:<br class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>ModuleA - =
The module named ModuleB was needed and not found."<br class=3D""><br =
class=3D"">Note that when I run/debug the ModuleA project from the IDE =
it opens a<br class=3D"">NetBeans instance and runs just fine and works =
as expected when ModuleB is<br class=3D"">present and also when it is =
not present.<br class=3D""><br class=3D"">It seems like the process of =
loading of ModuleA in Netbeans IDE when running<br class=3D"">normally =
does some additional checks which prevents the module from =
loading. <br class=3D""><br class=3D"">So where is the magic sauce =
? If I understood what Netbeans is doing when<br class=3D"">loading the =
module I could try and figure it out. My modules do not contain<br =
class=3D"">any class member properties or statics so just loading the =
module should not<br class=3D"">trigger any errors. It seems almost like =
the Netbeans module loader is<br class=3D"">re-checking my imports, so =
how do I tell it that I know what I am doing do<br class=3D"">not worry =
?<br class=3D""><br class=3D"">ps. This is similar to the case described =
here <br class=3D""><a =
href=3D"http://netbeans-org.1045718.n5.nabble.com/Optional-module-dependen=
cy-td3027893.html" =
class=3D"">http://netbeans-org.1045718.n5.nabble.com/Optional-module-depen=
dency-td3027893.html</a><br class=3D""><br class=3D""><br class=3D""><br =
class=3D"">--<br class=3D"">Sent from: =
http://netbeans-org.1045718.n5.nabble.com/Netbeans-RCP-Platform-Users-Open=
-API-f3018772.html<br class=3D""></blockquote><br =
class=3D""></body></html>=
--Apple-Mail=_B8C96068-FA2E-4231-ABA2-71FC6D684D80
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="Mail Attachment.gif"
Content-Type: image/gif;
x-unix-mode=0666;
name="Mail Attachment.gif"
Content-Id: <[email protected]>
R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A
wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR
aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC
AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB
qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3
QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg
sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP
yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ
9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP
m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A
BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw==
--Apple-Mail=_B8C96068-FA2E-4231-ABA2-71FC6D684D80
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="Mail Attachment.gif"
Content-Type: image/gif;
x-unix-mode=0666;
name="Mail Attachment.gif"
Content-Id: <[email protected]>
R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2
lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA
AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg
YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr
OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD
AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3
AIK0J/JWKVzIsEQIADs=
--Apple-Mail=_B8C96068-FA2E-4231-ABA2-71FC6D684D80--
--Apple-Mail=_7FA5BBC4-C6C7-4306-8F94-05B2727D2CD8--