商品修改失败详细信息

商品修改失败详细信息

老师您好,我重新提问了一下,贴上了详细报错信息,麻烦您看下

http://img1.sycdn.imooc.com//climg/5cf37a370001d81217130727.jpg

C:\develop_tools\java\jdk1.8.0_131\bin\java -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\develop_tools\IntelliJ IDEA 2017.3.1\lib\idea_rt.jar=64347:C:\develop_tools\IntelliJ IDEA 2017.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\develop_tools\IntelliJ IDEA 2017.3.1\lib\idea_rt.jar;C:\develop_tools\IntelliJ IDEA 2017.3.1\plugins\junit\lib\junit-rt.jar;C:\develop_tools\IntelliJ IDEA 2017.3.1\plugins\junit\lib\junit5-rt.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\charsets.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\deploy.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\localedata.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\sunec.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\javaws.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\jce.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\jfr.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\jfxswt.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\jsse.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\management-agent.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\plugin.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\resources.jar;C:\develop_tools\java\jdk1.8.0_131\jre\lib\rt.jar;D:\workspace_immoc_idea\o2o\target\test-classes;D:\workspace_immoc_idea\o2o\target\classes;D:\maven-repo\junit\junit\4.12\junit-4.12.jar;D:\maven-repo\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\maven-repo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\maven-repo\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\maven-repo\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\maven-repo\org\springframework\spring-core\4.3.7.RELEASE\spring-core-4.3.7.RELEASE.jar;D:\maven-repo\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\maven-repo\org\springframework\spring-beans\4.3.7.RELEASE\spring-beans-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-context\4.3.7.RELEASE\spring-context-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-aop\4.3.7.RELEASE\spring-aop-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-expression\4.3.7.RELEASE\spring-expression-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-jdbc\4.3.7.RELEASE\spring-jdbc-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-tx\4.3.7.RELEASE\spring-tx-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-web\4.3.7.RELEASE\spring-web-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-webmvc\4.3.7.RELEASE\spring-webmvc-4.3.7.RELEASE.jar;D:\maven-repo\org\springframework\spring-test\4.3.7.RELEASE\spring-test-4.3.7.RELEASE.jar;D:\maven-repo\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;D:\maven-repo\com\fasterxml\jackson\core\jackson-databind\2.8.7\jackson-databind-2.8.7.jar;D:\maven-repo\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;D:\maven-repo\com\fasterxml\jackson\core\jackson-core\2.8.7\jackson-core-2.8.7.jar;D:\maven-repo\commons-collections\commons-collections\3.2\commons-collections-3.2.jar;D:\maven-repo\org\mybatis\mybatis\3.4.2\mybatis-3.4.2.jar;D:\maven-repo\org\mybatis\mybatis-spring\1.3.1\mybatis-spring-1.3.1.jar;D:\maven-repo\mysql\mysql-connector-java\5.1.44\mysql-connector-java-5.1.44.jar;D:\maven-repo\c3p0\c3p0\0.9.1.2\c3p0-0.9.1.2.jar;D:\maven-repo\net\coobird\thumbnailator\0.4.8\thumbnailator-0.4.8.jar;D:\maven-repo\com\github\penggle\kaptcha\2.3.2\kaptcha-2.3.2.jar;D:\maven-repo\com\jhlabs\filters\2.0.235-1\filters-2.0.235-1.jar;D:\maven-repo\commons-fileupload\commons-fileupload\1.3.2\commons-fileupload-1.3.2.jar;D:\maven-repo\commons-io\commons-io\2.2\commons-io-2.2.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.imooc.o2o.service.ProductServiceTest,testModifyProduct

六月 02, 2019 3:25:40 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getDefaultTestExecutionListenerClassNames

信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]

六月 02, 2019 3:25:40 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getTestExecutionListeners

信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@1936f0f5, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@6615435c, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@4909b8da, org.springframework.test.context.support.DirtiesContextTestExecutionListener@3a03464, org.springframework.test.context.transaction.TransactionalTestExecutionListener@2d3fcdbd, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@617c74e5]

六月 02, 2019 3:25:40 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]

六月 02, 2019 3:25:40 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [spring/spring-service.xml]

六月 02, 2019 3:25:40 下午 org.springframework.context.support.GenericApplicationContext prepareRefresh

信息: Refreshing org.springframework.context.support.GenericApplicationContext@29ee9faa: startup date [Sun Jun 02 15:25:40 CST 2019]; root of context hierarchy

六月 02, 2019 3:25:40 下午 com.mchange.v2.log.MLog <clinit>

信息: MLog clients using java 1.4+ standard logging.

六月 02, 2019 3:25:41 下午 com.mchange.v2.c3p0.C3P0Registry banner

信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

六月 02, 2019 3:25:42 下午 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 -> dqx7cda36ejaz11o0f9xk|42a48628, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> dqx7cda36ejaz11o0f9xk|42a48628, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/o2o?useSSL=false&?useUnicode=true&characterEncoding=utf8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 40, 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 ]

2019-06-02 15:25:43.066 [main] DEBUG com.imooc.o2o.dao.ProductDao.queryProductById - ==>  Preparing: SELECT p.product_id, p.product_name, p.product_desc, p.img_addr, p.normal_price, p.promotion_price, p.priority, p.create_time, p.last_edit_time, p.enable_status, # TODO p.point, p.product_category_id, p.shop_id, pm.product_img_id, pm.img_addr AS detail_img, pm.img_desc, pm.priority, pm.create_time FROM tb_product p LEFT JOIN tb_product_img pm ON p.product_id = pm.product_id WHERE p.product_id = ? ORDER BY pm.priority DESC 

