org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0

Appcelerator JIRA | Dawson Toth | 5 years ago
  1. 0

    h1. Problem 1.7.2 introduced a regression: file.read() crashes with an exception. h2. Reproduction The Kitchensink's filesystem.js demonstrates this: exception is generated when file.read() is called. {code:title=app.js} var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'text.txt'); Ti.API.info('file = ' + f); var contents = f.read(); Ti.API.info("contents blob object = "+contents); Ti.API.info('contents = ' + contents.text); Ti.API.info('mime type = ' + contents.mimeType); Ti.API.info('nativePath = ' + f.nativePath); Ti.API.info('exists = ' + f.exists()); Ti.API.info('size = ' + f.size); Ti.API.info('readonly = ' + f.readonly); Ti.API.info('symbolicLink = ' + f.symbolicLink); Ti.API.info('executable = ' + f.executable); Ti.API.info('hidden = ' + f.hidden); Ti.API.info('writeable = ' + f.writeable); Ti.API.info('name = ' + f.name); Ti.API.info('extension = ' + f.extension()); Ti.API.info('resolve = ' + f.resolve()); Ti.API.info('created = ' + String(new Date(f.createTimestamp()))); // #2085 test {code} h2. The Exception That Is Thrown {code} D/KrollContext( 427): (kroll$5: app://examples/filesystem.js) [4031,18273] Running evaluated script: app://examples/filesystem.js I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [327,18600] Resources Directory :app:// I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [17,18617] Temp Directory :undefined I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [4,18621] Application Directory :null I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [4,18625] Application Data Directory :appdata-private:// I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [11,18636] Application Support Directory :undefined I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [16,18652] External Storage Available :true I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [12,18664] Separator :/ I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [5,18669] Line Ending : I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [28,18697] file = [object TiFileProxy] D/dalvikvm( 427): GC_CONCURRENT freed 606K, 37% free 5366K/8391K, external 1644K/1676K, paused 9ms+7ms D/TiFastDev( 427): (kroll$5: app://examples/filesystem.js) [227,18924] sent tokens successfully E/KrollContext( 427): (kroll$5: app://examples/filesystem.js) [8,18932] Error: size < 0 E/KrollContext( 427): java.lang.IllegalArgumentException: size < 0 E/KrollContext( 427): at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65) E/KrollContext( 427): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106) E/KrollContext( 427): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120) E/KrollContext( 427): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216) E/KrollContext( 427): at org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259) E/KrollContext( 427): at org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708) E/KrollContext( 427): at org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155) E/KrollContext( 427): at org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668) E/KrollContext( 427): at org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039) E/KrollContext( 427): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325) E/KrollContext( 427): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/KrollContext( 427): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/KrollContext( 427): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/KrollContext( 427): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/KrollContext( 427): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) E/KrollContext( 427): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217) E/KrollContext( 427): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223) E/KrollContext( 427): at android.os.Handler.dispatchMessage(Handler.java:95) E/KrollContext( 427): at android.os.Looper.loop(Looper.java:130) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) W/dalvikvm( 427): threadid=13: thread exiting with uncaught exception (group=0x40015560) E/TiUncaughtHandler( 427): (kroll$5: app://examples/filesystem.js) [60,18992] Sending event: exception on thread: kroll$5: app://examples/filesystem.js msg:org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0; Titanium 1.7.2,2011/07/21 09:36,97c3689 E/TiUncaughtHandler( 427): org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0 E/TiUncaughtHandler( 427): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.handleException(KrollContext.java:148) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:325) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223) E/TiUncaughtHandler( 427): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiUncaughtHandler( 427): at android.os.Looper.loop(Looper.java:130) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) E/TiUncaughtHandler( 427): Caused by: java.lang.IllegalArgumentException: size < 0 E/TiUncaughtHandler( 427): at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259) E/TiUncaughtHandler( 427): at org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708) E/TiUncaughtHandler( 427): at org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155) E/TiUncaughtHandler( 427): at org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/TiUncaughtHandler( 427): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/TiUncaughtHandler( 427): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/TiUncaughtHandler( 427): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/TiUncaughtHandler( 427): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318) E/TiUncaughtHandler( 427): ... 5 more E/AndroidRuntime( 427): FATAL EXCEPTION: kroll$5: app://examples/filesystem.js E/AndroidRuntime( 427): org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0 E/AndroidRuntime( 427): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.handleException(KrollContext.java:148) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:325) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223) E/AndroidRuntime( 427): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 427): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) E/AndroidRuntime( 427): Caused by: java.lang.IllegalArgumentException: size < 0 E/AndroidRuntime( 427): at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65) E/AndroidRuntime( 427): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259) E/AndroidRuntime( 427): at org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708) E/AndroidRuntime( 427): at org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155) E/AndroidRuntime( 427): at org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668) E/AndroidRuntime( 427): at org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039) E/AndroidRuntime( 427): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325) E/AndroidRuntime( 427): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/AndroidRuntime( 427): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/AndroidRuntime( 427): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/AndroidRuntime( 427): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/AndroidRuntime( 427): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) E/AndroidRuntime( 427): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318) E/AndroidRuntime( 427): ... 5 more W/ActivityManager( 64): Force finishing activity com.appcelerator.titanium/org.appcelerator.titanium.TiActivity W/ActivityManager( 64): Force finishing activity com.appcelerator.titanium/ti.modules.titanium.ui.TiTabActivity W/ActivityManager( 64): Activity pause timeout for HistoryRecord{40711420 com.appcelerator.titanium/org.appcelerator.titanium.TiActivity} W/ActivityManager( 64): Launch timeout has expired, giving up wake lock! W/ActivityManager( 64): Activity idle timeout for HistoryRecord{406afc58 com.appcelerator.titanium/.KitchensinkActivity} W/ActivityManager( 64): Activity destroy timeout for HistoryRecord{406f06b0 com.appcelerator.titanium/ti.modules.titanium.ui.TiTabActivity} W/ActivityManager( 64): Activity destroy timeout for HistoryRecord{40711420 com.appcelerator.titanium/org.appcelerator.titanium.TiActivity} D/SntpClient( 64): request time failed: java.net.SocketException: Address family not supported by protocol I/Process ( 427): Sending signal. PID: 427 SIG: 9 I/ActivityManager( 64): Process com.appcelerator.titanium (pid 427) has died. {code} It's working on 1.7.1. h3. Additional Problem Reports from the Community More reports here: http://developer.appcelerator.com/question/123092/titaniumfilesystemfile-read-does-not-work-anymore-in-172-on-android

    Appcelerator JIRA | 5 years ago | Dawson Toth
    org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0
  2. 0

    h1. Problem 1.7.2 introduced a regression: file.read() crashes with an exception. h2. Reproduction The Kitchensink's filesystem.js demonstrates this: exception is generated when file.read() is called. {code:title=app.js} var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'text.txt'); Ti.API.info('file = ' + f); var contents = f.read(); Ti.API.info("contents blob object = "+contents); Ti.API.info('contents = ' + contents.text); Ti.API.info('mime type = ' + contents.mimeType); Ti.API.info('nativePath = ' + f.nativePath); Ti.API.info('exists = ' + f.exists()); Ti.API.info('size = ' + f.size); Ti.API.info('readonly = ' + f.readonly); Ti.API.info('symbolicLink = ' + f.symbolicLink); Ti.API.info('executable = ' + f.executable); Ti.API.info('hidden = ' + f.hidden); Ti.API.info('writeable = ' + f.writeable); Ti.API.info('name = ' + f.name); Ti.API.info('extension = ' + f.extension()); Ti.API.info('resolve = ' + f.resolve()); Ti.API.info('created = ' + String(new Date(f.createTimestamp()))); // #2085 test {code} h2. The Exception That Is Thrown {code} D/KrollContext( 427): (kroll$5: app://examples/filesystem.js) [4031,18273] Running evaluated script: app://examples/filesystem.js I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [327,18600] Resources Directory :app:// I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [17,18617] Temp Directory :undefined I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [4,18621] Application Directory :null I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [4,18625] Application Data Directory :appdata-private:// I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [11,18636] Application Support Directory :undefined I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [16,18652] External Storage Available :true I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [12,18664] Separator :/ I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [5,18669] Line Ending : I/TiAPI ( 427): (kroll$5: app://examples/filesystem.js) [28,18697] file = [object TiFileProxy] D/dalvikvm( 427): GC_CONCURRENT freed 606K, 37% free 5366K/8391K, external 1644K/1676K, paused 9ms+7ms D/TiFastDev( 427): (kroll$5: app://examples/filesystem.js) [227,18924] sent tokens successfully E/KrollContext( 427): (kroll$5: app://examples/filesystem.js) [8,18932] Error: size < 0 E/KrollContext( 427): java.lang.IllegalArgumentException: size < 0 E/KrollContext( 427): at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65) E/KrollContext( 427): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106) E/KrollContext( 427): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120) E/KrollContext( 427): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216) E/KrollContext( 427): at org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259) E/KrollContext( 427): at org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708) E/KrollContext( 427): at org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155) E/KrollContext( 427): at org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668) E/KrollContext( 427): at org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039) E/KrollContext( 427): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325) E/KrollContext( 427): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/KrollContext( 427): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/KrollContext( 427): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/KrollContext( 427): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/KrollContext( 427): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) E/KrollContext( 427): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217) E/KrollContext( 427): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223) E/KrollContext( 427): at android.os.Handler.dispatchMessage(Handler.java:95) E/KrollContext( 427): at android.os.Looper.loop(Looper.java:130) E/KrollContext( 427): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) W/dalvikvm( 427): threadid=13: thread exiting with uncaught exception (group=0x40015560) E/TiUncaughtHandler( 427): (kroll$5: app://examples/filesystem.js) [60,18992] Sending event: exception on thread: kroll$5: app://examples/filesystem.js msg:org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0; Titanium 1.7.2,2011/07/21 09:36,97c3689 E/TiUncaughtHandler( 427): org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0 E/TiUncaughtHandler( 427): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.handleException(KrollContext.java:148) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:325) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223) E/TiUncaughtHandler( 427): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiUncaughtHandler( 427): at android.os.Looper.loop(Looper.java:130) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) E/TiUncaughtHandler( 427): Caused by: java.lang.IllegalArgumentException: size < 0 E/TiUncaughtHandler( 427): at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259) E/TiUncaughtHandler( 427): at org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708) E/TiUncaughtHandler( 427): at org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155) E/TiUncaughtHandler( 427): at org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/TiUncaughtHandler( 427): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/TiUncaughtHandler( 427): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/TiUncaughtHandler( 427): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/TiUncaughtHandler( 427): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) E/TiUncaughtHandler( 427): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306) E/TiUncaughtHandler( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318) E/TiUncaughtHandler( 427): ... 5 more E/AndroidRuntime( 427): FATAL EXCEPTION: kroll$5: app://examples/filesystem.js E/AndroidRuntime( 427): org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0 E/AndroidRuntime( 427): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.handleException(KrollContext.java:148) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:325) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223) E/AndroidRuntime( 427): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 427): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86) E/AndroidRuntime( 427): Caused by: java.lang.IllegalArgumentException: size < 0 E/AndroidRuntime( 427): at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65) E/AndroidRuntime( 427): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216) E/AndroidRuntime( 427): at org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259) E/AndroidRuntime( 427): at org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708) E/AndroidRuntime( 427): at org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155) E/AndroidRuntime( 427): at org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668) E/AndroidRuntime( 427): at org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039) E/AndroidRuntime( 427): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325) E/AndroidRuntime( 427): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854) E/AndroidRuntime( 427): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) E/AndroidRuntime( 427): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) E/AndroidRuntime( 427): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177) E/AndroidRuntime( 427): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) E/AndroidRuntime( 427): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306) E/AndroidRuntime( 427): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318) E/AndroidRuntime( 427): ... 5 more W/ActivityManager( 64): Force finishing activity com.appcelerator.titanium/org.appcelerator.titanium.TiActivity W/ActivityManager( 64): Force finishing activity com.appcelerator.titanium/ti.modules.titanium.ui.TiTabActivity W/ActivityManager( 64): Activity pause timeout for HistoryRecord{40711420 com.appcelerator.titanium/org.appcelerator.titanium.TiActivity} W/ActivityManager( 64): Launch timeout has expired, giving up wake lock! W/ActivityManager( 64): Activity idle timeout for HistoryRecord{406afc58 com.appcelerator.titanium/.KitchensinkActivity} W/ActivityManager( 64): Activity destroy timeout for HistoryRecord{406f06b0 com.appcelerator.titanium/ti.modules.titanium.ui.TiTabActivity} W/ActivityManager( 64): Activity destroy timeout for HistoryRecord{40711420 com.appcelerator.titanium/org.appcelerator.titanium.TiActivity} D/SntpClient( 64): request time failed: java.net.SocketException: Address family not supported by protocol I/Process ( 427): Sending signal. PID: 427 SIG: 9 I/ActivityManager( 64): Process com.appcelerator.titanium (pid 427) has died. {code} It's working on 1.7.1. h3. Additional Problem Reports from the Community More reports here: http://developer.appcelerator.com/question/123092/titaniumfilesystemfile-read-does-not-work-anymore-in-172-on-android

    Appcelerator JIRA | 5 years ago | Dawson Toth
    org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0
  3. 0

    Using CLOB datatype in SQL stored procedure

    Stack Overflow | 4 years ago | ssdimmanuel
    java.lang.IllegalArgumentException: Negative initial size: -5</em>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    startup error

    xml-xindice-users | 1 decade ago | xindice
    java.lang.IllegalArgumentException: Negative initial size: -1111672173
  6. 0

    How to create WWWBinaryFileAsset through programming

    Oracle Community | 4 years ago | 941893
    java.lang.IllegalArgumentException: Negative initial size: -1

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      size < 0

      at java.io.ByteArrayOutputStream.<init>()
    2. Java RT
      ByteArrayOutputStream.<init>
      1. java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:65)
      1 frame
    3. org.appcelerator.titanium
      TiBlob.toString
      1. org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106)
      2. org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120)
      3. org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216)
      4. org.appcelerator.titanium.TiBlob.toString(TiBlob.java:259)
      4 frames
    4. org.appcelerator.kroll
      KrollObject.getDefaultValue
      1. org.appcelerator.kroll.KrollProxy.getDefaultValue(KrollProxy.java:708)
      2. org.appcelerator.kroll.KrollObject.getDefaultValue(KrollObject.java:155)
      2 frames
    5. Rhino
      Context.evaluateReader
      1. org.mozilla.javascript.ScriptRuntime.add(ScriptRuntime.java:2668)
      2. org.mozilla.javascript.Interpreter.do_add(Interpreter.java:3039)
      3. org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1325)
      4. org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
      5. org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
      6. org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
      7. org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
      8. org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
      9. org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
      9 frames
    6. org.appcelerator.titanium
      TiMessageQueue.handleMessage
      1. org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105)
      2. org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
      3. org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
      4. org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
      5. org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
      5 frames
    7. Android Platform
      Looper.loop
      1. android.os.Handler.dispatchMessage(Handler.java:95)
      2. android.os.Looper.loop(Looper.java:130)
      2 frames
    8. org.appcelerator.titanium
      KrollHandlerThread.run
      1. org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
      1 frame