2012-04-01 85 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服务器,那么您需要根据该属性设置管理员属性。