Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Althaf Hussain Shaik
Liferay JUnit Project
13 de diciembre de 2012 23:04
Respuesta

Althaf Hussain Shaik

Ranking: Junior Member

Mensajes: 60

Fecha de incorporación: 3 de mayo de 2012

Mensajes recientes

I am Following the below link to run Liferay Junit Test, Iam getting the foll.exceptions:

http://www.liferay.com/community/wiki/-/wiki/Main/How+to+use+JUnit+to+test+service+in+portlets


1) I am attaching the screen shot for refference in which MyAction.java is missing in this link
2) Any thing we have to write code for impl class which is generated by service builder?

META-INF/portlet-hbm.xml
>>>> configuration hibernate
06:45:05,462 INFO [DialectDetector:71] Determine dialect for MySQL 5
06:45:05,518 INFO [DialectDetector:136] Found dialect org.hibernate.dialect.MySQLDialect
06:45:05,519 INFO [DBFactoryImpl:56] Using dialect null
06:45:05,542 ERROR [DBFactoryImpl:65] java.lang.NullPointerException
java.lang.NullPointerException
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:52)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:27)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:68)
at com.liferay.portal.dao.db.DBFactoryImpl.getDB(DBFactoryImpl.java:59)
at com.liferay.portal.kernel.dao.db.DBFactoryUtil.getDB(DBFactoryUtil.java:25)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.newConfiguration(PortalHibernateConfiguration.java:125)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:65)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
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:192)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:982)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:878)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
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:192)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:161)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:982)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:878)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
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:192)

Regards,
Althaf Hussain.
Adjunto

archivos adjuntos: JUnit-LR.png (129,0k)
Althaf Hussain Shaik
RE: Liferay JUnit Project
14 de diciembre de 2012 1:19
Respuesta

Althaf Hussain Shaik

Ranking: Junior Member

Mensajes: 60

Fecha de incorporación: 3 de mayo de 2012

Mensajes recientes

Hi All,

No body tried JUnit Test so far for Liferay. If so give me some suggestions , i am not able to figure out that exception. Any senior guy help me out for this . Then what is the use of formus.
Althaf Hussain Shaik
RE: Liferay JUnit Project
14 de diciembre de 2012 1:27
Respuesta

Althaf Hussain Shaik

Ranking: Junior Member

Mensajes: 60

Fecha de incorporación: 3 de mayo de 2012

Mensajes recientes

Hi All,

Please atleast go through the exception and give me the suggestion. As it is very urgent and critical for me.
Oliver Bayer
RE: Liferay JUnit Project
14 de diciembre de 2012 1:47
Respuesta

Oliver Bayer

Ranking: Liferay Master

Mensajes: 883

Fecha de incorporación: 18 de febrero de 2009

Mensajes recientes

Hi Althaf,

looking at the following exception I think it's a misconfiguration of the database connection and not directly a problem of your junit test portlet.
Althaf Hussain:

>>>> configuration hibernate
06:45:05,462 INFO [DialectDetector:71] Determine dialect for MySQL 5
06:45:05,518 INFO [DialectDetector:136] Found dialect org.hibernate.dialect.MySQLDialect
06:45:05,519 INFO [DBFactoryImpl:56] Using dialect null
06:45:05,542 ERROR [DBFactoryImpl:65] java.lang.NullPointerException
java.lang.NullPointerException

HTH Oli
Kailas Lokhande
RE: Liferay JUnit Project
3 de enero de 2013 21:57
Respuesta

Kailas Lokhande

Ranking: New Member

Mensajes: 10

Fecha de incorporación: 6 de noviembre de 2012

Mensajes recientes

Extentd your HibernateConfigurationClass with PortalHibernateConfiguration instead of PortletHibernateConfiguration . This will solve your problem.