04-29-2018 09:26 PM - edited 03-01-2019 04:09 AM
Hi all,
I'm trying to import 3 external jars, in this case they're:
I've confirmed that these jars are working properly, I created independent Java project in Eclipse, added them in the build path library, and tried the class/methods that I need.
So now I want to incorporate these jars into my NSO project. Below are the steps that I've performed:
Then I did "make clean all" and reload packages. It works fine up until the java codes actually invoked (during commit dry-run) with error:
com.tailf.dp.DpCallbackException: org/springframework/security/web/util/IpAddressMatcher
at com.tailf.dp.annotations.ProxyUtils.invocationTargetCheck(ProxyUtils.java:78)
at com.tailf.dp.annotations.ServiceCallbackProxy.create(ServiceCallbackProxy.java:135)
at com.tailf.dp.DpTrans.protoCallback(DpTrans.java:1688)
at com.tailf.dp.DpTrans.read(DpTrans.java:645)
at com.tailf.dp.DpTrans.run(DpTrans.java:374)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.tailf.dp.DpThread.run(DpThread.java:41)
Caused by: java.lang.NoClassDefFoundError: org/springframework/security/web/util/IpAddressMatcher
..
..
So wondering if I missed anything else? How do I make NSO to include my external jars into its build path and see them?
Thanks in advance.
04-29-2018 09:34 PM
Hi there,
Have you tried putting them in the private-jar/shared-jar directory?
That is what I had done a while back and seemed to have worked.
04-29-2018 09:46 PM
Thanks Bilal,
You're right, it worked when I put the jars in shared-jar directory. But they get deleted when I do "make clean all".
Is that the only way you reckon? I cannot have a dedicated folder for my external jars in my package? How would it work when I put my package into NSO server (system install) - do I need to make sure my external jars files being copied over as well? And make sure nobody executes "make clean all" on my package or NSO will delete my external jars..
04-29-2018 10:01 PM
I'm haven't played around with ANT much. Perhaps you can play around with the following:
<target name="clean">
<delete dir="${build.dir}"/>
<delete file="${sharedjar.dir}/${package}-ns.jar"/>
<delete file="${privatejar.dir}/${package}.jar"/>
</target>
If the jars are placed in shared-jar then they shouldn't get deleted. Only the namespace jar is deleted by default. However, I suspect the intention is to not share these jars with other packages.
Other option would be to quality the packages that get deleted from private-jar a little instead of a complete wipe-out.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide