Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 7.1 - Not able to connect external database
I have followed steps from blog to connect external database and I am not getting success.
I get following error,
com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not execute query
and in console I get following error,
ERROR [http-nio-8080-exec-13][JDBCExceptionReporter:234] Invalid object name 'TableName'.
I was able to connect with external database in Liferay 7.0 but same thing is not working in Liferay 7.1
Can someone please help to check what is missing.
Thank you in advance.
Nagendra Kumar Busam, modified 7 Years ago.
Liferay Master
Posts: 678
Join Date: 7/7/09
Recent Posts
Can you please attach your service.xml
Hi, I'm facing with the same problem on Liferay 7.2-ga1 following the same blog (https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/connecting-service-builder-to-external-databases) and this example (https://github.com/liferay/liferay-blade-samples/blob/7.2/liferay-workspace/apps/service-builder/jdbc/jdbc-service/src/main/resources/META-INF/spring/module-spring.xml).
Thank you in advance.
I tried to put theSo how can I resolve? Can anyone help me?and theext-spring.xmlin these path:module-spring.xmlIn the case (2) the service builder removes the
src/main/resources/META-INF/spring/parentsrc/main/resources/META-INF/springfilemodule-spring.xmlevery time I activate the "" gradle task.I suspect that the problem is that the service builder version I'm using is ignoring thebuildServicedefined in theextDatasource file.ext-spring.xmlThis suspect is confirmed by the fact that when i debug theof my "setDataSource(DataSource dataSource)" theMyEntityPersistenceImplobject points to the portal default dataSource and not thedataSourceextDatasource.
Furthermore I noticed that the classes generated by the service builder are annotated with @Component and @Reference liferay's annotations. So maybe this causes liferay to completely ignore every .xml spring-bean files.
Thank you in advance.