RE: UnsupportedFileFormatException while running test from pom.xml

I am getting this error while running a test from pom.xml:

NoClassDefFoundError: UnsupportedFileFormatException

But the script runs fine when I run the class file directly. What is wrong with it?

This is my pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">



<modelVersion>4.0.0</modelVersion>
  <groupId>FlightBooking</groupId>
  <artifactId>SpiceJet</artifactId>
  <version>0.0.1-SNAPSHOT</version>




<dependencies>

  <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.48.2</version>
  </dependency>

  <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.48.2</version>
  </dependency>

  <dependency>
  <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.6</version>
  </dependency>

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

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.3</version>
  <type>maven-plugin</type>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.13</version>
</dependency>

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

  </dependencies>



<build>
    <pluginManagement>
      <plugins>
      <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>`enter code here`
                <fork>true</fork>
                <executable>C:\Program Files\Java\jdk1.7.0_45\bin\javac.exe</executable>
            </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <`version`>2.19</version>

          <configuration>
          <includes>
          <include>
          `TestScenario1`.java
          </include>
          </includes>
          </configuration>
        </plugin>
      </`plugins`>
    </pluginManagement>
  </build>


I have included following poi jars:

  1. ooxml-schemas-1.1
  2. poi-3.13-20150929
  3. poi-examples-3.13-20150929
  4. poi-excelant-3.13-20150929
  5. poi-ooxml-3.13-20150929
  6. poi-ooxml-schemas-3.13-20150929
  7. poi-scratchpad-3.13-20150929
  8. xmlbeans-2.6.0
still not able to trace what the issue is
pras120687 Default Asked on November 8, 2015 in Selenium WebDriver.
Add Comment
1 Answers

Please copy the pom text again. It seems that it is lost in formatting

Professor Answered on November 9, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.