Foros de discusión

Liferay Developer Studio - Context initialization failed

sarath kumar, modificado hace 10 años.

Liferay Developer Studio - Context initialization failed

New Member Mensajes: 4 Fecha de incorporación: 5/11/13 Mensajes recientes
Hi,

I have installed a Liferay Deveoper Studio trail version(Version: 1.6.2).

I had configured with MYSQL and as well tried with the default in memory DB. I'm getting the same error 'Context Initialization Failed' error when i start the tomcat server.

I get the following error: I have also attached the complete error log in a text file.
==================================
Nov 14, 2013 5:06:03 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
17:06:07,853 ERROR [localhost-startStop-1][ContextLoader:227] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.spring.aop.ServiceBeanAutoProxyCreator#0' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'counterTransactionAdvice' while setting bean property 'methodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterTransactionAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'counterTransactionManager' while setting bean property 'platformTransactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterTransactionManager' defined in class path resource [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'counterDataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterDataSource' defined in class path resource [META-INF/counter-spring.xml]: Cannot resolve reference to bean 'counterDataSourceWrapper' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterDataSourceWrapper' defined in class path resource [META-INF/counter-spring.xml]: Cannot resolve reference to bean 'counterDataSourceImpl' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterDataSourceImpl' defined in class path resource [META-INF/counter-spring.xml]: Invocation of init method failed; nested exception is java.lang.ClassNotFoundException:
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:186)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1636)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
=============================================



Please advise, if there is any configuration that is missing?

Thanks & Regards,
Sarath
thumbnail
David H Nebinger, modificado hace 10 años.

RE: Liferay Developer Studio - Context initialization failed

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
It's almost as though you have an empty class name for the datasource. To me, that's the only thing that explains:

Caused by: java.lang.ClassNotFoundException: 
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at com.liferay.portal.dao.jdbc.DataSourceFactoryImpl.testClassForName(DataSourceFactoryImpl.java:364)
	at com.liferay.portal.dao.jdbc.DataSourceFactoryImpl.initDataSource(DataSourceFactoryImpl.java:123)


So it's almost as though you have the following in your portal-ext.properties file:

jdbc.default.driverClassName=
sarath kumar, modificado hace 10 años.

RE: Liferay Developer Studio - Context initialization failed

New Member Mensajes: 4 Fecha de incorporación: 5/11/13 Mensajes recientes
Hi David,

Thanks for the quick reply. I had initially configured to use MYSQL, this file had the required properties, I was facing some issuesemoticon. So I tried to use default database. I had created using the configuration wizard in liferay developer studio and selected to use default database and checked this file, it was empty.
I had added the values for default DB in the file and then tomcat started running.
During the initial configuration of liferay ( localhost:8080), I had selected MYSQL URL and drivers, the tables got created in the MySQL database, the configuration was hung for quiete a while, then have received the following messages on console log.

19:41:54,612 WARN [http-bio-8080-exec-2][BaseDB:453] Specified key was too long; max key length is 767 bytes: create index IX_7020130F on SCProductVersion (directDownloadURL);
19:41:56,193 ERROR [http-bio-8080-exec-2][BaseDB:460] create index IX_7020130F on SCProductVersion (directDownloadURL);
19:47:08,671 WARN [http-bio-8080-exec-2][BaseDB:453] Specified key was too long; max key length is 767 bytes: create index IX_89509087 on User_ (companyId, openId);
19:47:08,672 ERROR [http-bio-8080-exec-2][BaseDB:460] create index IX_89509087 on User_ (companyId, openId);
19:52:16,106 INFO [http-bio-8080-exec-2][BaseDB:481] Database does not support case sensitive queries.


First now I'm going to try setting up with the default DB and see if it works.



Regards,
Sarath
sarath kumar, modificado hace 10 años.

RE: Liferay Developer Studio - Context initialization failed

New Member Mensajes: 4 Fecha de incorporación: 5/11/13 Mensajes recientes
Hi David,

Thanks it is working with default liferay database.

However I would still need to get it working with MYSQL DB. I'm going to try again with MYSQL creating a new schema.

Regards,
Sarath
thumbnail
David H Nebinger, modificado hace 10 años.

RE: Liferay Developer Studio - Context initialization failed

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Depending upon the version of MySQL you have, you may need to update the default mysql.jar in tomcat's lib/ext directory.