在java代码中,我使用下面的简单命令调用此方法
ItemSimilarityDriver.main(new String[] {
"--input", InFile,
"--output", OutPath,
"--master", masterUrl,
"--filter1", "purchase",
"--filter2", "view",
"--inDelim", ",",
"--itemIDColumn", "2",
"--rowIDColumn", "0",
"--filterColumn", "1"});
然后我在运行时遇到以下错误:
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.ExceptionInInitializerError
at java.net.SocketPermission$1.run(SocketPermission.java:1217)
at java.net.SocketPermission$1.run(SocketPermission.java:1209)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.SocketPermission.initEphemeralPorts(SocketPermission.java:1208)
at java.net.SocketPermission.<clinit>(SocketPermission.java:235)
at sun.security.util.SecurityConstants.<clinit>(SecurityConstants.java:259)
at sun.security.provider.PolicyFile$4.run(PolicyFile.java:688)
at sun.security.provider.PolicyFile$4.run(PolicyFile.java:684)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.provider.PolicyFile.initStaticPolicy(PolicyFile.java:684)
at sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:510)
at sun.security.provider.PolicyFile.init(PolicyFile.java:464)
at sun.security.provider.PolicyFile.<init>(PolicyFile.java:322)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at java.security.Policy.getPolicyNoCheck(Policy.java:195)
at java.security.ProtectionDomain.implies(ProtectionDomain.java:272)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:350)
at java.security.AccessController.checkPermission(AccessController.java:559)
at ch.qos.logback.core.util.Loader$1.run(Loader.java:50)
at ch.qos.logback.core.util.Loader$1.run(Loader.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at ch.qos.logback.core.util.Loader.<clinit>(Loader.java:46)
at ch.qos.logback.classic.util.ContextInitializer.findURLOfDefaultConfigurationFile(ContextInitializer.java:119)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at org.apache.log4j.Category.<init>(Category.java:56)
at org.apache.log4j.Logger.<init>(Logger.java:36)
at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:62)
at org.apache.log4j.Logger.getLogger(Logger.java:40)
at org.apache.mahout.sparkbindings.package$.<init>(package.scala:40)
at org.apache.mahout.sparkbindings.package$.<clinit>(package.scala)
at org.apache.mahout.drivers.MahoutSparkDriver.start(MahoutSparkDriver.scala:81)
at org.apache.mahout.drivers.ItemSimilarityDriver$.start(ItemSimilarityDriver.scala:128)
at org.apache.mahout.drivers.ItemSimilarityDriver$.process(ItemSimilarityDriver.scala:211)
at org.apache.mahout.drivers.ItemSimilarityDriver$$anonfun$main$1.apply(ItemSimilarityDriver.scala:116)
at org.apache.mahout.drivers.ItemSimilarityDriver$$anonfun$main$1.apply(ItemSimilarityDriver.scala:114)
at scala.Option.map(Option.scala:145)
at org.apache.mahout.drivers.ItemSimilarityDriver$.main(ItemSimilarityDriver.scala:114)
at org.apache.mahout.drivers.ItemSimilarityDriver.main(ItemSimilarityDriver.scala)
我试图添加
grant{
permission java.security.AllPermission;
};
在java.policy中但它仍然没有效果。问题似乎与许可有关,但我真的不知道它到底是什么。
请帮助我!