remote stacktrace: Backtrace 异常的解决办法

1、异常提示:

020-06-03 09:58:10,295 INFO [ThreadPoolTaskExecutor-1] org.openqa.selenium.Capabilities (116)- Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()` Starting ChromeDriver 81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776}) on port 36088 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. 2020-06-03 09:58:13,790 ERROR [ThreadPoolTaskExecutor-1] com.artup.pdf.service.generator.PDFGeneratorService (1425)- 创建作品 ID = a239abb7126f463ebc6ae548917dfe18 出错了! org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 81 Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'HAPDAY-DESKTOP', ip: '192.168.126.174', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.2' Driver info: driver.version: ChromeDriver remote stacktrace: Backtrace: Ordinal0 [0x00BC5F73+2449267] Ordinal0 [0x00AF8361+1606497] Ordinal0 [0x009EF969+522601] Ordinal0 [0x009805F3+67059] Ordinal0 [0x0097CD92+52626] Ordinal0 [0x0099C127+180519] Ordinal0 [0x0099BF2D+180013] Ordinal0 [0x00999E5B+171611] Ordinal0 [0x00981DD8+73176] Ordinal0 [0x00982E50+77392] Ordinal0 [0x00982DE9+77289] Ordinal0 [0x00B0D8D7+1693911] GetHandleVerifier [0x00C64036+522726] GetHandleVerifier [0x00C63D74+522020] GetHandleVerifier [0x00C79187+609079] GetHandleVerifier [0x00C648A6+524886] Ordinal0 [0x00B05CBC+1662140] Ordinal0 [0x00B0F23B+1700411] Ordinal0 [0x00B0F3A3+1700771] Ordinal0 [0x00B25215+1790485] BaseThreadInitThunk [0x754E0419+25] RtlGetAppContainerNamedObjectPath [0x771066DD+237] RtlGetAppContainerNamedObjectPath [0x771066AD+189] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62) at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157) at com.artup.pdf.handler.TextEditHandler.DOMToImage(TextEditHandler.java:527) at com.artup.pdf.handler.TextEditHandler.buildTextEdit(TextEditHandler.java:117) at com.artup.pdf.service.generator.PDFGeneratorService.createPDF(PDFGeneratorService.java:261) at com.artup.pdf.service.generator.PDFGeneratorService.createPDF(PDFGeneratorService.java:1423) at com.artup.pdf.service.generator.PDFGeneratorService.createPDFProxy(PDFGeneratorService.java:1292) at com.artup.pdf.service.generator.PDFGeneratorService$$FastClassBySpringCGLIB$$93f4dc27.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

  

2、产生原因:
    Chrome 浏览器的版本和 Chrome 驱动的版本不一致。

  

3、解决办法:
    检查并比对 Chrome 浏览器的版本是否和 Chrome 驱动的版本一致,
    我们可以从 http://npm.taobao.org/mirrors/chromedriver 这里下载需要的 Chrome 驱动。

  

posted @ 2020-06-03 11:42  hapday  阅读(4716)  评论(0编辑  收藏  举报