I have to create a java agent and it will be used by the client. This java agent uses some external jar files. My question is do i need to put these jar files on the client side jvm/lib/ext folder. So far my observation is if i do not place the jar files on the client side my agent dosent work properly.
Can ther be an alternate to approch to this where i dont need to put external jar files on the client side.
I was thinking if i make the jar files as a part of the Script library it will work fine. but i tired this and still it is not working.
Putting the jars in the lib/ext directory is a possibility but you would have to do that for every client.
When you are editing the agent in Designer you should have an Edit Project button. This will allow you to add ‘external’ files to the agent, including Jars.
You can also add jars to a Script Library in exactly the same way.
Thanks for the reply, yes i have added the jar files to the agent using edit project button and try to run the agent on the client side.
But i didnt get the required behaviour when i run the agent on the client side. I am getting the required behaviour only if i place the external jar files on the client side.
Have u done this kind of implementation earlier. I just want to make sure whether i am doing some mistake of what.
I am using Apache axis to invoke a webservice in .Net. Here i am using few jar files required for Axis to work.
This works find when i have jar files on the Client jvm/lib/ext but getting error when i put them in Agent.
this is the exception i get while running the agent in Debug console.
ava.lang.ExceptionInInitializerError
at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
at org.apache.axis.client.Service.getAxisClient(Service.java:104)
at org.apache.axis.client.Service.<init>(Service.java:113)
at JavaAgent.NotesMain(JavaAgent.java:23)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Caused by: org.apache.commons.discovery.DiscoveryException: Unable to instantiate implementation class for org.apache.commons.logging.LogFactory
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
at java.security.AccessController.checkPermission(AccessController.java:476)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
at COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1397)
at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1270)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1473)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1412)
at java.lang.ClassLoader.getParent(ClassLoader.java:1030)
at org.apache.commons.discovery.resource.ClassLoaders.isAncestor(ClassLoaders.java:141)
at org.apache.commons.discovery.resource.ClassLoaders.put(ClassLoaders.java:114)
at org.apache.commons.discovery.resource.ClassLoaders.getLibLoaders(ClassLoaders.java:176)
at org.apache.commons.discovery.tools.DiscoverClass.find(DiscoverClass.java:355)
at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
at java.security.AccessController.doPrivileged1(Native Method)
at java.security.AccessController.doPrivileged(AccessController.java:287)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
at org.apache.axis.client.Service.getAxisClient(Service.java:104)
at org.apache.axis.client.Service.<init>(Service.java:113)
at JavaAgent.NotesMain(JavaAgent.java:23)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:426)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
at java.security.AccessController.doPrivileged1(Native Method)
at java.security.AccessController.doPrivileged(AccessController.java:287)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
... 6 more
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
at java.security.AccessController.checkPermission(AccessController.java:476)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
at COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1397)
at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1270)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1473)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1412)
at java.lang.ClassLoader.getParent(ClassLoader.java:1030)
at org.apache.commons.discovery.resource.ClassLoaders.isAncestor(ClassLoaders.java:141)
at org.apache.commons.discovery.resource.ClassLoaders.put(ClassLoaders.java:114)
at org.apache.commons.discovery.resource.ClassLoaders.getLibLoaders(ClassLoaders.java:176)
at org.apache.commons.discovery.tools.DiscoverClass.find(DiscoverClass.java:355)
at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
... 12 more
The error doesn’t occur when the jar(s) are in the ext directory because jars in that directory have all permissions by default in the java.policy file. If this app is being written for Notes clients, you’ll need to deploy the jars to the ext directory of all clients or deploy a modified policy file to all clients. Personally, I’d probably opt for the for deploying the jars.dgg
I was able to resolve the errors by modifying the java.policy on client machine. But putting jar files on the client side seems to be a good option rather then modifying the java.policy.