Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6568] Android: Modules: Rhino: (1_8_X) Creating 2nd instance of view proxy causes app to crash

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2011-12-12T00:50:28.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsbranch-v8, merge-1.8.0.1
ReporterJeff English
AssigneeOpie Cyrus
Created2011-12-12T00:47:28.000+0000
Updated2017-03-09T23:19:17.000+0000

Description

Millennial Media module demonstrates the problem, but a consolidated version of the app.js here shows it quickly. Creating a single instance of the view that is exposed from the module is successful -- the view is created and the ad is displayed. When you try to create a 2nd instance of the view the app crashes. To reproduce, 1. Build the MillennialMedia module from my fork of the Titanium modules repository, branch "apilevel2" 2. Install the module 3. Create a new mobile application in TiStudio 4. Add the module reference to the tiapp.xml file, using version 2.0 5. Add the ti.android.runtime property to the tiapp.xml file and set the value to "rhino" 6. Use the following app.js 7. Build and run the application [Modified app.js from the example folder of the module]
var MillennialMedia = require('ti.millennialmedia');
MillennialMedia.apid = '54131';
MillennialMedia.demographics = {
    age: '23',
    gender: 'male',
    zip: '60187',
    lat: '41.866', 'long': '-88.107'
};

var win = Ti.UI.createWindow({
    backgroundColor: 'white'
});

win.add(MillennialMedia.createView({
    top: 0, left: 0, right: 0,
    height: 53,
    type: MillennialMedia.TYPE_TOP
}));

win.add(MillennialMedia.createView({
    top: 100, left: 0, right: 0,
    height: 53,
    type: MillennialMedia.TYPE_TOP
}));

win.open();
The stack trace from the crash is as follows:
12-09 21:21:13.170: ERROR/ScriptsModule(1586): Error while executing app.js: org.mozilla.javascript.UniqueTag
12-09 21:21:13.170: ERROR/ScriptsModule(1586): java.lang.ClassCastException: org.mozilla.javascript.UniqueTag
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.ProxyFactory.createRhinoProxy(ProxyFactory.java:45)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at ti.millennialmedia.MillennialmediaModulePrototype.execIdCall(MillennialmediaModulePrototype.java:233)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.modules.ScriptsModule.runSource(ScriptsModule.java:72)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.modules.ScriptsModule.access$300(ScriptsModule.java:28)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.modules.ScriptsModule$RunInThisContext.call(ScriptsModule.java:137)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module._c_anonymous_10(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:242)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module._c_anonymous_5(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:96)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module._c_anonymous_3(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:65)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.RhinoRuntime.doRunModule(RhinoRuntime.java:80)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:207)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at android.os.Handler.dispatchMessage(Handler.java:95)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at android.os.Looper.loop(Looper.java:123)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102)
12-09 21:21:13.170: ERROR/ScriptsModule(1586): Error while executing app.js: org.mozilla.javascript.UniqueTag
12-09 21:21:13.170: ERROR/ScriptsModule(1586): java.lang.ClassCastException: org.mozilla.javascript.UniqueTag
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.ProxyFactory.createRhinoProxy(ProxyFactory.java:45)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at ti.millennialmedia.MillennialmediaModulePrototype.execIdCall(MillennialmediaModulePrototype.java:233)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.modules.ScriptsModule.runSource(ScriptsModule.java:72)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.modules.ScriptsModule.access$300(ScriptsModule.java:28)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.modules.ScriptsModule$RunInThisContext.call(ScriptsModule.java:137)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module._c_anonymous_10(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:242)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module._c_anonymous_5(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:96)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module._c_anonymous_3(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:65)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.js.module.call(/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.runtime.rhino.RhinoRuntime.doRunModule(RhinoRuntime.java:80)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:207)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at android.os.Handler.dispatchMessage(Handler.java:95)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at android.os.Looper.loop(Looper.java:123)
12-09 21:21:13.170: ERROR/ScriptsModule(1586):     at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102)
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [1627,2629] ----- Titanium Javascript Runtime Error -----
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [0,2629] - In /var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:242,0
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [0,2629] - Message: Wrapped java.lang.ClassCastException: org.mozilla.javascript.UniqueTag (/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js#242)
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [1,2630] - Source: null
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [1627,2629] ----- Titanium Javascript Runtime Error -----
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [0,2629] - In /var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js:242,0
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [0,2629] - Message: Wrapped java.lang.ClassCastException: org.mozilla.javascript.UniqueTag (/var/folders/dx/dxSQSZKdH3KwJcS3XyegF++++TM/-Tmp-/module.js#242)
12-09 21:21:13.220: ERROR/TiJSError(1586): (main) [1,2630] - Source: null

Comments

  1. Opie Cyrus 2011-12-12

    mistake
  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source