SocketException on running Maven project. <Module 20> | Selenium Forum
M
Posted on 07/03/2016
Hi

I am getting this socket Exception. There is hardly any code in the project.

Here is the stack trace

java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown Source)
at java.io.ObjectOutputStream.<init>(Unknown Source)
at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
at org.testng.remote.strprotocol.RemoteTestListener.onTestSuccess(RemoteTestListener.java:92)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1899)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1879)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:778)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

I am using Eclipse <Version: Mars Release (4.5.0)>

Testng version form my pom is
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>

JVM version is 1.8

Thanks for the help

Regards

M
Replied on 07/03/2016

socket exception is a very broad error

take a look at this q/a for all the major reason
http://stackoverflow.com/questions/2126607/official-reasons-for-software-caused-connection-abort-socket-write-error


if it is not solved then reply again.


M
Replied on 08/03/2016

hi

Thanks for the replay.

I have seen the stackoverflow page.

The only thing I can think of is the Xls_reader file which we are using.

This file has some file input output operations.

I have had no problems in the past with this file, but now for some reason with this maven project 2 imports are not used.

They are
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;

Just thinking am I missing a dependency in my POM.xml file?

Sorry not able to solve this problem yet.


M
Replied on 08/03/2016

[quote:f5sks7il]2 imports are not used.

They are
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;[/quote:f5sks7il]


what do you mean by not used?


M
Replied on 08/03/2016

I just get a yellow dot near all the imported files.

And the message shown when I go over that is "The import org.apache.poi.hssf.usermodel.HSSFCellStyle is never used"

Please see the attached screenshot.


M
Replied on 08/03/2016

chk your poi api and download xls_reader.java again.


M
Replied on 08/03/2016

Thanks

Have checked POI api and have downloaded xls_reader again.

Problem still remains

Here are the dependencies for POI api's in my POM.xml file

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.7</version>
</dependency>


<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.7</version>
</dependency>


<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>


<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.4.0</version>
</dependency>

Regards


M
Replied on 08/03/2016

Some more additional information if it helps

I am getting Errors in the Error tab they are

[TestNGLaunchConfigurationDelegate] Launching:

[TestNGLaunchShortcut] Examining Java element:[Working copy] Test1.java [in com.qtpselenium.framework.datadriven.suiteA [in src/test/java [in DataDrivenFramework_TestNG]]]
package com.qtpselenium.framework.datadriven.suiteA
import org.testng.annotations.DataProvider
import org.testng.annotations.Test
import com.qtpselenium.framework.datadriven.util.Utility
import com.qtpselenium.framework.datadriven.util.Xls_Reader
class Test1
void test1(String, String, String, String, String)
Object[][] getData()

Also not getting any results in the Testng results tab

Responsive image

M
Replied on 08/03/2016

send a screen shot xls_reader.


M
Replied on 09/03/2016

Thanks

Here is the screenshot of Xls_Reader

Please see the attached screenshot.

Also attached the Java file which I am using from my project

Regards


M
Replied on 09/03/2016

upload your project.


M
Replied on 10/03/2016

Thanks

Uploading the project.

Please see the attached file DataDrivenFramework_TestNG.rar

Thanks again for all your help.

Regards


M
Replied on 11/03/2016

its working for me.

[attachment=0:2cafnc20]Screenshot (59).png[/attachment:2cafnc20]

try this

Go to Eclipse >Help>Eclipse marketPlace> type "TestNg" in search bar then update... then go to Window>Preference>TestNG, and uncheck the "Use Project TestNg jars" >OK.

Responsive image

M
Replied on 11/03/2016

Thanks now it works

This thing did the magic

<<Go to Eclipse >Help>Eclipse marketPlace> type "TestNg" in search bar then update... then go to Window>Preference>TestNG, and uncheck the "Use Project TestNg jars" >OK.>>

So was there something wrong with the configuration of Eclipse and TestNG? Just wanted to know as I know what to do next time it hits me.

Regards


M
Replied on 11/03/2016

there was a version problem with testng