GroupLocalServiceUtilクラスのメソッドaddGroupを使用して、Liferayで新しいグループを作成しようとしています。ドキュメントに従ってパラメータタイプを渡しますが、不可解にスローされます。これが私のプレーンコードです:IllegalArgumentException
ServiceContext sc = new ServiceContext();
sc.setScopeGroupId(10);
GroupLocalServiceUtil.addGroup(11101, "com.liferay.portal.model.Group", 0, 0, "aaa","foo", description,
10, null, true, true, sc);
なにが問題ですか?ServiceContextパラメーターをnullに設定できますか?
更新:私が使用しているバージョンは6.1です。例外のスタックトレースは次のとおりです。
Caused by: java.lang.IllegalStateException: Something went wrong:
at com.pro.liferay.startUpHook.ReadGroupFromCsv.addData(ReadGroupFromCsv.java:69)
at com.pro.liferay.startUpHook.CreateUserOnStartUp.run(CreateUserOnStartUp.java:27)
at com.liferay.portal.kernel.events.InvokerSimpleAction.run(InvokerSimpleAction.java:42)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1177)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1239)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initPortalProperties(HookHotDeployListener.java:1595)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:563)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:273)
... 23 more
Caused by: java.lang.IllegalArgumentException
at com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:276)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy23.addGroup(Unknown Source)
at com.liferay.portal.service.GroupLocalServiceUtil.addGroup(GroupLocalServiceUtil.java:300)
at com.pro.liferay.startUpHook.customutils.GroupUtil.addGroup(GroupUtil.java:63)
at com.pro.liferay.startUpHook.customutils.GroupUtil.addGroup(GroupUtil.java:69)
at com.pro.liferay.startUpHook.ReadGroupFromCsv.addData(ReadGroupFromCsv.java:67)
... 30 more