java.lang.NoSuchMethodError

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

java.lang.NoSuchMethodError

arbnorbqk
Hi,

I am trying to launch a selenium in a java web application. The test methods are in same project with web app, in folder src/test/java.

Here is my code that throws the exception:

@BeforeClass
public static void setUp() throws SQLException, Exception
{
File file = new File(driverPath);
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
webDriver = new ChromeDriver(); //this line is throwing the exception
webDriver.get("https://localhost/myApp/");
}

Exception:
java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;
at org.openqa.selenium.remote.ProtocolHandshake.streamW3CProtocolParameters(ProtocolHandshake.java:284)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:149)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)
at setup.Setup.setUp(Setup.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
Suppressed: java.io.IOException: Incomplete document
at com.google.gson.stream.JsonWriter.close(JsonWriter.java:544)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:167)
... 35 more


p.s. When I launch the selenium test in different project, it works well.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.NoSuchMethodError

⇜Krishnan Mahadevan⇝

How is your CLASSPATH configured ? Can you please let us know that ? You might want to share the relevant build.gradle/pom.xml/build.xml based on the flavor of your build tool.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of <[hidden email]>
Reply-To: <[hidden email]>
Date: Friday, June 9, 2017 at 12:07 PM
To: Selenium Users <[hidden email]>
Subject: [selenium-users] java.lang.NoSuchMethodError

 

Hi,

 

I am trying to launch a selenium in a java web application. The test methods are in same project with web app, in folder src/test/java.

 

Here is my code that throws the exception:

 

@BeforeClass

            public static void setUp() throws SQLException, Exception

            {

                        File file = new File(driverPath);

                        System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

                       

                        webDriver = new ChromeDriver(); //this line is throwing the exception

                        webDriver.get("https://localhost/myApp/");

            }

 

Exception:

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;

            at org.openqa.selenium.remote.ProtocolHandshake.streamW3CProtocolParameters(ProtocolHandshake.java:284)

            at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:149)

            at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

            at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)

            at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)

            at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)

            at setup.Setup.setUp(Setup.java:46)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)

            at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)

            at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)

            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)

            at org.testng.TestRunner.privateRun(TestRunner.java:744)

            at org.testng.TestRunner.run(TestRunner.java:602)

            at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)

            at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)

            at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)

            at org.testng.SuiteRunner.run(SuiteRunner.java:289)

            at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

            at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

            at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)

            at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)

            at org.testng.TestNG.runSuites(TestNG.java:1144)

            at org.testng.TestNG.run(TestNG.java:1115)

            at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)

            at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)

            at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

            Suppressed: java.io.IOException: Incomplete document

                        at com.google.gson.stream.JsonWriter.close(JsonWriter.java:544)

                        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:167)

                        ... 35 more

 

 

p.s. When I launch the selenium test in different project, it works well.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/76B874E3-E657-4E41-9838-99BAAF29E1CE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.NoSuchMethodError

arbnorbqk
Thanks for your reply.

Here is my classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="selenium"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/sqljdbc42.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/gson-2.4.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/client-combined-3.4.0-nodeps.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpclient-4.5.3.jar"/>
<classpathentry kind="con" path="net.sf.jasperreports.JR_CONTAINER"/>
<classpathentry kind="con" path="net.sf.jasperreports.JR_DEPENDENCIES_CONTAINER"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpcore-4.4.6.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/cglib-nodep-3.2.4.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-codec-1.10.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-exec-1.3.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-io-2.5.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-lang3-3.5.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/cssparser-0.9.22.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/guava-21.0.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-2.26.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-core-js-2.26.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-driver-2.26.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpmime-4.5.3.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jetty-io-9.4.1.v20170120.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jetty-util-9.4.1.v20170120.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jna-4.1.0.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jna-platform-4.1.0.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/neko-htmlunit-2.25.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/phantomjsdriver-1.4.0.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/sac-1.3.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/serializer-2.7.2.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-api-9.4.3.v20170317.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-client-9.4.3.v20170317.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-common-9.4.3.v20170317.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xalan-2.7.2.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xercesImpl-2.11.0.jar"/>
<classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xml-apis-1.4.01.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>


On Friday, June 9, 2017 at 8:40:59 AM UTC+2, Krishnan wrote:

