环境spring ,hibernate-jpa-2.0,springmvc 上传控件AjaxFileUploaderV2.1
将上传的文件保存到数据库中,sqlserver image类型
要求数据库中必须保存文件,不能是路径。
上传25M左右的时候还没问题,过了28M就开始溢出
异常:java.lang.OutOfMemoryError: Java heap space
at org.hibernate.type.AbstractBynaryType.deepCopyNotNull(AbstractBynaryType.java:173)
at org.hibernate.type.MutableType.deepCopy(MutableType.java:50)
at org.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:432)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:303)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.ejb.event.EJB3MergeEventListener.saveWithGeneratedId(EJB3MergeEventListener.java:62)
at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:313)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:282)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:237)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:859)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:843)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:847)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy23.merge(Unknown Source)
at com.cosco.util.BaseDaoImpl.save(BaseDaoImpl.java:54)
at com.cosco.basedata.dao.AttachmentDaoImpl.save(AttachmentDaoImpl.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
上传文件内存溢出
答案:1 悬赏:50 手机版
解决时间 2021-03-24 16:09
- 提问者网友:我是我
- 2021-03-23 20:35
最佳答案
- 五星知识达人网友:鸽屿
- 2021-03-23 21:44
这个错误看,不象是上传时出的错,倒象是,用hibernate保存时出的错。
at org.hibernate.type.AbstractBynaryType.deepCopyNotNull(AbstractBynaryType.java:173)
at org.hibernate.type.MutableType.deepCopy(MutableType.java:50)
at org.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:432)
at org.hibernate.type.AbstractBynaryType.deepCopyNotNull(AbstractBynaryType.java:173)
at org.hibernate.type.MutableType.deepCopy(MutableType.java:50)
at org.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:432)
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