嗨,我用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
我认为这个链接可能会帮助您:http://netbeans-org.1045718.n5.nabble.com/Error-in-allocating-a-connection-Cause-null-td3358722.html
如果mysql表中的字段名中有空格,则会导致此问题。
感谢您的回复Ji。不,我在专栏里没有任何空间。问题出在mySQL的管理属性上。我不得不把启动服务器的路径、停止服务器的路径等放在管理属性中。
有关详细信息,请参阅此链接。http://netbeans.org/kb/docs/ide/mysql.html
另外请注意,如果您使用PhpMyAdmin类型的工具来控制您的mySQL服务器,那么您需要根据该工具放置Admin属性。