Hi,
Here's the scenario I've got:
connect.sl has a sub named jmx_connect.
jcdinfo.sl includes
connect.sl, and calls jmx_connect.
If jmx_connect can be run correctly, all is ok.
However, if jmx_connect has problems like in the code below (required
class JMXServiceURL not imported),
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
# import javax.management.remote.JMXServiceURL;
sub jmx_connect {
local('$conn $creds %env');
$creds = cast(@("Administrator", "test123"), ^String);
%env[ [JMXConnector CREDENTIALS] ] = $creds;
$conn = [JMXConnectorFactory connect:
[new JMXServiceURL: "service:jmx:rmi:///jndi/rmi://localhost:9878/
jmxrmi"], %env];
return $conn;
}
... running
jcdinfo.sl prints:
D:\scripts\sleep>java -jar sleep.jar
jcdinfo.sl
Warning: Attempted to call non-existent function &jmx_connect at
jcdinfo.sl:10
Warning: Attempted to call a non-static method on a null reference at
jcdinfo.sl:12
Warning: Attempted to call a non-static method on a null reference at
jmxbean.sl:7
Warning: Attempted to call a non-static method on a null reference at
jmxbean.sl:9
Warning: Attempted to use foreach on non-array: '' at
jmxbean.sl:9
Warning: Attempted to call a non-static method on a null reference at
jmxbean.sl:19
Warning: Attempted to call a non-static method on a null reference at
jmxbean.sl:21
Warning: Attempted to use foreach on non-array: '' at
jmxbean.sl:21
Warning: No such operation gc at
jmxbean.sl:49
Warning: Attempted to call a non-static method on a null reference at
jcdinfo.sl:17
Warning: Attempted to call a non-static method on a null reference at
jcdinfo.sl:17
Warning: Attempted to call a non-static method on a null reference at
jcdinfo.sl:18
Warning: Attempted to call a non-static method on a null reference at
jcdinfo.sl:29
jcdinfo.sl is running with debug(debug() | 34);
What's printed seems to suggest a problem with including files; not a
problem with jmx_connect.