2012-04-01 48 views
0

您好我已經在使用mysql的NetBeans 6.9中創建了一個REST風格的Web服務。我遵循本教程從netbeans:http://netbeans.org/kb/docs/websvc/rest.htmlREST風格的Web服務在Netbeans 6.9中使用Mysql測試錯誤

但是,當我試圖測試服務,我在瀏覽器中得到以下錯誤。任何人都可以請幫助如何解決這個問題。

在此先感謝。

HTTP Status 500 - 

-------------------------------------------------------------------------------- 

type Exception report 

message 

descriptionThe server encountered an internal error() that prevented it from fulfilling this request. 

exception 
javax.servlet.ServletException: javax.persistence.PersistenceException: Exception  [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: null 
Error Code: 0 

root cause 
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException 
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: null 
Error Code: 0 

root cause 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException 
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: null 
Error Code: 0 

root cause 
java.sql.SQLException: Error in allocating a connection. Cause: null 
+0

我有完全相同的問題。 你能看到這個問題: http://stackoverflow.com/questions/10936746/mysql-and-glassfish-error-in-allocating-a-connection 由於我在wamp上使用mysql,我已經給出了管理員屬性中的以下內容: 管理工具的路徑/ URL:http:// localhost/phpmyadmin/ 啓動命令路徑:C:\ wamp \ bin \ mysql \ mysql5.5.24 \ bin \ mysqld.exe 停止命令的路徑:C:\ wamp \ bin \ mysql \ mysql5.5.24 \ bin \ mysqld.exe 參數:-u root stop 它仍然不起作用。你能否提供指針@meraz? 在此先感謝! – JazJ 2012-06-07 22:14:51

回答

1

感謝您的回覆Ji。不,我沒有任何空間。問題在於mySQL的管理員屬性。我必須把路徑啓動服務器,在管理員屬性中停止服務器等路徑。

請參閱此鏈接瞭解更多詳情。 http://netbeans.org/kb/docs/ide/mysql.html

另外請注意,如果您使用的是PhpMyAdmin類工具來控制您的mySQL服務器,那麼您需要根據該屬性設置管理員屬性。