Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vipin Bardia
Unable to retrieve data from MySql
December 27, 2012 1:58 PM
Answer

Vipin Bardia

Rank: New Member

Posts: 18

Join Date: February 21, 2012

Recent Posts

Hi Folks,

I am using LR 6.1 with MySql. On my local system it's working perfectly fine as i developed.
I used HQL to fetch data from MySql server and HQL is written in my custom finder.

But when i connect liferay to remote MySql server which is installed on linux, I am unable to fetch data.
There is no exception.

Please let me know what should i do in this case!

Thanks,
Vipin Bardia
Milen Dyankov
RE: Unable to retrieve data from MySql
December 27, 2012 3:37 PM
Answer

Milen Dyankov

LIFERAY STAFF

Rank: Regular Member

Posts: 237

Join Date: October 30, 2012

Recent Posts

Are you absolutely sure both your connection string and DB credentials are correct? Can you access this database with regular MySQL client using the same credentials?
For a quick test try to remove the hsql.jar from <LIFERAY_HOME>/<TOMCAT_VERSION>/lib/ext folder. If after that you see errors during start, it means your mysql settings are incorrect and the portal is falling back to HSQL.
Vipin Bardia
RE: Unable to retrieve data from MySql
December 27, 2012 4:15 PM
Answer

Vipin Bardia

Rank: New Member

Posts: 18

Join Date: February 21, 2012

Recent Posts

Hi Milen,

There is no issue with credentials or connection thing.
My portal is running without any problem. It is my portlet which has this issue.

Please suggest some workaround.

Thanks,
Vipin Bardia
Hitoshi Ozawa
RE: Unable to retrieve data from MySql
December 27, 2012 8:37 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Are you saying you can startup liferay using remote mysql but the portlet you've developed isn't working properly? If so, how did you develop your portlet?
Vipin Bardia
RE: Unable to retrieve data from MySql
December 28, 2012 10:00 AM
Answer

Vipin Bardia

Rank: New Member

Posts: 18

Join Date: February 21, 2012

Recent Posts

Hi Hitoshi,

I developed my portlet while i was working with local sql.
After development i connected it to remote sql.

portlet has a scheduler which stores data periodically in sql server.
I can execute query on remote & verify that data does exists.

But i am not able to fetch data from remote sql!

Regards,
Vipin Bardia
Venkat Koppavolu
RE: Unable to retrieve data from MySql
December 28, 2012 1:51 PM
Answer

Venkat Koppavolu

Rank: Junior Member

Posts: 85

Join Date: July 25, 2010

Recent Posts

HI Vipin,

Can you please provide more information in details to debug..
Enable loggers in portlet scheduler to get some information.

Few Questions...
1. Are you able to connect Remote SQL from your portlet?
2. The Scheduler inside the portlet is storing data in custom tables?
3. Are you able to execute the query on remote for newly created data from Scheduler?
4. Are you getting any cache data inside the portlet?
5. How did you check whether scheduler is storing data into SQL?

Thanks,
Venkat
Vipin Bardia
RE: Unable to retrieve data from MySql
December 28, 2012 1:54 PM
Answer

Vipin Bardia

Rank: New Member

Posts: 18

Join Date: February 21, 2012

Recent Posts

Hi Venkat,

Scheduler had done it's job successfully.

Answers as per your Questions...

1. Are you able to connect Remote SQL from your portlet?
Yes.
2. The Scheduler inside the portlet is storing data in custom tables?
Yes.
3. Are you able to execute the query on remote for newly created data from Scheduler?
Yes,from query browser.
4. Are you getting any cache data inside the portlet?
No.
5. How did you check whether scheduler is storing data into SQL?
I can check it through my query browser, there are thousands of records.

Thanks,
Vipin Bardia
Venkat Koppavolu
RE: Unable to retrieve data from MySql
December 28, 2012 5:19 PM
Answer

Venkat Koppavolu

Rank: Junior Member

Posts: 85

Join Date: July 25, 2010

Recent Posts

Hi Vipin,

Is it possible to give you some background details how you developed portlet.

fine if u can attache sample portlet which your using. That way forum can help you to find out any mistake quickly.

Thanks,
Venkat
Hitoshi Ozawa
RE: Unable to retrieve data from MySql
December 29, 2012 1:36 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Rephrase my question. Are you using Liferay's service builder or are you using hql on your own? How are you trying to get the data? Are there some errors? Are you sure you're selecting some data?
Vipin Bardia
RE: Unable to retrieve data from MySql
December 31, 2012 12:17 AM
Answer

Vipin Bardia

Rank: New Member

Posts: 18

Join Date: February 21, 2012

Recent Posts

Hi Hitoshi,

Yes, i am using Liferay service builder.
When i need to retrieve data, i am using HQL queries which i wrote in my Custom finder.

There are no errors, even everything is working fine if i run the server from my local sql.

Thanks,
Vipin Bardia