码迷,mamicode.com
首页 > Web开发 > 详细

Broadleaf电商平台上传图片出现NullPointerException

时间:2018-10-08 18:11:52      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:context   merge   edm   ref   invoke   jpa   proxy   for   spring   

Broadleaf-5.1.2 + Tomcat7
异常信息如下:

严重: Servlet.service() for servlet [admin] in context with path [/admin] threw exception
java.lang.NullPointerException
    at org.broadleafcommerce.common.audit.AbstractAuditableListener.setAuditData(AbstractAuditableListener.java:88)
    at org.broadleafcommerce.common.audit.AbstractAuditableListener.setAuditCreationData(AbstractAuditableListener.java:71)
    at org.broadleafcommerce.openadmin.audit.AdminAuditableListener.setAuditCreationAndUpdateData(AdminAuditableListener.java:33)
    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 org.hibernate.ejb.event.ListenerCallback.invoke(ListenerCallback.java:48)
    at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:110)
    at org.hibernate.ejb.event.EntityCallbackHandler.preCreate(EntityCallbackHandler.java:79)
    at org.hibernate.ejb.event.EJB3MergeEventListener.saveWithGeneratedId(EJB3MergeEventListener.java:70)
    at org.hibernate.event.internal.DefaultMergeEventListener.saveTransientEntity(DefaultMergeEventListener.java:236)
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:216)
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:154)
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:76)
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:903)
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:887)
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:891)
    at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:889)
    at sun.reflect.GeneratedMethodAccessor394.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:344)
    at com.sun.proxy.$Proxy372.merge(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor394.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

原因:缺少 -javaagent:agents/spring-instrument.jar jvm参数,在tomcat启动时加上上述jvm参数即可,注意spring-instrument.jar 路径。

Broadleaf电商平台上传图片出现NullPointerException

标签:context   merge   edm   ref   invoke   jpa   proxy   for   spring   

原文地址:http://blog.51cto.com/13802307/2295953

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!