I tried to use Apache Axis to access a WebService in a Java Agent.
If I start the agent manualy on my local workstation, it works fine. If I run it scheduled on my Server (Windows 2000), it fails with an exception (see below).
It seems that Log4J has a problem with loading resources.
My JavaUserClasses are:
JavaUserClasses=C:\Lotus\Domino\axis.jar;C:\Lotus\Domino\j2ee.jar
where axis.jar is a combination of all the jar files that come with Axis 1.1 to shorten the length of my JavaUserClasses.
Has anybody successfully used Axis or Log4J in a Notes Agent? Did you encunter the same problem? Do you have a solution?
log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@2e6c5587.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader sun.misc.Launcher$AppClassLoader@2e6c5587.
log4j:WARN Caught Exception while in Loader.getResource. This may be innocuous.
java.lang.SecurityException: \C:\Lotus\Domino\axis.jar
at lotus.notes.AgentSecurityManager.checkRead(AgentSecurityManager.java:608)
at sun.misc.URLClassPath.check(URLClassPath.java:379)
at sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:561)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:593)
at sun.misc.URLClassPath.getResource(URLClassPath.java:164)
at sun.misc.URLClassPath.getResource(URLClassPath.java:173)
at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1122)
at java.lang.ClassLoader.getResource(ClassLoader.java:1026)
at java.lang.ClassLoader.getResource(ClassLoader.java:1024)
at org.apache.log4j.helpers.Loader.getResource(Loader.java:78)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:96)
at org.apache.log4j.Logger.getLogger(Logger.java:85)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:102)
at java.lang.reflect.Constructor.newInstance(Native Method)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:76)
at org.apache.axis.AxisProperties.<clinit>(AxisProperties.java:117)
at TestAgent02.execute(TestAgent02.java:62)
at TestAgent02.NotesMain(TestAgent02.java:39)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(NotesThread.java:215)
log4j: Trying to find [log4j.properties] using ClassLoader.getSystemResource().
java.lang.ExceptionInInitializerError:
org.apache.commons.logging.LogConfigurationException: java.lang.reflect.InvocationTargetException
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:76)
at org.apache.axis.AxisProperties.<clinit>(AxisProperties.java:117)
at TestAgent02.execute(TestAgent02.java:62)
at TestAgent02.NotesMain(TestAgent02.java:39)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(NotesThread.java:215)