在linux机器上运行jar文件时,我得到下面的堆栈跟踪。但是它完美的Windows机器在linux机器上运行jar时出现UnauthorizedAccessException
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/sun/servicetag/UnauthorizedAccessException
at com.montior.activemq.util.MQProperty.loadProperties(MQProperty.java:31)
at com.montior.activemq.util.MonitorThread.loadProperties(MonitorThread.java:82)
at com.montior.activemq.util.MonitorThread.run(MonitorThread.java:39)
at java.lang.Thread.run(Thread.java:679)
Caused by:java.lang.ClassNotFoundException:com.sun.servicetag.UnauthorizedAccessException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 4 more
上,这是我loadProperies()方法
public static void loadProperties() throws FileNotFoundException,IOException,ArgumentMissingException {
props=new Properties();
// load a properties file
String path = "./util.properties";
props.load(new FileInputStream(new File(path)));
ActiveMqClient.readProperties(props);
}
任何人都可以请帮我这个例外?
对不起!在生产服务器上不允许sudo – csk
要求管理员提供访问权限 – Rupesh