Recently, we have developed J2EE on centos. When Tomcat is started, the following error is always reported:
Severe: standardserver. Await: Create [localhost: 8005]:
Java.net. bindexception: cannot assign requested address
At java.net. plainsocketimpl. socketbind (native method)
At java.net. plainsocketimpl. BIND (plainsocketimpl. Java: 383)
At java.net. serversocket. BIND (serversocket. Java: 328)
At java.net. serversocket. <init> (serversocket. Java: 194)
At org. Apache. Catalina. Core. standardserver. Await (standardserver. Java: 427)
At org. Apache. Catalina. startup. Catalina. Await (Catalina. Java: 757)
At org. Apache. Catalina. startup. Catalina. Start (Catalina. Java: 703)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. Catalina. startup. Bootstrap. Start (Bootstrap. Java: 322)
At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 450)
21:07:21 org. Apache. Coyote. abstractprotocol pause
Information: pausing protocolhandler ["http-bio-8080"]
Hibernate: Select name from server_info
Hibernate: Select clusterinf0 _. ID as id1 _, clusterinf0 _. Name as name1 _ from cluster_info clusterinf0 _
21:07:23 org. Apache. Coyote. abstractprotocol pause
Information: pausing protocolhandler ["http-bio-8443"]
21:07:25 org. Apache. Coyote. abstractprotocol pause
Information: pausing protocolhandler ["ajp-bio-8009"]
2012-6-5 21:07:27 org. Apache. Catalina. Core. standardservice stopinternal
Information: stopping service Catalina
2012-6-5 21:07:27 org. Apache. Catalina. Core. applicationcontext log
Information: Closing spring root webapplicationcontext
2012-6-5 21:07:27 org. Apache. Catalina. loader. webappclassloader clearreferencesjdbc
Severe: the Web application [/glustermg] registered the JDBC driver [Org. apache. derby. JDBC. autoloadeddriver] but failed to unregister it when the web application was stopped. to prevent a memory leak, the JDBC driver has been forcibly unregistered.
2012-6-5 21:07:27 org. Apache. Catalina. loader. webappclassloader checkthreadlocalmapforleaks
Severe: the Web application [/glustermg] created a threadlocal with key of Type [Org. apache. derby. iapi. SQL. dictionary. tabledescriptor $1] (value [Org. apache. derby. iapi. SQL. dictionary. tabledescriptor $1 @ 73abdb5e]) and a value of Type [Java. util. weakhashmap] (value [{}]) but failed to remove it when the web application was stopped. threads are going to be renewed over time to try and avoid a probable memory leak.
21:07:27 org. Apache. Coyote. abstractprotocol stop
Information: Stopping protocolhandler ["http-bio-8080"]
21:07:29 org. Apache. Coyote. abstractprotocol stop
Information: Stopping protocolhandler ["http-bio-8443"]
21:07:31 org. Apache. Coyote. abstractprotocol stop
Information: Stopping protocolhandler ["ajp-bio-8009"]
21:07:33 org. Apache. Coyote. abstractprotocol destroy
Information: Destroying protocolhandler ["http-bio-8080"]
21:07:33 org. Apache. Coyote. abstractprotocol destroy
Information: Destroying protocolhandler ["http-bio-8443"]
21:07:33 org. Apache. Coyote. abstractprotocol destroy
Information: Destroying protocolhandler ["ajp-bio-8009"]
I found a lot of solutions on the Internet and did not solve them. Then I am making a project change error in the future. However, after removing the project from Tomcat and restarting it, I still cannot, internet access is also a new problem with Tomcat 7. After I switch to version 6.0, I still cannot. In the end, I remember that the network settings may be incorrect. My solution is as follows: edit the/etc/hosts file:
Vim/etc/hosts
10.11.2.180 istore01 localhost
10.11.2.201 dev01
10.11.2.202 dev02
~
Check whether the IP address here is the same as the actual IP address. If not, change it to the current IP address. In my case, my IP address is 10.11.2.180, but this file records 192.168.0.180. Now we have found this problem, which is recorded here, so that friends who encounter the same problem can quickly solve the problem. By the way, I have to develop the habit of writing articles in the future. When I help others, I can also get a deeper impression on myself. Although I spent more time, I think it is worth it !! I hope to reply to helpful friends :)