Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Althaf Hussain Shaik
Liferay JUnit Project
13. Dezember 2012 23:04
Antwort

Althaf Hussain Shaik

Rang: Junior Member

Nachrichten: 61

Eintrittsdatum: 3. Mai 2012

Neue Beiträge

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

Anhänge: JUnit-LR.png (129,0k)
Althaf Hussain Shaik
RE: Liferay JUnit Project
14. Dezember 2012 01:19
Antwort

Althaf Hussain Shaik

Rang: Junior Member

Nachrichten: 61

Eintrittsdatum: 3. Mai 2012

Neue Beiträge

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. Dezember 2012 01:27
Antwort

Althaf Hussain Shaik

Rang: Junior Member

Nachrichten: 61

Eintrittsdatum: 3. Mai 2012

Neue Beiträge

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. Dezember 2012 01:47
Antwort

Oliver Bayer

Rang: Liferay Master

Nachrichten: 875

Eintrittsdatum: 18. Februar 2009

Neue Beiträge

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. Januar 2013 21:57
Antwort

Kailas Lokhande

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 6. November 2012

Neue Beiträge

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