2011-05-14 70 views
0

試圖通過RPC服務部署gwt應用程序而不是在fedora中的tomcat上,但是它在登錄時沒有連接到數據庫。雖然在windows中使用tomcat也是如此。我們必須在Fedora中做一些不同的事情嗎?問題僅在於與數據庫連接,因爲在調用RPC服務時,沒有對象返回?部署GWT項目時出現的問題

+0

您是否考慮查看您的數據庫在Fedora上的權限/訪問權限? – 2011-05-14 15:09:19

+0

在部署時RPC有任何問題嗎? – 2011-05-14 15:53:14

+0

不是真的,只是標準的數據庫權限警告。日誌文件說什麼? – 2011-05-14 16:21:55

回答

1

您的JDBC驅動程序是否正常工作?如果沒有,那麼以root身份運行,

百勝安裝的MySQL連接器的Java

也可嘗試用一個簡單的java程序測試。

import java.sql.*; 

public class Connect 
{ 
    public static void main (String[] args) 
    { 
     Connection conn = null; 

     try 
     { 
      String userName = "testuser"; 
      String password = "testpass"; 
      String url = "jdbc:mysql://localhost/test"; 
      Class.forName ("com.mysql.jdbc.Driver").newInstance(); 
      conn = DriverManager.getConnection (url, userName, password); 
      System.out.println ("Database connection established"); 
     } 
     catch (Exception e) 
     { 
      System.err.println ("Cannot connect to database server"); 
     } 
     finally 
     { 
      if (conn != null) 
      { 
       try 
       { 
        conn.close(); 
        System.out.println ("Database connection terminated"); 
       } 
       catch (Exception e) { /* ignore close errors */ } 
      } 
     } 
    } 
}