Mr Weirdo
Mr Weirdo

Reputation: 590

Liferay upload file bug

Is there any quick fix for liferay, to fix upload file bug.During upload I have :

 ERROR [BufferedIncreament-DLFolderLocalService.updateLastPostDate(long,Date)-1][BufferedIncrementRunnable:68] Unable to write buffered increment value to the database
java.lang.NullPointerException
    at java.util.Date.getMillisOf(Date.java:956)
    at java.util.Date.before(Date.java:915)
    at com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl.updateLastPostDate(DLFolderLocalServiceImpl.java:1095)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
    at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.increment.BufferedIncreasableEntry.proceed(BufferedIncreasableEntry.java:48)
    at com.liferay.portal.increment.BufferedIncrementRunnable.run(BufferedIncrementRunnable.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

The only solution I know is reset of DB schema - which could be problematic :( Help!

Upvotes: 2

Views: 618

Answers (2)

Olaf Kock
Olaf Kock

Reputation: 48057

Liferay runs quite a bit of code to make sure that service builder has its context - if your stacktrace isn't shortened, it looks like you're running in a request-independent thread, which might not have servicebuilder initialized correctly (obviously).

Thus it might be that it isn't a bug in Liferay, but you'd need to prepare the environment the same way that Liferay prepares it. I can't exactly point you to the necessary steps, but you might keep that in mind. Also, nothing in the stacktrace points to an "upload bug" IMHO, as you're only touching the last post date

If you omitted parts of the stacktrace, it'd be good to signal that with "..." where you leave out stuff. It doesn't look complete to me. The parts you posted don't really look proper to me.

Upvotes: 0

Tobias Liefke
Tobias Liefke

Reputation: 9022

You should report the issue at issues.liferay.com (unless you find that one already exists) and do either of:

  • Wait until it is fixed.
  • Create an ext plugin and add a check to DLFolderLocalServiceImpl.updateLastPostDate:

    if (dlFolder.getLastPostDate() != null 
            && lastPostDate.before(dlFolder.getLastPostDate())) {
        return;
    }
    
  • Don't use document folders (just put everything into the root)

  • Temporarily fix this for all existing folders by updating the lastPostDate for all document folders in the database while your server is offline (or flush the cache afterwards):

    UPDATE DLFOLDER SET LASTPOSTDATE = NOW() WHERE LASTPOSTDATE IS NULL
    

Upvotes: 1

Related Questions