1 启动日志报错No suitable driver found for jdbc:mysql
在代码中有
Connection conn = DriverManager.getConnection( "jdbc:mysql://" + ... );
这样的语句,执行失败,需要在这句话之前执行
Class.forName("com.mysql.jdbc.Driver");
2 tomcat启动监听6666端口,谷歌浏览器无法连接,换个端口或者换个浏览器就可以
在一台linux测试机上已经成功的启动了好几个tomcat,然后又启动了一个监听6666端口,怎么都无法访问,关闭iptables防火墙也不行,后来又在运维指导下用setenforce 0
来尝试关闭selinux,也不行。再后来发现这个地址可以telnet,然后才怀疑到是浏览器问题,下面是谷歌浏览器屏蔽的端口,小伙伴们记得以后尽量不要用这些端口提供http服务:
端口 | 服务 |
---|---|
1 | tcpmux |
7 | echo |
9 | discard |
11 | systat |
13 | daytime |
15 | netstat |
17 | qotd |
19 | chargen |
20 | ftp data |
21 | ftp access |
22 | ssh |
23 | telnet |
25 | smtp |
37 | time |
42 | name |
43 | nicname |
53 | domain |
77 | priv-rjs |
79 | finger |
87 | ttylink |
95 | supdup |
101 | hostriame |
102 | iso-tsap |
103 | gppitnp |
104 | acr-nema |
109 | pop2 |
110 | pop3 |
111 | sunrpc |
113 | auth |
115 | sftp |
117 | uucp-path |
119 | nntp |
123 | NTP |
135 | loc-srv /epmap |
139 | netbios |
143 | imap2 |
179 | BGP |
389 | ldap |
465 | smtp+ssl |
512 | print / exec |
513 | login |
514 | shell |
515 | printer |
526 | tempo |
530 | courier |
531 | chat |
532 | netnews |
540 | uucp |
556 | remotefs |
563 | nntp+ssl |
587 | stmp? |
601 | 可靠系统登陆服务 |
636 | ldap+ssl |
993 | ldap+ssl |
995 | pop3+ssl |
2049 | nfs |
3659 | apple-sasl / PasswordServer |
4045 | lockd |
6000 | X11 |
6665 | Alternate IRC [Apple addition] |
6666 | Alternate IRC [Apple addition] |
6667 | Standard IRC [Apple addition] |
6668 | Alternate IRC [Apple addition] |
6669 | Alternate IRC [Apple addition] |
3 tomcat启动80端口报错
报错内容:
org.apache.coyote.http11.Http11NioProtocol init
SEVERE: Error initializing endpoint
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
...
因为linux操作系统对启动监听端口有限制,必须是root权限才能启动。
It’s a fundamental Linux/Unix design choice. All ports below 1024 can only be bound by a process with “root” permissions.
参考
[1] http://blog.csdn.net/teedry/article/details/47006537
[2] http://www.coderanch.com/t/109718/Linux-UNIX/Linux-Tomcat-java-net-BindException