onesixtyfourth
onesixtyfourth

Reputation: 866

Glassfish 4 no password credential for resource

I have set up a project to use Glassfish 4 with a resource that links back to a MySql database and I am using Eclipse Keplar. I have set up the connection pool with the relevant details and pinging it from the glassfish admin page succeeds. I have an EJB project with JPA set up to access the resource but when access is atempted either in a browser or Eclipse I get a "No database selected" error.

After searching around I found that there are issues with the Url parameter of the pool and renaming that parameter to URL might solve it. the post I found also suggested that I enter the connection string as he suspected that different calls were being made and the string was not getting constructed correctly outside of Glassfish. I did these things but I then get an error "No Password Credential" even though I do have the password entered in the connection string.

Has anyone else encountered this and have any advice as to what the problem is and how I can solve it?

Upvotes: 5

Views: 9158

Answers (4)

dmatej
dmatej

Reputation: 1596

I am using Payara 5.181 and after I changed some properties and clicked flush, it throwed exceptions and ping resulted in this error. After domain restart it works, don't know why.

Upvotes: 0

Konjit W
Konjit W

Reputation: 226

MYSQL and Glassfish. In glassfish 4.0 if "No password credential found" error appears whenever you try to ping, it most probably means, you did not setup password(you gave empty password) when you first installed mysql server on your system, glassfish4.0 has a problem with empty password. Either you need to reset the password or uninstall the mysql server completely, and then re-install, by giving new password. To uninstall the mysql-server completely please flow this link, https://askubuntu.com/questions/640899/how-do-i-uninstall-mysql completely it worked for me.

Upvotes: 0

Skelli
Skelli

Reputation: 283

For me, editing the URL and Url parameters didn't work. However after restarting Glassfish (domain), the problem disappeared.

Upvotes: 2

onesixtyfourth
onesixtyfourth

Reputation: 866

I have figured this out and it was the url value that needed to be set correctly. I didn't need it all but I did need to set the server and database name on it:

jdbc:mysql://localhost:3306/<DB Name Here>

I had changed the parameter name to URL from Url but it turns out that this is not required.I have no idea why this step is required as the values are all there in other parameters and the ping succeeds from the admin pages.

Upvotes: 1

Related Questions