關於ResourceLink導致Tomcat不能啟動的問題

來源:互聯網
上載者:User
在server.xml中配置有Resource:
<Resource  name="jdbc/filexDataSource"
                auth="Container"
                type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
maxActive="50"
maxIdle="5"
maxWait="10000"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://dxxxx:28747/xxxxb"
                 username="hongsoft"       
            password="12345l"/>

http認證中,用md5在資料庫中儲存密碼:
<Realm    className="org.apache.catalina.realm.DataSourceRealm"            
            dataSourceName="jdbc/filexDataSource"
digest="MD5"
            userTable="fx_user"
            userNameCol="username"
            userCredCol="passwdmd5"
            userRoleTable="fx_user"
            roleNameCol="role"    /> 

在context.xml中配置ResourceLink:
<ResourceLink
            name="jdbc/filexDataSource"
            global="jdbc/filexDataSource"
            type="javax.sql.DataSource"/>

上面配置後,tomcat7.0.34有如下規則
1)tomcat啟動就會訪問ResourceLink,防火牆屏蔽情況下,tomcat可以ping 到資料庫伺服器,但是
不能telnet到連接埠時,tomcat的所有應用都不能啟動
2)如上,如果ping不通資料庫伺服器,tomat可以啟動,資料來源不能訪問
3)如果發生1)的情況,tomcat的8005連接埠將不會listen。
4)8005連接埠將會被屏蔽約30分鐘,此後就算沒有配置ResourceLink,8005也不能listen。此時的表現是,
8005沒有被佔用,但是tomcat不能啟動,換為其他連接埠就好。(網上很多貼子說換連接埠,原因可能都是如此)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.