You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As @perber discovered, Owner can't properly load our properties when running on Android.
The stacktrace is:
java.lang.ExceptionInInitializerError
at org.obehave.android.application.MyApplication.loadStudy(MyApplication.java:53)
at org.obehave.android.ui.activities.MainActivity.chooseStudyActivityResult(MainActivity.java:216)
at org.obehave.android.ui.activities.MainActivity.onActivityResult(MainActivity.java:207)
at android.app.Activity.dispatchActivityResult(Activity.java:5467)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3383)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3430)
at android.app.ActivityThread.access$1300(ActivityThread.java:142)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1251)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5118)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1148)
at java.net.InetAddress.lookupHostByName(InetAddress.java:405)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:251)
at java.net.InetAddress.getByName(InetAddress.java:304)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:105)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:90)
at libcore.net.url.FtpURLConnection.connectInternal(FtpURLConnection.java:219)
at libcore.net.url.FtpURLConnection.connect(FtpURLConnection.java:191)
at libcore.net.url.FtpURLConnection.getInputStream(FtpURLConnection.java:300)
at java.net.URL.openStream(URL.java:470)
at org.aeonbits.owner.loaders.PropertiesLoader.load(PropertiesLoader.java:41)
at org.aeonbits.owner.LoadersManager.load(LoadersManager.java:46)
at org.aeonbits.owner.Config$LoadType$1.load(Config.java:109)
at org.aeonbits.owner.PropertiesManager.doLoad(PropertiesManager.java:290)
at org.aeonbits.owner.PropertiesManager.load(PropertiesManager.java:163)
at org.aeonbits.owner.PropertiesManager.load(PropertiesManager.java:153)
at org.aeonbits.owner.PropertiesInvocationHandler.<init>(PropertiesInvocationHandler.java:54)
at org.aeonbits.owner.DefaultFactory.create(DefaultFactory.java:46)
at org.aeonbits.owner.ConfigCache.getOrCreate(ConfigCache.java:87)
at org.aeonbits.owner.ConfigCache.getOrCreate(ConfigCache.java:40)
at org.obehave.util.properties.AppPropertiesHolder.get(AppPropertiesHolder.java:10)
at org.obehave.service.Study.<clinit>(Study.java:27)
at org.obehave.android.application.MyApplication.loadStudy(MyApplication.java:53)
at org.obehave.android.ui.activities.MainActivity.chooseStudyActivityResult(MainActivity.java:216)
at org.obehave.android.ui.activities.MainActivity.onActivityResult(MainActivity.java:207)
at android.app.Activity.dispatchActivityResult(Activity.java:5467)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3383)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3430)
at android.app.ActivityThread.access$1300(ActivityThread.java:142)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1251)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5118)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
at dalvik.system.NativeStart.main(Native Method)
As documented by Android, System.getProperty("user.home") is going to return an empty String (or null, not sure what "Empty" means). If it would be an empty String, it would get expanded to file:/obehave/obehave.properties, if it's null, it would throw an NPE because of fixBackslashForRegex.
We're using @Sources({"file:~/obehave/obehave.properties", "classpath:obehave.properties"}) as a source - while an empty user.home can be unexpected and be a bug, I'm still wondering why this would produce to an FTP URI.
The text was updated successfully, but these errors were encountered:
As @perber discovered, Owner can't properly load our properties when running on Android.
The stacktrace is:
No idea why Owner thinks it's handling an
FtpURLConnection
. TheURI
s are built in PropertiesManager#toURIs(Sources sources, ConfigURIFactory uriFactory) and ConfigURIFactory#newURI(String spec)Since it's the same piece of code that was touched to fix our ~ expansion issue in Owner, it could be related to some problems when expanding user home on Android (which is done in Util.expandUserHome(String text)):
As documented by Android, System.getProperty("user.home") is going to return an empty String (or null, not sure what "Empty" means). If it would be an empty String, it would get expanded to
file:/obehave/obehave.properties
, if it's null, it would throw an NPE because offixBackslashForRegex
.We're using
@Sources({"file:~/obehave/obehave.properties", "classpath:obehave.properties"})
as a source - while an emptyuser.home
can be unexpected and be a bug, I'm still wondering why this would produce to an FTP URI.The text was updated successfully, but these errors were encountered: