フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Althaf Hussain Shaik
Liferay JUnit Project
2012/12/13 23:04
答え

Althaf Hussain Shaik

ランク: Junior Member

投稿: 60

参加年月日: 2012/05/03

最近の投稿

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.
画像の固定

添付ファイル: JUnit-LR.png (129.0k)
Althaf Hussain Shaik
RE: Liferay JUnit Project
2012/12/14 1:19
答え

Althaf Hussain Shaik

ランク: Junior Member

投稿: 60

参加年月日: 2012/05/03

最近の投稿

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
2012/12/14 1:27
答え

Althaf Hussain Shaik

ランク: Junior Member

投稿: 60

参加年月日: 2012/05/03

最近の投稿

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
2012/12/14 1:47
答え

Oliver Bayer

ランク: Liferay Master

投稿: 883

参加年月日: 2009/02/18

最近の投稿

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
2013/01/03 21:57
答え

Kailas Lokhande

ランク: New Member

投稿: 10

参加年月日: 2012/11/06

最近の投稿

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