RESTful Web服务使用Mysql测试Netbeans 6.9中的错误

时间:2012-04-01 06:40:26

标签: java mysql web-services netbeans

您好我已经使用mysql在netbeans 6.9中创建了一个RESTful Web服务。我从netbeans:http://netbeans.org/kb/docs/websvc/rest.html

开始学习本教程

但是当我尝试测试服务时,我在浏览器中收到以下错误。任何人都可以帮助解决问题。

提前致谢。

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

2 个答案:

答案 0 :(得分:1)

我认为此链接可能对您有所帮助: http://netbeans-org.1045718.n5.nabble.com/Error-in-allocating-a-connection-Cause-null-td3358722.html

如果您的mysql表的字段名称中包含空格,则会导致此问题。

答案 1 :(得分:1)

谢谢你的回应。不,我在专栏中没有任何空间。问题在于mySQL的Admin Properties。我必须在管理员属性中放置启动服务器的路径,停止服务器等的路径。

有关详细信息,请参阅此链接。 http://netbeans.org/kb/docs/ide/mysql.html

另请注意,如果您使用PhpMyAdmin工具来控制mySQL服务器,那么您需要根据该属性放置Admin Properties。

相关问题