Why can't won't ecilpse connect to my Android device? - adb

I've done a bit of searching and found suggested solutions, but nothing works. When I try to run my Android program on my phone, I get this error:
2012-04-11 10:25:00 - Android Cheater Physics] Android Launch!
[2012-04-11 10:25:00 - Android Cheater Physics] Connection with adb was interrupted.
[2012-04-11 10:25:00 - Android Cheater Physics] 0 attempts have been made to reconnect.
[2012-04-11 10:25:00 - Android Cheater Physics] You may want to manually restart adb from the Devices view.
Restarting the adb gives me this error:
[2012-04-11 10:05:40 - ddms]Failed to initialize Monitor Thread: Unable to establish loopback connection
[2012-04-11 10:08:46 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2012-04-11 10:08:46 - Logcat]An existing connection was forcibly closed by the remote host
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:395)
at com.android.ddmlib.Device.executeShellCommand(Device.java:284)
at com.android.ddmuilib.logcat.LogPanel$3.run(LogPanel.java:527)
[2012-04-11 10:08:47 - DeviceMonitor]Connection attempts: 1
[2012-04-11 10:09:18 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
I've tried unchecking and rechecking the debugger as well. I'm on a school computer and haven't had the chance to try it on my home computer. Although it worked before, perhaps the firewall is now blocking it or something? Anyone have any ideas?

Go to DDMS ,==> Reset adb ==> restart Eclipse

Related

HTTP Server: Connection closed by foreign host

Attempting to get this HTTP webserver I found online running after downloading their source files (source: Webserver). [Files located at bottom of webpage.]
I attempted to compile it using their Makefile but there were some errors, where I just needed to #include some extra libraries. However, once I got that compiled and running (tested using telnet)
telnet localhost <port number>
I get the following:
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Then after 5 seconds or so it displays the following:
Connection closed by foreign host.
I'm not sure if the person who wrote it is still managing it so I figured I'd ask here. Any ideas as to why connection closes?
I'm running this on a Windows machine connected to a Unix server, so as the program site states, it should be running correctly on Unix machines.
in the file: reqhead.c
in the function: Get_Request()
There is a timed call to select()
You can change the timeout value (currently 5 seconds)
or replace the timeout parameter with a NULL parameter (although replacing with NULL would mean the code, once a connection is established would wait forever.)
First we will see ubuntu system log with this command
sudo gedit /var/log/syslog
and if you will see this error "execv( /usr/sbin/tcpd ) failed: No such file or directory"
then run this command
sudo apt-get install tcpd
It will solve your problem (if not then you need to search your system error on google)

Timed out error on starting Webdriver server when connected to network via VPN

In my protractor config file, I had this line, seleniumAddress: 'http://localhost:4444/wd/hub'. On running Protractor I was getting an error "ECONNREFUSED connect ECONNREFUSED". After going through lot of other existing issues and solutions, I removed "seleniumAddress" property. That resolved the issue. Selenium standalone server gets started. "Selenium standalone server started at http://192.168.1.156:64477/wd/hub"
But when I turn on the VPN, then I get an error "Error: Timed out waiting for the WebDriver server at http://192.168.1.156:63199/wd/hub", which I have been not able to resolve.
I am on a HP laptop which has Windows 7 Professional and I am using Cisco VPN.
(Hi, so I can't comment yet (low rep)...)
Could you try running webdriver-manager start before running protractor? It will run in the address http://localhost:4444/wd/hub which is the seleniumAddress referred to in the protractor config. Does that change anything?
This might be related (VPN-workaround): protractor stand alone selenium fails: Error: Timed out waiting for the WebDriver server at
Check the settings of the firewall that stays between Selenium standalone server (which might run also on your local host) and your working station (usually your localhost).
In my case (running on local Linux station) I had a very restrictive iptables firewall rules such that the WebDriver process launched on localhost could not access the Selenium standalone server which also run on localhost at whatever TCP port.
Just try to turn it off and check if that is the case ; then accommodate your firewall settings such that the respective connection passes your firewall rules.
If you want your scripts communicate directly with the Firefox|Chrome Driver (bypassing the Selenium server entirely) then try adding the directConnect: true in your protractor.conf.js
Git and other tools, often use the git: protocol for accessing files
in remote repositories. Some firewall configurations are blocking
git:// URLs, which leads to errors when trying to clone repositories
or download dependencies. (For example corporate firewalls are
"notorious" for blocking git:.)
If you run into this issue, you can force the use of https: instead,
by running the following command: git config --global
url."https://".insteadOf git://
(see Common Issues on Angular tutorial)

MEAN app crashed on Internet disconnection

I am developing a MEAN application. When I use localhost for local development the app is running fine on http://localhost:3300 when Internet is there but throws below error when the Internet is disconnected.
process.nextTick(function() { throw err; })
^
Error: getaddrinfo ENOENT
at Object.exports._errnoException (util.js:746:11)
at errnoException (dns.js:49:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
[nodemon] app crashed - waiting for file changes before starting...
Can anyone help me resolving this strange issue? As app is on localhost,it should not have any dependency on Internet.
My MongoDB connection is on mongodb://localhost:27017.
Thanks!
Try changing all localhost occurrences with 127.0.0.1
Had the same problem. Turns out without an active internet connection localhost cannot be resolved into a valid IP.
Make your own local network.
I don't know the exact reason why this is happening. But I noticed that if your pc is not assigned an IP address it will produce this error.
So what I did was, I turned my portable wifi hotspot on and re-run the app and whoa! It worked! That hotspot assigned an IP address to my pc. So, it simply means you should be connected to any network. It can be your mobile hotspot too.

Remote debugging in Android

I want to debug android app running on a device which is USB-attached to some remote machine [call Server here] in network from my local system/eclipse [say Client].
I think it's achievable using port forwarding.
I tried adb forward command following way:
in Server: adb forward tcp:6037 tcp:5037
in Client: adb forward tcp:5037 tcp:<remote-host>:6037
but when I fire command in Client, I get "error: cannot rebind smartsocket" or in some systems "Internal error."
Any sort of idea what wrong I'm doing?

JDBC Driver has been forcibly unregistered by Tomcat 6

I am getting this error about mysql:
INFO: Shutting down log4j
09-ene-2014 9:57:21 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
GRAVE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
09-ene-2014 9:57:21 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: A web application appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
There're a lot information about it in others questions. I already updated my mysql lib to the version 5.1.28 (before, I was working with 5.0.8 which contains a bug about it) but it doesn't still work. I have checked that I have that lib in my war. Like a test, I deleted my mysql lib from WEB-INF/lib and I copied to TOMCAT/lib and I missed that error, why?. I don't want to copy that jar in TOMCAT/lib. I'm working with Tomcat6.

Resources