上传文件时报错?

问题描述

各位大侠们?麻烦帮我看下可以吗?上传文件时报这个错,谢谢:严重:Servlet.service()forservletactionthrewexceptioncom.mysql.jdbc.MysqlDataTruncation:Datatruncation:Datatoolongforcolumn'filepath'atrow1atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2973)atcom.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)atcom.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1125)atcom.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:677)atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1357)atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1274)atcom.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1259)atorg.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)atorg.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)atorg.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2186)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2666)atorg.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)atorg.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)atorg.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)atorg.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)atorg.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)atorg.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)atorg.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)atorg.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)atorg.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)atorg.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)atorg.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)atorg.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)atorg.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:198)at$Proxy18.persist(UnknownSource)atcom.service.base.DaoSupport.save(DaoSupport.java:40)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)atorg.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)atorg.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)at$Proxy22.save(UnknownSource)atcom.web.action.upfile.UpFileAction.upFile(UpFileAction.java:51)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)atorg.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)atorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:710)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.web.filter.SetCodeFilter.doFilter(SetCodeFilter.java:28)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:619)

解决方案

解决方案二:
提示好像是数据库中没有filepath这个列
解决方案三:
还是其他啥哦呵呵,反正意思就是数据库filepath这个列的问题~
解决方案四:
是不是你的filepath字段长度不够?
解决方案五:
数据库的问题Datatoolongforcolumn'filepath'你的filepath数据长度大于数据库字段可以接受的长度

时间: 2024-10-21 13:13:49

上传文件时报错?的相关文章

spark计算hdfs上的文件时报错

问题描述 spark计算hdfs上的文件时报错 scala> val rdd = sc.textFile("hdfs://...") scala> rdd.count java.lang.VerifyError: class org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$AppendRequestProto overrides final method getUnknownFields.

springmvc-springMVC上传文件报错

问题描述 springMVC上传文件报错 09:13:59,716 ERROR [RequestUtils] Caught error while decoding priorityId. org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUplo

spring mvc-关于Spring mvc 向服务器上传文件报错问题

问题描述 关于Spring mvc 向服务器上传文件报错问题 Spring mvc在向服务器上传的文件的时候报错 显示系统找不到指定的路径,应该要怎么修改 解决方案 大文件上传到服务器报错的问题大文件上传到服务器报错的问题ASP.NET 上传Excel到服务器报错的问题 解决方案二: 错误粘出来看看,可能原因有很多 解决方案三: 代码是这个 @RequestMapping("/updateExcel") public String updateExcel(HttpServletRequ

get-winform使用webclient上传文件报错,是怎么回事???具体如下

问题描述 winform使用webclient上传文件报错,是怎么回事???具体如下 到底是怎么回事??附上服务端代码 protected void Page_Load(object sender, EventArgs e) { // 在此处放置用户代码以初始化页面 foreach (string f in Request.Files.AllKeys) { string hx=Request.QueryString ["picname"]; HttpPostedFile file =

三个思路解决laravel上传文件报错:413 Request Entity Too Large问题

最近一个项目当中,要求上传图片,并且限制图片大小,虽然在laravel当中已经添加了相关的表单验证来阻止文件过大的上传,然而当提交表单时,还没轮到laravel处理,nginx就先报错了.当你仔细看报错页面时,你会发现有nginx版本信息,经过分析,这报错是因为nginx的默认上传文件大小配置client_max_body_size只有2MB, 基于nginx验证比laravel验证要早,想要友好报错而不是直接显示413 Request Entity Too Large,那么就有三个思路去解决.

Hadoop上传文件报错: name node is in safe mode

将本地文件拷贝到hdfs上去,结果上错误:Name node is in safe mode 这是因为在分布式文件系统启动的时候,开始的时候会有安全模式,当分布式文件系统处于安全模式的情况下,文件系统中的内容不允许修改也不允许删除,直到安全模式结束.安全模式主要是为了系统启动的时候检查各个DataNode上数据块的有效性,同时根据策略必要的复制或者删除部分数据块.运行期通过命令也可以进入安全模式.在实践过程中,系统启动的时候去修改和删除文件也会有安全模式不允许修改的出错提示,只需要等待一会儿即可

Spring MVC实现上传文件报错解决方案

报错代码: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:101) o

Rails文件上传file_field报错Encoding::UndefinedConversionError

服务器用的是ubuntu12 64bit,环境是ruby1.9.3+rails3+mysql,测试是在windows2003上. 上传 一个[.gitconfig]文件,没有问题,上传[新浪微博数据挖掘.pdf]报错,上传[back.jpg]报错. 下 面是两段信息,是从[log/production.log]中粘贴出来的.上面一段你是没有问题的日志,下面一段是报错 之后的日志. 01.Started POST "/posts" for 106.3.102.43 at 2012-10-

限制上传文件大小-Springmvc上传文件限制大小,异常处理返回报错信息后,eclipse控制台还报错

问题描述 Springmvc上传文件限制大小,异常处理返回报错信息后,eclipse控制台还报错 1.web.xml配置: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/X