I have an android application that parses the HTML content and displays the required tag.
It is working fine for the hardcoded HTML code.
But when I set up a HTTP connection for a URL, then it is not working in Emulator.
Let me know how to set up an HTTP connection in android and see the response in Emulator.
I want to give that response as an input to the parser.
I want it working and parsing in Emulator iteself.
The error that I am getting is
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at com.ltil.HtmlContentParser.main(HtmlContentParser.java:31)
starting the emulator with the option -http-proxy <proxy> allows you to specify a proxy
Related
This is part of my trace:
java.lang.RuntimeException:Unable to create application kula.publics.objects.KulaApplication: net.sqlcipher.database.SQLiteDiskIOException: disk I/O error: COMMIT;
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5116)
......
Caused by:
net.sqlcipher.database.SQLiteDiskIOException:disk I/O error: COMMIT;
net.sqlcipher.database.SQLiteDatabase.native_execSQL(Native Method)
net.sqlcipher.database.SQLiteDatabase.execSQL(Unknown Source)
net.sqlcipher.database.SQLiteDatabase.endTransaction(Unknown Source)
net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(Unknown Source)
net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(Unknown Source)
kula.third.afinal.b.c(Unknown Source)
kula.third.afinal.b.<init>(Unknown Source)
kula.third.afinal.b.b(Unknown Source)
kula.third.afinal.b.a(Unknown Source)
kula.third.afinal.b.a(Unknown Source)
kula.eric.data.db.FlySubDbManager.getDb(Unknown Source)
kula.eric.data.db.FlyBaseDbManager.<init>(Unknown Source)
kula.eric.data.db.FlySubDbManager.<init>(Unknown Source)
kula.eric.data.db.FlySubDbManager.init(Unknown Source)
kula.eric.data.KulaFlyController.<init>(Unknown Source)
kula.eric.data.KulaFlyController.getInstance(Unknown Source)
I have checked my code, there is only one place to open the db file. It doesn't look like multi-threaded problem. And the crash mostly happened in Android 4.4.4.
Related library:
SQLiteOpenHelper in sqlcipher:
https://github.com/sqlcipher/android-database-sqlcipher/blob/master/src/net/sqlcipher/database/SQLiteOpenHelper.java
FinalDb in afinal:
https://github.com/yangfuhai/afinal/blob/master/src/net/tsz/afinal/FinalDb.java
I get the following error when I build the ionic app using script 'ionic build android --prod --release'
ANDROID_HOME=D:\Develop\Android\sdk
JAVA_HOME=C:\Program Files\Java\jre1.8.0_121
Subproject Path: CordovaLib
Downloading https://services.gradle.org/distributions/gradle-2.1.1-all.zip
Exception in thread "main"
java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
It worked 2 days ago, but fails after I reinstall my system.
I'm wasting too many hours to solve this problem. Please help me.
i developed android app its in play store. I am getting binder error from lot of user i don't know how to solve. Can some one can help me on that. This is my log. I am useing google play service and also using pro-guard.
Fatal Exception: java.lang.RuntimeException: android.os.DeadObjectException
at android.content.pm.PackageInstaller.getAllSessions(PackageInstaller.java:406)
at com.google.android.gms.common.zze.zzl(Unknown Source)
at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getInstance(Unknown Source)
at com.google.android.gms.internal.zzpy.zzapv(Unknown Source)
at com.google.android.gms.internal.zzpy.zzc(Unknown Source)
at com.google.android.gms.internal.zzpv.begin(Unknown Source)
at com.google.android.gms.internal.zzqa.zzc(Unknown Source)
at com.google.android.gms.internal.zzpp.onConnected(Unknown Source)
at com.google.android.gms.common.internal.zzk$1.onConnectionSuspended(Unknown Source)
at com.google.android.gms.common.internal.zzd$zzd.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5740)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
Caused by android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Binder.java)
at android.os.BinderProxy.transact(Binder.java:511)
at android.content.pm.IPackageInstaller$Stub$Proxy.getAllSessions(IPackageInstaller.java:360)
at android.content.pm.PackageInstaller.getAllSessions(PackageInstaller.java:404)
at com.google.android.gms.common.zze.zzl(Unknown Source)
at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getInstance(Unknown Source)
at com.google.android.gms.internal.zzpy.zzapv(Unknown Source)
at com.google.android.gms.internal.zzpy.zzc(Unknown Source)
at com.google.android.gms.internal.zzpv.begin(Unknown Source)
at com.google.android.gms.internal.zzqa.zzc(Unknown Source)
at com.google.android.gms.internal.zzpp.onConnected(Unknown Source)
at com.google.android.gms.common.internal.zzk$1.onConnectionSuspended(Unknown Source)
at com.google.android.gms.common.internal.zzd$zzd.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5740)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
Based from this documentation, you encountered an error because the object you are calling has died since its hosting process no longer exists. Also, as stated in this thread, it usually happens when the go side has crashed. Often the useful error log (if any) is before the android.os.DeadObjectException.
This SO post might help you:
Override your service's onDestroy() method and watch what event flow leads to it. If you catch DeadObjectException without going through this method, your service should have been killed by the OS.
I'm planning to use GCM features for an Android app. I setup the proper Android app and the backend service deployed on localhost.
Everyting was fine and the notifications were displayed on my testing device. Next I tried to deploy the service on a different server with a real IP. Now I'm getting this strange error when I try to push the notification from the server side and I don't know how to fix it. Does anyone have a solution?
javax.net.ssl.SSLException: Server key
at com.sun.net.ssl.internal.ssl.Handshaker.throwSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
at com.google.android.gcm.server.Sender.post(Sender.java:479)
at com.google.android.gcm.server.Sender.post(Sender.java:458)
at com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:170)
at com.google.android.gcm.server.Sender.send(Sender.java:121)
at com.gebs.floatmanagement.web.servlet.MapGenerator.sendAndroidNotification(Unknown Source)
at com.gebs.floatmanagement.web.servlet.MapGenerator.processRequest(Unknown Source)
at com.gebs.floatmanagement.web.servlet.MapGenerator.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.spec.InvalidKeySpecException: does not support java.security.spec.ECPublicKeySpec
at com.certicom.ecc.jcae.ECKeyFactorySpi.engineGeneratePublic(Unknown Source)
at java.security.KeyFactory.generatePublic(Unknown Source)
at com.sun.net.ssl.internal.ssl.HandshakeMessage$ECDH_ServerKeyExchange.(Unknown Source)
... 35 more
I have deployed on my server some applications that override some SSL features and because of those the error has raised. Removing the services or migrating the app backend service on another server solved my problems.
I want to write a Client on android phone and send an Object to a Server running on my windows PC (using ObjectDecoderInputStream ), but had these Exception
Exception
java.io.StreamCorruptedException: unexpected end of block data
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.access$300(Unknown Source)
at java.io.ObjectInputStream$GetFieldImpl.readFields(Unknown Source)
at java.io.ObjectInputStream.readFields(Unknown Source)
at java.net.InetSocketAddress.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.jboss.netty.handler.codec.serialization.ObjectDecoderInputStream.readObject(ObjectDecoderInputStream.java:115)
at MainActivity.main(MainActivity.java:30)
But when I use CompatibleObjectEncoder/Decoder on my phone and ObjectInputStream on my PC, it works fine. And if I change the android code to Java code, and run the client on my PC to send my self the Object using ObjectEncoder and its correlated InputStream, it works fine.
By the way, I use netty 3.6.3 final and my android device is 2.3.7 gingerbread (which uses jre 1.5 or 1.6), my PC is jre 1.7, could that be a problem?
Sounds similair to my problem here - I never got to the bottom of it, but changing the JVM so both ends run the same version stopped the error