2019-06-02 15:25:43.114 [main] DEBUG com.imooc.o2o.dao.ProductDao.queryProductById - ==> Parameters: 1(Long)

2019-06-02 15:25:43.144 [main] DEBUG com.imooc.o2o.dao.ProductDao.queryProductById - <==      Total: 1

2019-06-02 15:25:43.156 [main] DEBUG com.imooc.o2o.util.ImageUtil - current relativeAddr is :\upload\images\item\shop\1\2019060215254357918.jpg

2019-06-02 15:25:43.156 [main] DEBUG com.imooc.o2o.util.ImageUtil - current completeAddr is :D:\apache-tomcat-8.5.40\webapps\Users\baidu\work\image\upload\images\item\shop\1\2019060215254357918.jpg

2019-06-02 15:25:43.345 [main] DEBUG c.imooc.o2o.dao.ProductImgDao.queryProductImgList - ==>  Preparing: SELECT product_img_id, img_addr, img_desc, priority, create_time, product_id FROM tb_product_img WHERE product_id=? ORDER BY product_img_id ASC 

2019-06-02 15:25:43.345 [main] DEBUG c.imooc.o2o.dao.ProductImgDao.queryProductImgList - ==> Parameters: 1(Long)

2019-06-02 15:25:43.346 [main] DEBUG c.imooc.o2o.dao.ProductImgDao.queryProductImgList - <==      Total: 0

2019-06-02 15:25:43.347 [main] DEBUG c.i.o.d.ProductImgDao.deleteProductImgByProductId - ==>  Preparing: DELETE FROM tb_product_img WHERE product_id = ? 

2019-06-02 15:25:43.347 [main] DEBUG c.i.o.d.ProductImgDao.deleteProductImgByProductId - ==> Parameters: 1(Long)

2019-06-02 15:25:43.348 [main] DEBUG c.i.o.d.ProductImgDao.deleteProductImgByProductId - <==    Updates: 0

2019-06-02 15:25:43.349 [main] DEBUG com.imooc.o2o.util.ImageUtil - current relativeAddr is :\upload\images\item\shop\1\2019060215254324684.jpg

2019-06-02 15:25:43.349 [main] DEBUG com.imooc.o2o.util.ImageUtil - current complete addr is :D:\apache-tomcat-8.5.40\webapps\Users\baidu\work\image\upload\images\item\shop\1\2019060215254324684.jpg

2019-06-02 15:25:43.379 [main] DEBUG com.imooc.o2o.util.ImageUtil - current relativeAddr is :\upload\images\item\shop\1\2019060215254315408.jpg

2019-06-02 15:25:43.380 [main] DEBUG com.imooc.o2o.util.ImageUtil - current complete addr is :D:\apache-tomcat-8.5.40\webapps\Users\baidu\work\image\upload\images\item\shop\1\2019060215254315408.jpg

2019-06-02 15:25:43.440 [main] DEBUG c.i.o2o.dao.ProductImgDao.batchInsertProductImg - ==>  Preparing: INSERT INTO tb_product_img(img_addr,img_desc,priority, create_time,product_id) VALUES ( ?, ?, ?, ?, ? ) , ( ?, ?, ?, ?, ? ) 

2019-06-02 15:25:43.443 [main] DEBUG c.i.o2o.dao.ProductImgDao.batchInsertProductImg - ==> Parameters: \upload\images\item\shop\1\2019060215254324684.jpg(String), null, null, 2019-06-02 15:25:43.379(Timestamp), 1(Long), \upload\images\item\shop\1\2019060215254315408.jpg(String), null, null, 2019-06-02 15:25:43.415(Timestamp), 1(Long)

2019-06-02 15:25:43.445 [main] DEBUG c.i.o2o.dao.ProductImgDao.batchInsertProductImg - <==    Updates: 2

2019-06-02 15:25:43.454 [main] DEBUG com.imooc.o2o.dao.ProductDao.updateProduct - ==>  Preparing: UPDATE tb_product SET product_name=?, product_desc=?, img_addr=?, last_edit_time=?, product_category_id=? WHERE product_id = ? AND shop_id=? 

2019-06-02 15:25:43.455 [main] DEBUG com.imooc.o2o.dao.ProductDao.updateProduct - ==> Parameters: 正式的商品1(String), 正式的商品1(String), \upload\images\item\shop\1\2019060215254357918.jpg(String), 2019-06-02 15:25:43.026(Timestamp), 1(Long), 1(Long), 1(Long)

2019-06-02 15:25:43.457 [main] DEBUG com.imooc.o2o.dao.ProductDao.updateProduct - <==    Updates: 0


com.imooc.o2o.exceptions.ProductOperationException: 更新商品信息失败:com.imooc.o2o.exceptions.ProductOperationException: 更新商品信息失败


at com.imooc.o2o.service.impl.ProductServiceImpl.modifyProduct(ProductServiceImpl.java:122)

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.TransactionInterceptor$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.$Proxy26.modifyProduct(Unknown Source)

at com.imooc.o2o.service.ProductServiceTest.testModifyProduct(ProductServiceTest.java:87)

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.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)

at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)

at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)

at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


六月 02, 2019 3:25:43 下午 org.springframework.context.support.GenericApplicationContext doClose

信息: Closing org.springframework.context.support.GenericApplicationContext@29ee9faa: startup date [Sun Jun 02 15:25:40 CST 2019]; root of context hierarchy


Process finished with exit code -1


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学,你好!你把商品修改的sql语句在mysql数据库中执行一下,看看是否有报错。另外,将测试的代码贴出来我试试,在回答中贴代码,不截图。祝学习愉快!

  • 慕丝6586257 提问者 #1
    谢谢老师,解决了。先在数据库测试成功了,然后发现测试代码写错了。
    2019-06-02 16:39:24
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师