Error while running the data driven testng program | Selenium Forum
M
Posted on 23/05/2016
Hi,
While running the Test1.java program from Module20, I am getting the following error. I have included the following jars. poi-3.14.jar, poi-ooxml-3.14.jar, poi-ooxml-schemas-3.14.jar, log4j-1.2.17.jar,xmlbeans-2.3.0.jar.
org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
at org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:65)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:601)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:174)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:279)
at com.testing.framework.datadriven.util.Xls_Reader.<init>(Xls_Reader.java:34)
at com.testing.framework.datadriven.suiteA.Test1.test1(Test1.java:11)
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:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:56)
at org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:62)
... 29 more
Caused by: java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setLoadEntityBytesLimit(I)Lorg/apache/xmlbeans/XmlOptions;
at org.apache.poi.POIXMLTypeLoader.<clinit>(POIXMLTypeLoader.java:50)
at org.apache.poi.xssf.model.ThemesTable.<init>(ThemesTable.java:85)
... 35 more

M
Replied on 23/05/2016

download this jar

and try again.

http://www.java2s.com/Code/Jar/x/Downloadxmlbeansxmlpublic240jar.htm


M
Replied on 24/05/2016

i downloaded the jar and included in the build path also. but still getting the same error.
Also, i updated the pom.xml xmlbeans version from 2.3.0 to 2.4.0. But i am getting the error even now.


M
Replied on 24/05/2016

send a screen shot.


M
Replied on 25/05/2016

attached is the screenshot of the error and the pom.xml file.


M
Replied on 25/05/2016

[quote="mishra.aruna":3cawbrz3]i downloaded the jar and included in the build path also. but still getting the same error.
Also, i updated the pom.xml xmlbeans version from 2.3.0 to 2.4.0. But i am getting the error even now.[/quote:3cawbrz3]


when added new file to build path did you delete the last one?


M
Replied on 25/05/2016

yes i have deleted the older version in the build path


M
Replied on 25/05/2016

send your project then i'll try and run


M
Replied on 26/05/2016

PFA my project.


M
Replied on 26/05/2016

some poi files are missing your project is working for me.

download this and try again.

http://www.apache.org/dyn/closer.lua/poi/release/bin/poi-bin-3.14.zip