Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
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
Unable to connect oracle db as external DB in liferay 7.2
khaja moinuddin, 6 Jaren geleden aangepast.
New Member
Berichten: 17
Aanmelddatum: 4-12-15
Recente berichten
I am trying to connect oracle DB as external db i am getting null pointer Exception when the service is called ,as the same configuration working in Liferay DXP
Tried to connect through both the ways application server Server.xml and through portal-ext.properties but didn't work .Appreciate if any one can help on the thread.
After starting the server getting this error message 2020-06-09 07:11:44.451 WARN [Portal Dependency Manager Component Executor--1][ModuleApplicationContext:551] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy] for bean with name 'liferayDataSource' defined in URL [bundleentry://1104.fwk1038002783/META-INF/spring/parent/ext-db-spring.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.assfc.acl.db.service_1.0.0
2020-06-09 07:11:44.782 ERROR [Portal Dependency Manager Component Executor--1][LogService:93] [Portal Dependency Manager Component Executor--1] Invocation of 'start' failed.
java.lang.Exception: Unable to start com.assfc.acl.db.service
at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextRegistrator.start(ModuleApplicationContextRegistrator.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.felix.dm.impl.InvocationUtil.invokeMethod(InvocationUtil.java:157)
at org.apache.felix.dm.impl.InvocationUtil.invokeCallbackMethod(InvocationUtil.java:112)
at org.apache.felix.dm.impl.ComponentImpl.invokeCallbackMethod(ComponentImpl.java:638)
at org.apache.felix.dm.impl.ComponentImpl.invoke(ComponentImpl.java:1783)
at org.apache.felix.dm.impl.ComponentImpl.invokeStart(ComponentImpl.java:1281)
at org.apache.felix.dm.impl.ComponentImpl.performTransition(ComponentImpl.java:1232)
at org.apache.felix.dm.impl.ComponentImpl.handleChange(ComponentImpl.java:1166)
at org.apache.felix.dm.impl.ComponentImpl.lambda$start$2(ComponentImpl.java:502)
at org.apache.felix.dm.impl.DispatchExecutor.runTask(DispatchExecutor.java:182)
at org.apache.felix.dm.impl.DispatchExecutor.run(DispatchExecutor.java:165)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy] for bean with name 'liferayDataSource' defined in URL [bundleentry://1104.fwk1038002783/META-INF/spring/parent/ext-db-spring.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.ejada.atmc.acl.db.service_1.0.0
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1397)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:454)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at com.liferay.portal.spring.aop.AopConfigurableApplicationContextConfigurator$AopBeanFactoryPostProcessor._getPlatformTransactionManager(AopConfigurableApplicationContextConfigurator.java:189)
at com.liferay.portal.spring.aop.AopConfigurableApplicationContextConfigurator$AopBeanFactoryPostProcessor.postProcessBeanFactory(AopConfigurableApplicationContextConfigurator.java:123)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:283)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:128)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextRegistrator.start(ModuleApplicationContextRegistrator.java:89)
... 17 more
Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.ejada.atmc.acl.db.service_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:151)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.liferay.portal.spring.extender.internal.loader.ModuleAggregareClassLoader.loadClass(ModuleAggregareClassLoader.java:116)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:251)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:401)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1444)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1389)
... 29 more
Thanks in advance
Tried to connect through both the ways application server Server.xml and through portal-ext.properties but didn't work .Appreciate if any one can help on the thread.
After starting the server getting this error message 2020-06-09 07:11:44.451 WARN [Portal Dependency Manager Component Executor--1][ModuleApplicationContext:551] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy] for bean with name 'liferayDataSource' defined in URL [bundleentry://1104.fwk1038002783/META-INF/spring/parent/ext-db-spring.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.assfc.acl.db.service_1.0.0
2020-06-09 07:11:44.782 ERROR [Portal Dependency Manager Component Executor--1][LogService:93] [Portal Dependency Manager Component Executor--1] Invocation of 'start' failed.
java.lang.Exception: Unable to start com.assfc.acl.db.service
at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextRegistrator.start(ModuleApplicationContextRegistrator.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.felix.dm.impl.InvocationUtil.invokeMethod(InvocationUtil.java:157)
at org.apache.felix.dm.impl.InvocationUtil.invokeCallbackMethod(InvocationUtil.java:112)
at org.apache.felix.dm.impl.ComponentImpl.invokeCallbackMethod(ComponentImpl.java:638)
at org.apache.felix.dm.impl.ComponentImpl.invoke(ComponentImpl.java:1783)
at org.apache.felix.dm.impl.ComponentImpl.invokeStart(ComponentImpl.java:1281)
at org.apache.felix.dm.impl.ComponentImpl.performTransition(ComponentImpl.java:1232)
at org.apache.felix.dm.impl.ComponentImpl.handleChange(ComponentImpl.java:1166)
at org.apache.felix.dm.impl.ComponentImpl.lambda$start$2(ComponentImpl.java:502)
at org.apache.felix.dm.impl.DispatchExecutor.runTask(DispatchExecutor.java:182)
at org.apache.felix.dm.impl.DispatchExecutor.run(DispatchExecutor.java:165)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy] for bean with name 'liferayDataSource' defined in URL [bundleentry://1104.fwk1038002783/META-INF/spring/parent/ext-db-spring.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.ejada.atmc.acl.db.service_1.0.0
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1397)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:454)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at com.liferay.portal.spring.aop.AopConfigurableApplicationContextConfigurator$AopBeanFactoryPostProcessor._getPlatformTransactionManager(AopConfigurableApplicationContextConfigurator.java:189)
at com.liferay.portal.spring.aop.AopConfigurableApplicationContextConfigurator$AopBeanFactoryPostProcessor.postProcessBeanFactory(AopConfigurableApplicationContextConfigurator.java:123)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:283)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:128)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextRegistrator.start(ModuleApplicationContextRegistrator.java:89)
... 17 more
Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.ejada.atmc.acl.db.service_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:151)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.liferay.portal.spring.extender.internal.loader.ModuleAggregareClassLoader.loadClass(ModuleAggregareClassLoader.java:116)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:251)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:401)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1444)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1389)
... 29 more
Thanks in advance
Christoph Rabel, 6 Jaren geleden aangepast.
Liferay Legend
Berichten: 1555
Aanmelddatum: 24-9-09
Recente berichten
Liferay CE does not support commercial databases.
If you want to use Oracle with Liferay CE, you need to install an extra plugin.
https://github.com/amusarra/liferay-portal-database-all-in-one-support
If you want to use Oracle with Liferay CE, you need to install an extra plugin.
https://github.com/amusarra/liferay-portal-database-all-in-one-support
khaja moinuddin, 6 Jaren geleden aangepast.
New Member
Berichten: 17
Aanmelddatum: 4-12-15
Recente berichten
Hi Christoph
Thanks for your response i am using liferay EE .
Thanks for your response i am using liferay EE .
Christoph Rabel, 6 Jaren geleden aangepast.
Liferay Legend
Berichten: 1555
Aanmelddatum: 24-9-09
Recente berichten
Sorry, I only glanced on your issue and oracle + CE not working is a "classic".
Maybe you run into this issue:
https://issues.liferay.com/browse/LPS-88444?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
Maybe try to add:
Maybe you run into this issue:
https://issues.liferay.com/browse/LPS-88444?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
Maybe try to add:
Import-Package:\
com.liferay.portal.dao.jdbc.spring,\
\
org.springframework.jdbc.datasource,\
\
*to the bnd file.
Olaf Kock, 6 Jaren geleden aangepast.
Liferay Legend
Berichten: 6441
Aanmelddatum: 23-9-08
Recente berichten
khaja moinuddin:
If the additional dependency that Christoph mentions doesn't help: please show your code. This doesn't point at Liferay classes, so nobody here has a clue what you're doing there.
I am trying to connect oracle DB as external db i am getting null pointer Exception when the service is called ,as the same configuration working in Liferay DXP
... cannot be found by com.assfc.acl.db.service_1.0.0
... 17 more
Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy cannot be found by com.ejada.atmc.acl.db.service_1.0.0
khaja moinuddin, 6 Jaren geleden aangepast.
New Member
Berichten: 17
Aanmelddatum: 4-12-15
Recente berichten
Dear Alof
Thanks for you response ,
The additional dependency that Christoph mentioned didn't work for me
As i am trying to connect to oracle as external database during server startup i don't see any error related to external db connection.
I am connecting ext db from application server that is in server.xml .
During deploying the services i am getting the error which is attached (liferay_log)
also i had attached my spring.xml which i had created in the location /META-INF/spring/parent/ext-db-spring.xml
and also server.xml
Thanks & Regards
Thanks for you response ,
The additional dependency that Christoph mentioned didn't work for me
As i am trying to connect to oracle as external database during server startup i don't see any error related to external db connection.
I am connecting ext db from application server that is in server.xml .
During deploying the services i am getting the error which is attached (liferay_log)
also i had attached my spring.xml which i had created in the location /META-INF/spring/parent/ext-db-spring.xml
and also server.xml
Thanks & Regards
Christoph Rabel, 6 Jaren geleden aangepast.
Liferay Legend
Berichten: 1555
Aanmelddatum: 24-9-09
Recente berichten
I checked one of our projects where we have an external datasource (Liferay 7.2) and our spring ext looks pretty much the same. Our datasource is defined in portal-ext, but that shouldn't make a difference for that exception.
Since the LazyConnectionDataSourceProxy class is not found, I still believe that it you have to fix this by adding an import to the bnd file of the service (not the api). Ours looks this way:
Since the LazyConnectionDataSourceProxy class is not found, I still believe that it you have to fix this by adding an import to the bnd file of the service (not the api). Ours looks this way:
Bundle-Name: xxx-external-db-service
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
-dsannotations-options: inherit
Import-Package: \
com.liferay.portal.dao.jdbc.spring,\
\
org.springframework.jdbc.datasource,\
\
*
khaja moinuddin, 6 Jaren geleden aangepast.
New Member
Berichten: 17
Aanmelddatum: 4-12-15
Recente berichten
This is my bnd.bnd
Bundle-Name: DBACL-service
Bundle-SymbolicName: com.ejada.atmc.acl.db.service
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
Import-Package: \
com.liferay.portal.dao.jdbc.spring,\
org.springframework.jdbc.datasource,\
*
Still i am facing the issue ,
Bundle-Name: DBACL-service
Bundle-SymbolicName: com.ejada.atmc.acl.db.service
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
Import-Package: \
com.liferay.portal.dao.jdbc.spring,\
org.springframework.jdbc.datasource,\
*
Still i am facing the issue ,
khaja moinuddin, 6 Jaren geleden aangepast.
New Member
Berichten: 17
Aanmelddatum: 4-12-15
Recente berichten
I have a query if i have two service builder gradle plugins do i need to define ext-db-spring.xml file for bothe the services ?as it will point to same datasource ,
in my current project of Liferay DXP it is only defined in one service builder plugin in another is just entities defined without columns attached is the service.xml which is working fine .Do i need to define datasource for fake entities as in DXP it is not defined .
in my current project of Liferay DXP it is only defined in one service builder plugin in another is just entities defined without columns attached is the service.xml which is working fine .Do i need to define datasource for fake entities as in DXP it is not defined .
Bijlagen:
Community
Company
Feedback