没有生成缩略图

来源:8-3 商品添加之Service层的实现下

qq_独闭关中_0

2019-09-12

17:20:29.656 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using ‘class org.apache.ibatis.logging.slf4j.Slf4jImpl’ adapter.
17:20:29.749 [main] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VFS
17:20:29.749 [main] DEBUG org.apache.ibatis.io.JBoss6VFS - JBoss 6 VFS API is not available in this environment.
17:20:29.749 [main] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VirtualFile
17:20:29.749 [main] DEBUG org.apache.ibatis.io.VFS - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
17:20:29.749 [main] DEBUG org.apache.ibatis.io.VFS - Using VFS adapter org.apache.ibatis.io.DefaultVFS
17:20:29.749 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Scanned package: ‘com.qsf.entity’ for aliases
17:20:29.780 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed configuration file: 'class path resource [mybatis-config.xml]'
17:20:29.858 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\Users\QSF\eclipse-workspace\bysj\target\classes\mapper\AreaDao.xml]'
17:20:29.890 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\Users\QSF\eclipse-workspace\bysj\target\classes\mapper\ProductCategoryDao.xml]'
17:20:29.937 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\Users\QSF\eclipse-workspace\bysj\target\classes\mapper\ProductDao.xml]'
17:20:29.968 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\Users\QSF\eclipse-workspace\bysj\target\classes\mapper\ProductImgDao.xml]'
17:20:29.968 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\Users\QSF\eclipse-workspace\bysj\target\classes\mapper\ShopCategoryDao.xml]'
17:20:29.999 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\Users\QSF\eclipse-workspace\bysj\target\classes\mapper\ShopDao.xml]'
九月 12, 2019 5:20:30 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
信息: Initializing c3p0 pool… com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 2, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 10000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge329a5a7bq3s9cp08p|42a48628, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge329a5a7bq3s9cp08p|42a48628, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/bysj?useUnicode=true&characterEncoding=utf8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
17:20:30.686 [main] DEBUG com.qsf.bysj.util.ImageUtil - current relativeAddr isupload\item\shop\1\2019091217203053403.jpg
17:20:30.686 [main] DEBUG com.qsf.bysj.util.ImageUtil - current complete addr isC:\Users\QSF\Pictures\upload\item\shop\1\2019091217203053403.jpg
17:20:30.813 [main] ERROR com.qsf.bysj.util.ImageUtil - java.io.FileNotFoundException: Could not find file: C:\Users\QSF\eclipse-workspace\bysj\xiyang.jpg
java.io.FileNotFoundException: Could not find file: C:\Users\QSF\eclipse-workspace\bysj\xiyang.jpg
at net.coobird.thumbnailator.tasks.io.FileImageSource.read(Unknown Source)
at net.coobird.thumbnailator.tasks.SourceSinkThumbnailTask.read(Unknown Source)
at net.coobird.thumbnailator.Thumbnailator.createThumbnail(Unknown Source)
at net.coobird.thumbnailator.Thumbnails$Builder.toFile(Unknown Source)
at com.qsf.bysj.util.ImageUtil.generateThumbnail(ImageUtil.java:66)
at com.qsf.bysj.service.impl.ProductServiceImpl.addThumbnail(ProductServiceImpl.java:111)
at com.qsf.bysj.service.impl.ProductServiceImpl.addProduct(ProductServiceImpl.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor1.proceedWithInvocation(TransactionInterceptor.java:99)atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)atorg.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)atcom.sun.proxy.1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.1.proceedWithInvocation(TransactionInterceptor.java:99)atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)atorg.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)atcom.sun.proxy.Proxy26.addProduct(Unknown Source)
at com.qsf.bysj.service.ProductServiceTest.testAddProduct(ProductServiceTest.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
17:20:30.823 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
17:20:30.823 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06]
17:20:30.839 [main] DEBUG org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@3f57bcad] will be managed by Spring
17:20:30.839 [main] DEBUG com.qsf.bysj.dao.ProductDao.insertProduct - ==> Preparing: INSERT INTO tb_product(product_name,product_desc,img_addr, normal_price,promotion_price,priority,create_time, last_edit_time,enable_status,product_category_id, shop_id) VALUES (?,?,?, ?,?,?,?, ?,?,?, ?)
17:20:30.885 [main] DEBUG com.qsf.bysj.dao.ProductDao.insertProduct - > Parameters: 测试商品1(String), 测试商品1(String), upload\item\shop\1\2019091217203053403.jpg(String), null, null, 20(Integer), 2019-09-12 17:20:30.671(Timestamp), 2019-09-12 17:20:30.671(Timestamp), 1(Integer), 1(Long), 1(Long)
17:20:30.885 [main] DEBUG com.qsf.bysj.dao.ProductDao.insertProduct - < Updates: 1
17:20:30.885 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06]
17:20:30.885 [main] DEBUG com.qsf.bysj.util.ImageUtil - current relativeAddr is :upload\item\shop\1\2019091217203055105.jpg
17:20:30.885 [main] DEBUG com.qsf.bysj.util.ImageUtil - current complete addr is :C:\Users\QSF\Pictures\upload\item\shop\1\2019091217203055105.jpg
17:20:30.995 [main] DEBUG com.qsf.bysj.util.ImageUtil - current relativeAddr is :upload\item\shop\1\2019091217203020789.jpg
17:20:30.995 [main] DEBUG com.qsf.bysj.util.ImageUtil - current complete addr is :C:\Users\QSF\Pictures\upload\item\shop\1\2019091217203020789.jpg
17:20:31.151 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06] from current transaction
17:20:31.167 [main] DEBUG com.qsf.bysj.dao.ProductImgDao.batchInsertProductImg - ==> Preparing: INSERT INTO tb_product_img(img_addr,img_desc,priority, create_time,product_id) VALUES ( ?, ?, ?, ?, ? ) , ( ?, ?, ?, ?, ? )
17:20:31.167 [main] DEBUG com.qsf.bysj.dao.ProductImgDao.batchInsertProductImg - > Parameters: upload\item\shop\1\2019091217203055105.jpg(String), null, null, 2019-09-12 17:20:30.995(Timestamp), 12(Long), upload\item\shop\1\2019091217203020789.jpg(String), null, null, 2019-09-12 17:20:31.151(Timestamp), 12(Long)
17:20:31.182 [main] DEBUG com.qsf.bysj.dao.ProductImgDao.batchInsertProductImg - < Updates: 2
17:20:31.182 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06]
17:20:31.182 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06]
17:20:31.182 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06]
17:20:31.182 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@51133c06]
只生成两张详情图片,缩略图没有生成,但是数据库tb_produc表img_addr有路径了,但是路径没有这个图片,老师,救救我吧!

写回答

1回答

翔仔

2019-09-12

同学好,报的是  Could not find file: C:\Users\QSF\eclipse-workspace\bysj\xiyang.jpg

找不到这个文件呀

0
2
翔仔
回复
qq_独闭关中_0
程序说1是1,不会骗你的,肯定是哪里调用了,我猜同学的水印读取得不对?可以直接给一张水印图片外加它的绝对值路径,而不是用basepath 试试
2019-09-13
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程