intellimate / Izou

A home automation API for the Raspberry Pi in java. javadoc: http://intellimate.github.io/Izou/apidocs/overview-summary.html
Other
5 stars 0 forks source link

Exception in the security manager-Request hotfix #30

Closed LeanderK closed 9 years ago

LeanderK commented 9 years ago

this happens on the security implemented in the main branch.

stacktrace:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1954)
    at org.intellimate.izou.security.IzouSecurityManager.init(IzouSecurityManager.java:54)
    at org.intellimate.izou.security.IzouSecurityManager.<init>(IzouSecurityManager.java:48)
    at org.intellimate.izou.security.IzouSecurityManager.createSecurityManager(IzouSecurityManager.java:36)
    at org.intellimate.izou.main.Main.<init>(Main.java:117)
    at org.intellimate.izou.main.Main.<init>(Main.java:72)
    at Debug.main(Debug.java:14)

here is the code causing the problem:

String workingDir = FileSystemManager.FULL_WORKING_DIRECTORY;
while (!workingDir.endsWith(File.separator + "Izou" + File.separator)) {
      workingDir = workingDir.substring(0, workingDir.length() - 1);
}

the value of workingDir is:/Users/LeanderK/IdeaProjects/RPlay/. it should be obvious why it fails

please fix it as soon as possible-i am not able to start anything

jundl77 commented 9 years ago

done.

LeanderK commented 9 years ago

wrong branch ;)

jundl77 commented 9 years ago

ah

jundl77 commented 9 years ago

done 2.0

LeanderK commented 9 years ago

ok, i still can't run anything, this is the console output:

....
Checked
Checked
Checked
Checked
Checked
2015-05-06 23:37:59,723 ERROR An exception occurred processing Appender CONSOLE java.lang.SecurityException: Access denied to /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/rt.jar
    at org.intellimate.izou.security.IzouSecurityManager.checkRead(IzouSecurityManager.java:93)
    at java.io.File.isDirectory(File.java:844)
    at sun.net.www.ParseUtil.fileToEncodedURL(ParseUtil.java:269)
    at java.lang.Package$1.run(Package.java:579)
    at java.lang.Package$1.run(Package.java:570)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.lang.Package.defineSystemPackage(Package.java:570)
    at java.lang.Package.getSystemPackage(Package.java:546)
    at java.lang.Package.getPackage(Package.java:336)
    at java.lang.Class.getPackage(Class.java:788)
    at org.apache.logging.log4j.core.impl.ThrowableProxy.toCacheEntry(ThrowableProxy.java:495)
    at org.apache.logging.log4j.core.impl.ThrowableProxy.toExtendedStackTrace(ThrowableProxy.java:547)
    at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:113)
    at org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:323)
    at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:64)
    at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:36)
    at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:197)
    at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:55)
    at org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:67)
    at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:108)
    at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:99)
    at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:430)
    at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:409)
    at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367)
    at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:112)
    at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:727)
    at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:716)
    at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:354)
    at org.intellimate.izou.system.logger.IzouLogger.createFileLogger(IzouLogger.java:72)
    at org.intellimate.izou.system.context.ContextImplementation.<init>(ContextImplementation.java:64)
    at org.intellimate.izou.addon.AddOnManager.lambda$initAddOns$48(AddOnManager.java:72)
    at org.intellimate.izou.addon.AddOnManager$$Lambda$5/1484673893.accept(Unknown Source)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.intellimate.izou.addon.AddOnManager.initAddOns(AddOnManager.java:71)
    at org.intellimate.izou.addon.AddOnManager.registerAllAddOns(AddOnManager.java:59)
    at org.intellimate.izou.addon.AddOnManager.addAndRegisterAddOns(AddOnManager.java:55)
    at org.intellimate.izou.main.Main.<init>(Main.java:153)
    at org.intellimate.izou.main.Main.<init>(Main.java:72)
    at Debug.main(Debug.java:14)
....

i think it looks familiar ;) I can wait a day or two for testing (i just finished writing the airplay add-on......damn!), but in the future, try to develop no in master ;)

jundl77 commented 9 years ago

but that is another issue, I removed the security manager from the main branch so nothing should cause errors now

LeanderK commented 9 years ago

Cool! I'll test it as soon as i'm home. It was still pretty frustrating :P

Am 07.05.2015 um 10:48 schrieb Julian Brendl notifications@github.com:

but that is another issue, I removed the security manager from the main branch so nothing should cause errors now

— Reply to this email directly or view it on GitHub.