blackRider
blackRider

Reputation: 143

RESTful Web service Testing error in Netbeans 6.9 with Mysql

Hi I have created a RESTful web service in netbeans 6.9 with mysql. I followed this tutorial from netbeans: http://netbeans.org/kb/docs/websvc/rest.html

But when I am trying to test the service I am getting the following error in browser. Can anyone please help how to resolve the issue.

Thanks in advance.

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

Upvotes: 0

Views: 1139

Answers (2)

blackRider
blackRider

Reputation: 143

Thank you for your response Ji. And no, I didn't have any space in the column. The issue is with the Admin Properties for the mySQL. I had to put the Path to start server, path to stop server etc in the Admin Properties.

Please refer to this link for more details. http://netbeans.org/kb/docs/ide/mysql.html

Also please note, if you are using PhpMyAdmin sort of tool to control your mySQL server, then you need to put the Admin Properties according to that.

Upvotes: 1

Ji Zhou
Ji Zhou

Reputation: 421

I think this link may help you : http://netbeans-org.1045718.n5.nabble.com/Error-in-allocating-a-connection-Cause-null-td3358722.html

If your mysql tables have field names that have spaces in them, it will cause this problem.

Upvotes: 1

Related Questions