Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Althaf Hussain Shaik
Liferay JUnit Project
13 dicembre 2012 23.04
Risposta

Althaf Hussain Shaik

Punteggio: Junior Member

Messaggi: 61

Data di Iscrizione: 3 maggio 2012

Messaggi recenti

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.
Allegato

Allegati: JUnit-LR.png (129,0k)
Althaf Hussain Shaik
RE: Liferay JUnit Project
14 dicembre 2012 1.19
Risposta

Althaf Hussain Shaik

Punteggio: Junior Member

Messaggi: 61

Data di Iscrizione: 3 maggio 2012

Messaggi recenti

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 dicembre 2012 1.27
Risposta

Althaf Hussain Shaik

Punteggio: Junior Member

Messaggi: 61

Data di Iscrizione: 3 maggio 2012

Messaggi recenti

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 dicembre 2012 1.47
Risposta

Oliver Bayer

Punteggio: Liferay Master

Messaggi: 883

Data di Iscrizione: 18 febbraio 2009

Messaggi recenti

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 gennaio 2013 21.57
Risposta

Kailas Lokhande

Punteggio: New Member

Messaggi: 10

Data di Iscrizione: 6 novembre 2012

Messaggi recenti

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