Author Topic: MySQL unable to connect through war file  (Read 5012 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
MySQL unable to connect through war file
« on: July 18, 2020, 11:01:11 AM »
Hi Team,
In MySQL i have created a new user with host name as any host so that i can connect with mysql database remotely also.
With This i am able to successfully connect with remote MySQL which resides in VPS.
But my problem is that when i am deploying a war file in which when my application tries to connect with MySQL it is able to connect with db but not able to fetch the records from the same and gives exception as javax.persistence.NoResultException
Please suggest on configuration side do it need to do anything else so that application can connect and fetch the records

Below mentioned is my error logs.. thanks in advance..


Caused by: javax.persistence.NoResultException: No entity found for query
        at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:286) ~[hibernate-entitymanager-4.1.11.Final.jar:4.1.11.Final]
        at org.broadleafcommerce.profile.core.dao.RoleDaoImpl.readRoleByName(RoleDaoImpl.java:51) ~[broadleaf-profile-5.2.2-GA.jar:na]
        at org.broadleafcommerce.profile.core.dao.RoleDaoImpl$$FastClassBySpringCGLIB$$f1174773.invoke(<generated>) ~[broadleaf-profile-5.2.2-GA.jar:na]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]

Re: MySQL unable to connect through war file
« Reply #1 on: July 18, 2020, 11:42:54 AM »
Opening the same question twice is more likely to annoy, than get a quicker suggestion/answer!  >:(
Your free non-realtime forum support doesn't run full-time nor have a maximum timescale for replies.

Meantime, why not ask on the broadleaf forum, seeing as it uses the relatively obscure/deprecated(?) java framework?

Obvious question: do you run mod_security? Check web logs, apache/nginx/varnish - whatever you use.


Offline
*
Re: MySQL unable to connect through war file
« Reply #2 on: July 18, 2020, 11:54:50 AM »
The intention was not raise the same question again, have found that there is a section for MySQL queries because of that only have raised a question here.
Also i am able to run the application with successfully connecting with mysql db locally, the problem resides in centos CWP environment only
Since it is just an issue of not able to connect/Fetch records in a particular enviornment only

Thanks..

Offline
*
Re: MySQL unable to connect through war file
« Reply #3 on: July 18, 2020, 03:26:12 PM »
Also wanted to add on that i have followed the below links and all changes are there as per the below mentioned link

http://forum.centos-webpanel.com/mysql/mysql-remote-connection/

then also not sure what exactly the issue can be..