[ https://issues.apache.org/jira/browse/OFBIZ-5501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13876070#comment-13876070 ]
bill hongs commented on OFBIZ-5501: ----------------------------------- like these: File file = new File(imageServerPath + "/" + productId + "/" + uploadFileName); String imageName = null; imagePath = imageServerPath + "/" + productId + "/" + uploadFileName; file = checkExistsImage(file); if (UtilValidate.isNotEmpty(file)) { imageName = file.getPath(); imageName = imageName.substring(imageName.lastIndexOf("/") + 1); } Change to: File file = new File(imageServerPath + "/" + productId + "/" + uploadFileName); String imageName = null; imagePath = imageServerPath + "/" + productId + "/" + uploadFileName; file = checkExistsImage(file); if (UtilValidate.isNotEmpty(file)) { imageName = file.getPath(); imageName = imageName.substring(imageName.lastIndexOf(File.separator) + 1); } > ImageManagementServices.createContentAndDataResource() method might uses > DataResource.dataResourceName field to store too long names > ------------------------------------------------------------------------------------------------------------------------------------ > > Key: OFBIZ-5501 > URL: https://issues.apache.org/jira/browse/OFBIZ-5501 > Project: OFBiz > Issue Type: Bug > Components: product > Affects Versions: Release Branch 11.04, SVN trunk, Release Branch 12.04, > Release Branch 13.07 > Reporter: Jacques Le Roux > > So you get this kind of errors: > ERROR 22001: A truncation error was encountered trying to shrink VARCHAR > 'D:\projectsASF\ofbizClean\framework\images\webapp\images\pro&' to length 100. > org.apache.derby.iapi.error.StandardException.newException(Unknown Source) -- This message was sent by Atlassian JIRA (v6.1.5#6160)