java.lang.IllegalArgumentException

tip

If you're unit testing, you should instantiate only the service and mock the dependencies. If you're testing integration, you should add all the mocking to the configurations file.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Rendering the logo on any page in Confluence relies on the global description existing. If you don't have a global description in your database, trying to access any page will just return a blank page and leave the following error in the logs: {code} 2008-11-17 17:26:49,468 ERROR [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [confluence.util.velocity.VelocityUtils] getRenderedTemplate Error occurred rendering template: /decorators/main.vmd -- url: /confluence/dashboard.action | userName: admin org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getAttachment' in class $Proxy49 threw exception java.lang.IllegalArgumentException: Content entity object should not be null @ /decorators/main.vmd[3,33] at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:286) ... at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194) ... at org.apache.velocity.Template.merge(Template.java:254) at com.atlassian.confluence.util.velocity.VelocityUtils. getRenderedTemplateWithoutSwallowingErrors(VelocityUtils.java:58) at com.atlassian.confluence.util.velocity.VelocityUtils.getRenderedTemplate(VelocityUtils.java:36) at com.atlassian.confluence.util.profiling.ProfilingPageFilter. applyDecoratorUsingVelocity(ProfilingPageFilter.java:133) ... Caused by: java.lang.IllegalArgumentException: Content entity object should not be null at org.springframework.util.Assert.notNull(Assert.java:112) at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao. getLatestVersionsOfAttachments(AbstractHibernateAttachmentDao.java:78) at com.atlassian.confluence.pages.DefaultAttachmentManager. getLatestVersionsOfAttachments(DefaultAttachmentManager.java:63) at com.atlassian.confluence.pages.AbstractAttachmentManager. getAttachment(AbstractAttachmentManager.java:51) at com.atlassian.confluence.pages.AbstractAttachmentManager. getAttachment(AbstractAttachmentManager.java:32) {code}
    via by Matt Ryall,
  • Rendering the logo on any page in Confluence relies on the global description existing. If you don't have a global description in your database, trying to access any page will just return a blank page and leave the following error in the logs: {code} 2008-11-17 17:26:49,468 ERROR [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [confluence.util.velocity.VelocityUtils] getRenderedTemplate Error occurred rendering template: /decorators/main.vmd -- url: /confluence/dashboard.action | userName: admin org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getAttachment' in class $Proxy49 threw exception java.lang.IllegalArgumentException: Content entity object should not be null @ /decorators/main.vmd[3,33] at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:286) ... at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194) ... at org.apache.velocity.Template.merge(Template.java:254) at com.atlassian.confluence.util.velocity.VelocityUtils. getRenderedTemplateWithoutSwallowingErrors(VelocityUtils.java:58) at com.atlassian.confluence.util.velocity.VelocityUtils.getRenderedTemplate(VelocityUtils.java:36) at com.atlassian.confluence.util.profiling.ProfilingPageFilter. applyDecoratorUsingVelocity(ProfilingPageFilter.java:133) ... Caused by: java.lang.IllegalArgumentException: Content entity object should not be null at org.springframework.util.Assert.notNull(Assert.java:112) at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao. getLatestVersionsOfAttachments(AbstractHibernateAttachmentDao.java:78) at com.atlassian.confluence.pages.DefaultAttachmentManager. getLatestVersionsOfAttachments(DefaultAttachmentManager.java:63) at com.atlassian.confluence.pages.AbstractAttachmentManager. getAttachment(AbstractAttachmentManager.java:51) at com.atlassian.confluence.pages.AbstractAttachmentManager. getAttachment(AbstractAttachmentManager.java:32) {code}
    via by Matt Ryall,
  • Spring Boot test class wont inject beans
    via Stack Overflow by rayman
    ,
  • Spring file upload by ajax
    via Stack Overflow by kris14an
    ,
    • java.lang.IllegalArgumentException: Content entity object should not be null at org.springframework.util.Assert.notNull(Assert.java:112)

    Users with the same issue

    osvzs
    2 times, last one,
    odd
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    mauritius
    1 times, last one,
    189 more bugmates