Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2230] Android: Resolve URL Failing from Event Context

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:29.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M06
ComponentsAndroid
Labelsandroid, defect, release-1.6.0
ReporterDon Thorp
AssigneeMarshall Culpepper
Created2011-04-15T03:14:13.000+0000
Updated2011-04-17T01:58:29.000+0000

Description

I've attached a sample program.

Basically if you have this structure.

app.js
ParentWindow.js
FolderA/ChildWindow.js

app.js creates a window using FolderA/ChildWindow.js

then in a button click handler in the event an attempt is made to create another new window using "/ParentWindow.js".

This is broken in various forms in 1.4.0, 1.4.2 and 1.5.0

I/WindowProxy(  613): (main) [2,6466] handleOpen
E/TiUIWindow(  613): (main) [3,6469] BASEURL: app://FolderA/
E/TiUIWindow(  613): (main) [1,6470] RELURL: /ParentWindow.js
I/TiUIWindow(  613): (main) [1,6471] Window has URL: app:/null/ParentWindow.js
E/TiContext(  613): (main) [1,6472] BaseURL for context is app:/null
D/TiContext(  613): (main) [16,6488] Setting JS Context on org.appcelerator.titanium.TiContext@44cac1b8 to org.appcelerator.titanium.kroll.KrollBridge@44c9a768
D/TiContext(  613): (main) [6,6494] Setting JS Context on org.appcelerator.titanium.TiContext@44cac1b8 to org.appcelerator.titanium.kroll.KrollBridge@44c9a768
D/TiFileFactory(  613): (kroll$3) [7,6501] getting initial from parts: app:/null/ParentWindow.js
E/KrollContext(  613): (kroll$3) [10,6511] IOException reading file: app:/null/ParentWindow.js
E/KrollContext(  613): java.io.FileNotFoundException: /data/data/net.donthorp.adhoc/app_appdata/app:/null/ParentWindow.js
E/KrollContext(  613):  at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:244)
E/KrollContext(  613):  at java.io.FileInputStream.<init>(FileInputStream.java:77)
E/KrollContext(  613):  at org.appcelerator.titanium.io.TiFile.getInputStream(TiFile.java:219)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:191)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:218)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)
E/KrollContext(  613):  at android.os.Handler.dispatchMessage(Handler.java:95)
E/KrollContext(  613):  at android.os.Looper.loop(Looper.java:123)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)
E/KrollContext(  613): (kroll$3) [38,6549] Error evaluating source: Wrapped java.io.FileNotFoundException: /data/data/net.donthorp.adhoc/app_appdata/app:/null/ParentWindow.js
E/KrollContext(  613): org.mozilla.javascript.WrappedException: Wrapped java.io.FileNotFoundException: /data/data/net.donthorp.adhoc/app_appdata/app:/null/ParentWindow.js
E/KrollContext(  613):  at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1781)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:196)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:218)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)
E/KrollContext(  613):  at android.os.Handler.dispatchMessage(Handler.java:95)
E/KrollContext(  613):  at android.os.Looper.loop(Looper.java:123)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)
E/KrollContext(  613): Caused by: java.io.FileNotFoundException: /data/data/net.donthorp.adhoc/app_appdata/app:/null/ParentWindow.js
E/KrollContext(  613):  at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:244)
E/KrollContext(  613):  at java.io.FileInputStream.<init>(FileInputStream.java:77)
E/KrollContext(  613):  at org.appcelerator.titanium.io.TiFile.getInputStream(TiFile.java:219)
E/KrollContext(  613):  at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:191)

Attachments

FileDateSize
resources.zip2011-04-15T03:14:14.000+0000142372
screen-shot-2010-10-31-at-101610-pm.png2011-04-15T03:14:13.000+000072640

Comments

  1. Marshall Culpepper 2011-04-15

    (from [7ccb480725d365c60861825bd867ce65d9fa6af5]) use the app:// prefix when path is set to null for absolute URLs added a relative+absolute window URL drillbit test in ui
    formatting cleanup in TiUrl/KrollContext, added TiC constants for KrollContext
    [#2230 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/7ccb480725d365c60861825bd867ce65d9fa6af5"> https://github.com/appcelerator/titanium_mobile/commit/7ccb480725d3...

  2. Opie Cyrus 2011-04-15

    Verified with original test case.

JSON Source