-
Type:
Bug
-
Status: Closed
-
Resolution: No Longer Reproducible
-
Affects Version/s: 6.0.6 GA, 6.2.0 CE M4
-
Fix Version/s: 7.0.0 M3
-
Component/s: Message Boards, ~ [Archived] Collaboration
-
Labels:None
-
Fix Priority:3
We configured a new message board category in the messageboard portlet and set it up to load messages from a mailinglist
One of the messages loaded had apparently an empty attachment causing the following stacktrace
java.lang.NullPointerException at com.liferay.portal.kernel.io.unsync.UnsyncByteArrayInputStream.<init>(UnsyncByteArrayInputStream.java:31) at com.liferay.documentlibrary.util.BaseHook.addFile(BaseHook.java:52) at com.liferay.documentlibrary.util.HookProxyImpl.addFile(HookProxyImpl.java:48) at com.liferay.documentlibrary.util.SafeFileNameHookWrapper.addFile(SafeFileNameHookWrapper.java:66) at com.liferay.documentlibrary.service.impl.DLServiceImpl.addFile(DLServiceImpl.java:75) at sun.reflect.GeneratedMethodAccessor1105.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:82) at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy151.addFile(Unknown Source) at com.liferay.portlet.messageboards.service.impl.MBMessageLocalServiceImpl.addMessage(MBMessageLocalServiceImpl.java:334) at com.liferay.portlet.messageboards.service.impl.MBMessageLocalServiceImpl.addMessage(MBMessageLocalServiceImpl.java:411) at sun.reflect.GeneratedMethodAccessor1003.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:82) at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy134.addMessage(Unknown Source) at com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil.addMessage(MBMessageLocalServiceUtil.java:290)
The problem is that MailingListMessageListener uses MBUtil.collectPartContent to extract attachments to a collection of ObjectValuePair<String, byte[]> and in some cases byte[] will be null causing UnsyncByteArrayInputStream to fail with a NullPointerException