How is your CLASSPATH configured ? Can you please let us know that ? You might want to share the relevant build.gradle/pom.xml/build.xml based on the flavor of your build tool.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/

My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

 

From: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="MY-dg4n5AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com> on behalf of <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="MY-dg4n5AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">arbn...@...>
Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="MY-dg4n5AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com>
Date: Friday, June 9, 2017 at 12:07 PM
To: Selenium Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="MY-dg4n5AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com>
Subject: [selenium-users] java.lang.NoSuchMethodError

 

Hi,

 

I am trying to launch a selenium in a java web application. The test methods are in same project with web app, in folder src/test/java.

 

Here is my code that throws the exception:

 

@BeforeClass

            public static void setUp() throws SQLException, Exception

            {

                        File file = new File(driverPath);

                        System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

                       

                        webDriver = new ChromeDriver(); //this line is throwing the exception

                        webDriver.get("<a href="https://localhost/myApp/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Flocalhost%2FmyApp%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEO9T6pMfFrHCNVWSfQEOqEp7_QeA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Flocalhost%2FmyApp%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEO9T6pMfFrHCNVWSfQEOqEp7_QeA&#39;;return true;">https://localhost/myApp/");

            }

 

Exception:

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;

            at org.openqa.selenium.remote.ProtocolHandshake.streamW3CProtocolParameters(ProtocolHandshake.java:284)

            at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:149)

            at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

            at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)

            at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)

            at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)

            at setup.Setup.setUp(Setup.java:46)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)

            at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)

            at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)

            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)

            at org.testng.TestRunner.privateRun(TestRunner.java:744)

            at org.testng.TestRunner.run(TestRunner.java:602)

            at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)

            at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)

            at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)

            at org.testng.SuiteRunner.run(SuiteRunner.java:289)

            at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

            at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

            at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)

            at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)

            at org.testng.TestNG.runSuites(TestNG.java:1144)

            at org.testng.TestNG.run(TestNG.java:1115)

            at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)

            at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)

            at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

            Suppressed: java.io.IOException: Incomplete document

                        at com.google.gson.stream.JsonWriter.close(JsonWriter.java:544)

                        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:167)

                        ... 35 more

 

 

p.s. When I launch the selenium test in different project, it works well.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="MY-dg4n5AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-user...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="MY-dg4n5AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9bc2e5ba-f35f-4973-9c37-f4a5e8ad3ad7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.NoSuchMethodError

⇜Krishnan Mahadevan⇝

How are you building your code ? Is it a maven project or a gradle one ? I was hoping you could share that instead of the classpath file generated by eclipse.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of <[hidden email]>
Reply-To: <[hidden email]>
Date: Friday, June 9, 2017 at 1:17 PM
To: Selenium Users <[hidden email]>
Subject: Re: [selenium-users] java.lang.NoSuchMethodError

 

Thanks for your reply.

 

Here is my classpath:

 

<?xml version="1.0" encoding="UTF-8"?>

<classpath>

            <classpathentry kind="src" path="src/main/java"/>

            <classpathentry kind="src" path="src/test/java"/>

            <classpathentry kind="src" path="selenium"/>

            <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">

                        <attributes>

                                    <attribute name="owner.project.facets" value="java"/>

                        </attributes>

            </classpathentry>

            <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">

                        <attributes>

                                    <attribute name="owner.project.facets" value="jst.web"/>

                        </attributes>

            </classpathentry>

            <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

            <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>

            <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

            <classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>

            <classpathentry kind="lib" path="WebContent/WEB-INF/lib/sqljdbc42.jar"/>

            <classpathentry kind="lib" path="WebContent/WEB-INF/lib/gson-2.4.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/client-combined-3.4.0-nodeps.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpclient-4.5.3.jar"/>

            <classpathentry kind="con" path="net.sf.jasperreports.JR_CONTAINER"/>

            <classpathentry kind="con" path="net.sf.jasperreports.JR_DEPENDENCIES_CONTAINER"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpcore-4.4.6.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/cglib-nodep-3.2.4.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-codec-1.10.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-exec-1.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-io-2.5.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-lang3-3.5.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-logging-1.2.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/cssparser-0.9.22.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/guava-21.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/hamcrest-core-1.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-2.26.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-core-js-2.26.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-driver-2.26.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpmime-4.5.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/javax.servlet-api-3.1.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jetty-io-9.4.1.v20170120.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jetty-util-9.4.1.v20170120.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jna-4.1.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jna-platform-4.1.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/junit-4.12.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/neko-htmlunit-2.25.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/phantomjsdriver-1.4.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/sac-1.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/serializer-2.7.2.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-api-9.4.3.v20170317.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-client-9.4.3.v20170317.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-common-9.4.3.v20170317.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xalan-2.7.2.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xercesImpl-2.11.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xml-apis-1.4.01.jar"/>

            <classpathentry kind="output" path="build/classes"/>

</classpath>

 


On Friday, June 9, 2017 at 8:40:59 AM UTC+2, Krishnan wrote:

How is your CLASSPATH configured ? Can you please let us know that ? You might want to share the relevant build.gradle/pom.xml/build.xml based on the flavor of your build tool.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <<a href="javascript:" target="_blank">seleniu...@...> on behalf of <<a href="javascript:" target="_blank">arbn...@...>
Reply-To: <<a href="javascript:" target="_blank">seleniu...@...>
Date: Friday, June 9, 2017 at 12:07 PM
To: Selenium Users <<a href="javascript:" target="_blank">seleniu...@...>
Subject: [selenium-users] java.lang.NoSuchMethodError

 

Hi,

 

I am trying to launch a selenium in a java web application. The test methods are in same project with web app, in folder src/test/java.

 

Here is my code that throws the exception:

 

@BeforeClass

            public static void setUp() throws SQLException, Exception

            {

                        File file = new File(driverPath);

                        System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

                       

                        webDriver = new ChromeDriver(); //this line is throwing the exception

                        webDriver.get("https://localhost/myApp/");

            }

 

Exception:

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;

            at org.openqa.selenium.remote.ProtocolHandshake.streamW3CProtocolParameters(ProtocolHandshake.java:284)

            at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:149)

            at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

            at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)

            at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)

            at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)

            at setup.Setup.setUp(Setup.java:46)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)

            at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)

            at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)

            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)

            at org.testng.TestRunner.privateRun(TestRunner.java:744)

            at org.testng.TestRunner.run(TestRunner.java:602)

            at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)

            at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)

            at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)

            at org.testng.SuiteRunner.run(SuiteRunner.java:289)

            at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

            at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

            at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)

            at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)

            at org.testng.TestNG.runSuites(TestNG.java:1144)

            at org.testng.TestNG.run(TestNG.java:1115)

            at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)

            at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)

            at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

            Suppressed: java.io.IOException: Incomplete document

                        at com.google.gson.stream.JsonWriter.close(JsonWriter.java:544)

                        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:167)

                        ... 35 more

 

 

p.s. When I launch the selenium test in different project, it works well.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank">selenium-user...@....
To post to this group, send email to <a href="javascript:" target="_blank">seleniu...@....
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9bc2e5ba-f35f-4973-9c37-f4a5e8ad3ad7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/343FC06F-BBAC-4DBD-B021-98793B712354%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.NoSuchMethodError

arbnorbqk
Actually currently I'm not using any building tool.

On Friday, June 9, 2017 at 10:28:18 AM UTC+2, Krishnan wrote:

How are you building your code ? Is it a maven project or a gradle one ? I was hoping you could share that instead of the classpath file generated by eclipse.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/

My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

 

From: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ATmPiGT_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com> on behalf of <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ATmPiGT_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">arbn...@...>
Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ATmPiGT_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com>
Date: Friday, June 9, 2017 at 1:17 PM
To: Selenium Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ATmPiGT_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com>
Subject: Re: [selenium-users] java.lang.NoSuchMethodError

 

Thanks for your reply.

 

Here is my classpath:

 

<?xml version="1.0" encoding="UTF-8"?>

<classpath>

            <classpathentry kind="src" path="src/main/java"/>

            <classpathentry kind="src" path="src/test/java"/>

            <classpathentry kind="src" path="selenium"/>

            <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">

                        <attributes>

                                    <attribute name="owner.project.facets" value="java"/>

                        </attributes>

            </classpathentry>

            <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">

                        <attributes>

                                    <attribute name="owner.project.facets" value="jst.web"/>

                        </attributes>

            </classpathentry>

            <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

            <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>

            <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

            <classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>

            <classpathentry kind="lib" path="WebContent/WEB-INF/lib/sqljdbc42.jar"/>

            <classpathentry kind="lib" path="WebContent/WEB-INF/lib/gson-2.4.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/client-combined-3.4.0-nodeps.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpclient-4.5.3.jar"/>

            <classpathentry kind="con" path="net.sf.jasperreports.JR_CONTAINER"/>

            <classpathentry kind="con" path="net.sf.jasperreports.JR_DEPENDENCIES_CONTAINER"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpcore-4.4.6.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/cglib-nodep-3.2.4.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-codec-1.10.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-exec-1.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-io-2.5.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-lang3-3.5.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/commons-logging-1.2.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/cssparser-0.9.22.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/guava-21.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/hamcrest-core-1.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-2.26.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-core-js-2.26.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/htmlunit-driver-2.26.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/httpmime-4.5.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/javax.servlet-api-3.1.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jetty-io-9.4.1.v20170120.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jetty-util-9.4.1.v20170120.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jna-4.1.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/jna-platform-4.1.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/junit-4.12.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/neko-htmlunit-2.25.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/phantomjsdriver-1.4.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/sac-1.3.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/serializer-2.7.2.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-api-9.4.3.v20170317.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-client-9.4.3.v20170317.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/websocket-common-9.4.3.v20170317.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xalan-2.7.2.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xercesImpl-2.11.0.jar"/>

            <classpathentry kind="lib" path="../selenium-java-3.4.0/lib/xml-apis-1.4.01.jar"/>

            <classpathentry kind="output" path="build/classes"/>

</classpath>

 


On Friday, June 9, 2017 at 8:40:59 AM UTC+2, Krishnan wrote:

How is your CLASSPATH configured ? Can you please let us know that ? You might want to share the relevant build.gradle/pom.xml/build.xml based on the flavor of your build tool.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/

My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of <[hidden email]>
Reply-To: <[hidden email]>
Date: Friday, June 9, 2017 at 12:07 PM
To: Selenium Users <[hidden email]>
Subject: [selenium-users] java.lang.NoSuchMethodError

 

Hi,

 

I am trying to launch a selenium in a java web application. The test methods are in same project with web app, in folder src/test/java.

 

Here is my code that throws the exception:

 

@BeforeClass

            public static void setUp() throws SQLException, Exception

            {

                        File file = new File(driverPath);

                        System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

                       

                        webDriver = new ChromeDriver(); //this line is throwing the exception

                        webDriver.get("<a href="https://localhost/myApp/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Flocalhost%2FmyApp%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEO9T6pMfFrHCNVWSfQEOqEp7_QeA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Flocalhost%2FmyApp%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEO9T6pMfFrHCNVWSfQEOqEp7_QeA&#39;;return true;">https://localhost/myApp/");

            }

 

Exception:

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;

            at org.openqa.selenium.remote.ProtocolHandshake.streamW3CProtocolParameters(ProtocolHandshake.java:284)

            at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:149)

            at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

            at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)

            at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)

            at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)

            at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)

            at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)

            at setup.Setup.setUp(Setup.java:46)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)

            at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)

            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)

            at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)

            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)

            at org.testng.TestRunner.privateRun(TestRunner.java:744)

            at org.testng.TestRunner.run(TestRunner.java:602)

            at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)

            at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)

            at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)

            at org.testng.SuiteRunner.run(SuiteRunner.java:289)

            at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

            at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

            at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)

            at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)

            at org.testng.TestNG.runSuites(TestNG.java:1144)

            at org.testng.TestNG.run(TestNG.java:1115)

            at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)

            at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)

            at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

            Suppressed: java.io.IOException: Incomplete document

                        at com.google.gson.stream.JsonWriter.close(JsonWriter.java:544)

                        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:167)

                        ... 35 more

 

 

p.s. When I launch the selenium test in different project, it works well.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/0dd27450-e3b9-49c7-9cca-78fb421ecab4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ATmPiGT_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-user...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ATmPiGT_AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/9bc2e5ba-f35f-4973-9c37-f4a5e8ad3ad7%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/9bc2e5ba-f35f-4973-9c37-f4a5e8ad3ad7%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/9bc2e5ba-f35f-4973-9c37-f4a5e8ad3ad7%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/9bc2e5ba-f35f-4973-9c37-f4a5e8ad3ad7%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/75c5a2e1-add3-4886-9d53-e7d6bb467354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...