Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

ClassNotFound Exception while using Log4j in maven

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI i am new to maven as well as log4j . I have implemented loggers in my maven application. have set my classpath as well as environmental variables. while running my program using $java -cp target/school-0.0.1-SNAPSHOT.jar nbos.school.App
The following exception is arising

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at nbos.school.App.<clinit>(App.java:9)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger

while i am executing with the following command its working fine

$ mvn exec:java -Dexec.mainClass=nbos.school.App


here is my source code



any one please help me out.
 
Saloon Keeper
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you included log4j as a dependency in your pom.xml?
 
Anudeep Duvvuri
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya have included the dependency in pom.xml
 
Anudeep Duvvuri
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya have included the dependency in pom.xml
 
Ranch Hand
Posts: 275
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please post the code in your pom.xml ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anudeep Duvvuri wrote: while running my program using $java -cp target/school-0.0.1-SNAPSHOT.jar nbos.school.App
The following exception is arising

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at nbos.school.App.<clinit>(App.java:9)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger



The pom.xml won't come into picture if you aren't using Maven command to run that class. Why are you trying to run it outside of the mvn command, when like you say:

while i am executing with the following command its working fine

$ mvn exec:java -Dexec.mainClass=nbos.school.App



If you still want to run it outside of the Maven environment using the java command then your -cp should point to all the library jars that are required by that class at runtime.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the log4j.xml file located on your system? If it's only in the local Maven repository, then you could use something like this (assuming you are running on Linux and are using the default local repository location, and guessing as to which version of log4j you included):

java -cp target/school-0.0.1-SNAPSHOT.jar:~/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar nbos.school.App
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you use

mvn exec:java

the dependencies for that project will be added to the classpath.

However, using

java -cp XXX

XXX will define the classpath for execution.

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Have you included log4j as a dependency in your pom.xml?



I have included dependency like this but same error, please help me
<dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

   <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
       <version>${log4j2.version}</version>
   </dependency>
 
Saloon Keeper
Posts: 13394
296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We can't help you if you don't tell us how you run your program and what error it is showing.
 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:We can't help you if you don't tell us how you run your program and what error it is showing.



Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
       at com.middleoffice.webservices.DriverScript.<clinit>(DriverScript.java:
47)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       ... 1 more
this error is using command java -jar inside-target-jar.jar UAT
I have included above dependencies aswell but I am not able to find the solution
 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ramesh merugu wrote:

Stephan van Hulst wrote:We can't help you if you don't tell us how you run your program and what error it is showing.



Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
       at com.middleoffice.webservices.DriverScript.<clinit>(DriverScript.java:
47)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       ... 1 more
this error is using command java -jar inside-target-jar.jar UAT
I have included above dependencies aswell but I am not able to find the solution.I am using maven pom.xml.Commads are mvn clean install.

 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ramesh merugu wrote:

ramesh merugu wrote:

Stephan van Hulst wrote:We can't help you if you don't tell us how you run your program and what error it is showing.



Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
       at com.middleoffice.webservices.DriverScript.<clinit>(DriverScript.java:
47)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       ... 1 more
this error is using command java -jar inside-target-jar.jar UAT
I have included above dependencies aswell but I am not able to find the solution.I am using maven pom.xml.Commads are mvn clean install.

 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:We can't help you if you don't tell us how you run your program and what error it is showing.



Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
       at com.middleoffice.webservices.DriverScript.<clinit>(DriverScript.java:
47)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       ... 1 more
this error is using command java -jar inside-target-jar.jar UAT
I have included above dependencies aswell but I am not able to find the solution.I am using maven pom.xml.Commads are mvn clean install.
 
Stephan van Hulst
Saloon Keeper
Posts: 13394
296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at Jaikiran Pai's answer from five years ago.
 
Ranch Hand
Posts: 460
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is defined  {log4j2.version}?
 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dana Ucaed wrote:Where is defined  {log4j2.version}?


My jars in lib folder.
log4j.jar
log4j-core-2.9.0.jar
log4j-1.2-api-2.3.jar

I have added dependencies like this
<dependency>
   <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
<dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

   <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

I have ececuted below command aswell mvn exec:java -Dexec.mainClass=com.middleoffice.webservices.DriverScript
added this plugin for this..
<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <version>1.1</version>
 <executions><execution>
   <goals><goal>java</goal></goals>
 </execution></executions>
 <configuration>
   <mainClass>com.middleoffice.webservices.DriverScript</mainClass>
 </configuration>
</plugin>
mojo.JPG
[Thumbnail for mojo.JPG]
before adding the exec pugin this error occured
mojo2.JPG
[Thumbnail for mojo2.JPG]
after adding the exec plugin
 
Stephan van Hulst
Saloon Keeper
Posts: 13394
296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you read the error message and did you do what it suggested?
 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Did you read the error message and did you do what it suggested?




My jars in lib folder.
log4j.jar
log4j-core-2.9.0.jar
log4j-1.2-api-2.3.jar

I have added dependencies like this
<dependency>
   <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
<dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

   <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

some one suggested below command please check above

I have ececuted below command aswell mvn exec:java -Dexec.mainClass=com.middleoffice.webservices.DriverScript
added this plugin for this..
<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <version>1.1</version>
 <executions><execution>
   <goals><goal>java</goal></goals>
 </execution></executions>
 <configuration>
   <mainClass>com.middleoffice.webservices.DriverScript</mainClass>
 </configuration>
</plugin>

I have added and checked but not working
 
Dana Ucaed
Ranch Hand
Posts: 460
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your error message said that you must run maven with the switch - X.

Please read your error.

 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dana Ucaed wrote:Your error message said that you must run maven with the switch - X.

Please read your error.



that is not my main issue
please find below attachment
log4j-error.JPG
[Thumbnail for log4j-error.JPG]
 
Dana Ucaed
Ranch Hand
Posts: 460
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can add the jar file manual to your project.

Sometimes I had the problem with Maven and I gave up the Maven in some situations.

 
Dana Ucaed
Ranch Hand
Posts: 460
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You must learn how to run a jar file with dependencies or put the folder where is situated the log4j-1.2-api-2.3.jar at your classpath.

 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dana Ucaed wrote:You must learn how to run a jar file with dependencies or put the folder where is situated the log4j-1.2-api-2.3.jar at your classpath.



hi this is my pom.xml please check if I have any mistake


<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>com.MOAPITestAutomation1.com</groupId>
 <artifactId>ODHESTest</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 
 <properties>
   <jar_path>${basedir}\lib\</jar_path>
<exec_dir>C:\Users\MO-Automation-APITest-V1-Execution\</exec_dir>
   <output_dir>${basedir}\BUILD\</output_dir>
</properties>
 
 <build>  
<sourceDirectory>src</sourceDirectory>
  <plugins>
<plugin>    
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
     <version>3.0.2</version>
     <configuration>
       <archive>
         <manifest>  
       <addClasspath>true</addClasspath>
     <classpathPrefix>ODHESTestAutomation_lib/</classpathPrefix>
          <mainClass>com.middleoffice.webservices.DriverScript</mainClass>
</manifest>
       </archive>
     </configuration>
   </plugin>
<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.20.1</version>
       </plugin>

<plugin>
 <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
          <executions>
               <execution>
                   <id>auto-clean</id>
                   <phase>clean</phase>
                   <goals>
                       <goal>clean</goal>
                   </goals>
                  <configuration>
                  <filesets>
<fileset>
<directory>BUILD</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
               </execution>
           </executions>
       </plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<!--here the phase you need-->
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${output_dir}</outputDirectory>
<resources>                
<resource>
<directory>${exec_dir}ext</directory>
<targetPath>${output_dir}ext</targetPath>
<filtering>true</filtering>  
</resource>
<resource>
<directory>${exec_dir}InputData</directory>
<targetPath>${output_dir}InputData</targetPath>
<filtering>true</filtering>  
</resource>

<resource>
<directory>${basedir}\target</directory>
<targetPath>${output_dir}TestOutputFiles</targetPath>
<includes>
<include>*.jar</include>
<filtering>true</filtering>  
</includes>
   </resource>

 
<resource>
<directory>${basedir}</directory>
<targetPath>${output_dir}</targetPath>
<includes>
<include>log4j.properties</include>
<filtering>true</filtering>  
</includes>
</resource>

<resource>
<directory>${exec_dir}</directory>
<targetPath>${output_dir}</targetPath>
<includes>
<include>Execute.Bat</include>
<filtering>true</filtering>  
</includes>
</resource>
</resources>              
</configuration>            
         </execution>
 <execution>
<phase>generate-sources</phase>
           <goals>
             <goal>copy-resources</goal>
           </goals>
           <configuration>
<outputDirectory>${output_dir}\ODHESTestAutomation_lib</outputDirectory>
           <resources>          
               <resource>
                 <directory>lib</directory>
                 <filtering>true</filtering>
               </resource>
             </resources>              
           </configuration>            
         </execution>
 </executions>
</plugin>  
<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-install-plugin</artifactId>
         <version>2.5.2</version>
 <executions>
              <execution>
                 <id>install:com.oracle:ojdbc6:11g</id>
                 <phase>test</phase>
                 <goals>
                    <goal>install-file</goal>
                 </goals>
                 <configuration>
                    <file>${jar_path}ojdbc14.jar</file>
                    <groupId>com.oracle</groupId>
                    <artifactId>ojdbc14</artifactId>
                    <version>14</version>
                    <packaging>jar</packaging>                                        
                 </configuration>
              </execution>
           </executions>  
       </plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
  </plugins>
      </build>
   <dependencies>

<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/exec-maven-plugin -->
<dependency>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>exec-maven-plugin</artifactId>
   <version>1.6.0</version>
</dependency>


<dependency>
        <groupId>aopalliance</groupId>
        <artifactId>aopalliance</artifactId>
        <version>1.0</version>    
        </dependency>

<dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>3.4</version>
    </dependency>
<!-- <dependency>
        <groupId>apache-commons-net</groupId>
        <artifactId>apache-commons-net</artifactId>
        <version>1</version>
<scope>system</scope>
<systemPath>${jar_path}apache-commons-net.jar</systemPath>
    </dependency> -->
<!-- https://mvnrepository.com/artifact/com.ibm/com.ibm.mq -->
<dependency>
   <groupId>com.ibm</groupId>
   <artifactId>com.ibm.mq</artifactId>
   <version>1</version>
<scope>system</scope>
<systemPath>${jar_path}com.ibm.mq.jar</systemPath>
</dependency>


       
<dependency>
        <groupId>org.apache.axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
    </dependency>

<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>3.2.4</version>
        </dependency>

        <!-- <dependency>
        <groupId>com.ibm</groupId>
        <artifactId>com.ibm.mq</artifactId>
        <version>5.3.07</version>
        </dependency> -->

        <dependency>
        <groupId>cssparser</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.22</version>
<scope>system</scope>
<systemPath>${jar_path}cssparser-0.9.22.jar</systemPath>
        </dependency>

        <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}dom4j-1.6.jar</systemPath> -->
        </dependency>

<dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.5.3</version>
        </dependency>

<dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.1</version>
        </dependency>
           
  <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
<version>4.5.3</version>
        </dependency>
 
        <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.54</version>
        </dependency>

        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        </dependency>

        <dependency>
        <groupId>org.python</groupId>
        <artifactId>jython</artifactId>
        <version>2.5.0</version>
        </dependency>

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

        <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.9</version>
        </dependency>
 
        <dependency>
<groupId>poi</groupId>
    <artifactId>poi</artifactId>
        <version>3.14</version>
<scope>system</scope>
<systemPath>${jar_path}poi-3.14.jar</systemPath>  
</dependency>

<dependency>
<groupId>poi-3.8-sources</groupId>
<artifactId>poi-3.8-sources</artifactId>
    <version>3.8</version>
<scope>system</scope>
<systemPath>${jar_path}poi-3.8-sources.jar</systemPath>
</dependency>

        <dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml3.14</artifactId>
<version>3.14</version>
<scope>system</scope>
<systemPath>${jar_path}poi-ooxml-3.14.jar</systemPath>
</dependency>  
 
        <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.5-beta5</version>
        </dependency>

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


<!-- https://mvnrepository.com/artifact/xalan/serializer -->
<dependency>
   <groupId>xalan</groupId>
   <artifactId>serializer</artifactId>
   <version>2.7.2</version>
</dependency>




        <dependency>
        <groupId>com.jayway.restassured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>2.3.2</version>
        </dependency>

        <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-api</artifactId>
        <version>3.4.0</version>
        </dependency>

   <dependency>
   <groupId>selenium-java</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-java-3.4.0.jar</systemPath>
   </dependency>
 
   <dependency>
   <groupId>selenium-ie-driver</groupId>
<artifactId>selenium-ie-driver</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-ie-driver-3.4.0.jar</systemPath>
   </dependency>
 
   <dependency>
   <groupId>selenium-support</groupId>
<artifactId>selenium-support</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-support-3.4.0.jar</systemPath>
   </dependency>
 
  <dependency>
   <groupId>selenium-chrome-driver</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-chrome-driver-3.4.0.jar</systemPath>
   </dependency>
 
   <dependency>
   <groupId>selenium-server-standalone</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-server-standalone-3.4.0.jar</systemPath>
   </dependency>  
 
   <dependency>
   <groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>14</version>
   </dependency>  
   
   <!-- <dependency>
   <groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.4</version>
<scope>system</scope>
<systemPath>${jar_path}commons-discovery-0.4.jar</systemPath>
   </dependency>  -->
<!-- https://mvnrepository.com/artifact/commons-discovery/commons-discovery -->
<dependency>
   <groupId>commons-discovery</groupId>
   <artifactId>commons-discovery</artifactId>
   <version>0.4</version>
</dependency>

 
   <dependency>
   <groupId>rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.3.2</version>
<scope>system</scope>
<systemPath>${jar_path}rest-assured-2.3.2.jar</systemPath>
   </dependency>
   <dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.3</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}jackson-databind-2.8.3.jar</systemPath> -->
   </dependency>
 
   <dependency>
   <groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}javax.jms.jar</systemPath>
   </dependency>                  
 
<dependency>
   <groupId>opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.9</version>
<scope>system</scope>
<systemPath>${jar_path}opencsv-3.9.jar</systemPath>
   </dependency>  
   
<dependency>
   <groupId>jira-rest-java-client-core</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
<scope>system</scope>
<systemPath>${jar_path}jira-rest-java-client-core-4.0.0.jar</systemPath>
   </dependency>  
 
   <dependency>
   <groupId>jython</groupId>
<artifactId>jython</artifactId>
<version>2.5.0</version>
<scope>system</scope>
<systemPath>${jar_path}jython-2.5.0.jar</systemPath>
   </dependency>  

<dependency>
   <groupId>confluence</groupId>
<artifactId>confluence</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${jar_path}confluence-1.0.0.jar</systemPath>
   </dependency>    
 
<dependency>
   <groupId>confluence-api</groupId>
<artifactId>confluence-api</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${jar_path}confluence-api-1.0.jar</systemPath>
   </dependency>      
 
<dependency>
   <groupId>com.ibm</groupId>
<artifactId>com.ibm.mqjms</artifactId>
<version>1</version>
       <scope>system</scope>
<systemPath>${jar_path}com.ibm.mqjms.jar</systemPath>
   </dependency>

<dependency>
   <groupId>xmlbeans-2.3.0</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
<scope>system</scope>
<systemPath>${jar_path}xmlbeans-2.3.0.jar</systemPath>
   </dependency>

<dependency>
   <groupId>javax</groupId>
<artifactId>javax</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}javax.jar</systemPath>
   </dependency>  

<!-- <dependency>
   <groupId>jaxrpc-api</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}jaxrpc-api.jar</systemPath>
   </dependency>   -->

  <!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
<dependency>
   <groupId>javax.xml</groupId>
   <artifactId>jaxrpc-api</artifactId>
   <version>1.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
   <groupId>org.apache.poi</groupId>
   <artifactId>poi</artifactId>
   <version>3.14</version>
</dependency>


   <dependency>
   <groupId>javax.resource</groupId>
<artifactId>javax.resource</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}javax.resource.jar</systemPath>
   </dependency>  
 
<dependency>
   <groupId>javax.servlet-api</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>system</scope>
<systemPath>${jar_path}javax.servlet-api-3.1.0.jar</systemPath>
   </dependency>

<dependency>
           <groupId>commons-io</groupId>
           <artifactId>commons-io</artifactId>
           <version>2.5</version>
           <!-- <scope>system</scope>
       <systemPath>${jar_path}commons-io-2.5.jar</systemPath>  -->
           </dependency>

<dependency>
           <groupId>websocket-common</groupId>
           <artifactId>websocket-common</artifactId>
           <version>9.4.3.v20170317</version>
       <scope>system</scope>
       <systemPath>${jar_path}websocket-common-9.4.3.v20170317.jar</systemPath>
           </dependency>

           <dependency>
           <groupId>jetty-http</groupId>
           <artifactId>jetty-http</artifactId>
           <version>9.4.3.v20170317</version>
       <scope>system</scope>
       <systemPath>${jar_path}jetty-http-9.4.3.v20170317.jar</systemPath>
           </dependency>

           <dependency>
           <groupId>wsdl4j</groupId>
           <artifactId>wsdl4j</artifactId>
           <version>1.5.1</version>
      <!--  <scope>system</scope>
       <systemPath>${jar_path}wsdl4j-1.5.1.jar</systemPath> -->
           </dependency>

<dependency>
   <groupId>jetty-io</groupId>
   <artifactId>jetty-io</artifactId>
   <version>9.4.1.v20170120</version>
<scope>system</scope>
<systemPath>${jar_path}jetty-io-9.4.1.v20170120.jar</systemPath>
</dependency>

<dependency>
   <groupId>neko-htmlunit</groupId>
   <artifactId>neko-htmlunit</artifactId>
   <version>2.25</version>
<scope>system</scope>
<systemPath>${jar_path}neko-htmlunit-2.25.jar</systemPath>
</dependency>

<dependency>
   <groupId>tagsoup</groupId>
   <artifactId>tagsoup</artifactId>
   <version>1.2.1</version>
<scope>system</scope>
<systemPath>${jar_path}tagsoup-1.2.1.jar</systemPath>
</dependency>

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-api</artifactId>
   <version>1.7.6</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}slf4j-api-1.7.6.jar</systemPath> -->
</dependency>

<dependency>
   <groupId>websocket-api</groupId>
   <artifactId>websocket-api</artifactId>
   <version>9.4.3.v20170317</version>
<scope>system</scope>
<systemPath>${jar_path}websocket-api-9.4.3.v20170317.jar</systemPath>
</dependency>

<dependency>
   <groupId>websocket-client</groupId>
   <artifactId>websocket-client</artifactId>
   <version>9.4.3.v20170317</version>
<scope>system</scope>
<systemPath>${jar_path}websocket-client-9.4.3.v20170317.jar</systemPath>
</dependency>

<dependency>
   <groupId>stax-api</groupId>
   <artifactId>stax-api</artifactId>
   <version>1.0.1</version>
<scope>system</scope>
<systemPath>${jar_path}stax-api-1.0.1.jar</systemPath>
</dependency>

<dependency>
   <groupId>sac</groupId>
   <artifactId>sac</artifactId>
   <version>1.3</version>
<scope>system</scope>
<systemPath>${jar_path}sac-1.3.jar</systemPath>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-chrome-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-edge-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-firefox-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-ie-driver</artifactId>
   <version>3.4.0</version>
</dependency>

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

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-opera-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-remote-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-safari-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-support</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-log4j12</artifactId>
   <version>1.6.4</version>
   <!-- <scope>test</scope> -->
</dependency>

<dependency>
   <groupId>xalan</groupId>
   <artifactId>xalan</artifactId>
   <version>2.7.2</version>
</dependency>

<dependency>
   <groupId>xerces</groupId>
   <artifactId>xercesImpl</artifactId>
   <version>2.11.0</version>
</dependency>

<dependency>
   <groupId>xml-apis</groupId>
   <artifactId>xml-apis</artifactId>
   <version>1.4.01</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}xml-apis-1.4.01.jar</systemPath> -->
</dependency>



<dependency>
   <groupId>com.atlassian.confluence.plugins</groupId>
   <artifactId>confluence-api</artifactId>
   <version>5.9.1-issue-CONF-38693-m2</version>
   <scope>provided</scope>
</dependency>

<!-- <dependency>
   <groupId>log4j</groupId>
   <artifactId>log4j</artifactId>
   <version>1.2.14</version>
</dependency> -->
<dependency>
   <groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>4</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
<dependency>
   <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
  <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
   <groupId>commons-logging</groupId>
   <artifactId>commons-logging</artifactId>
   <version>1.2</version>
</dependency>
<!--  https://mvnrepository.com/artifact/commons-logging/commons-logging
<dependency>
   <groupId>commons-logging</groupId>
   <artifactId>commons-logging</artifactId>
   <version>1.1.1</version>
</dependency> -->



<dependency>
   <groupId>org.apache.logging.log4j</groupId>
   <artifactId>log4j-api</artifactId>
   <version>2.3</version>
</dependency>

<dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>2.9.0</version>
   </dependency>

   <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
       <version>2.3</version>
   </dependency>    
 
<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-core</artifactId>
   <version>2.8.3</version>
</dependency>    

<dependency>
   <groupId>ch.qos.logback</groupId>
   <artifactId>logback-core</artifactId>
   <version>0.9.29</version>
</dependency>
 
<dependency>
   <groupId>com.google.guava</groupId>
   <artifactId>guava</artifactId>
   <version>21.0</version>
</dependency>
 
<dependency>
   <groupId>javax.inject</groupId>
   <artifactId>javax.inject</artifactId>
   <version>1</version>
</dependency>

<!-- <dependency>
   <groupId>javax.jms</groupId>
   <artifactId>jms</artifactId>
   <version>1.1</version>
</dependency> -->

<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>javax.servlet-api</artifactId>
   <version>3.1.0</version>
</dependency>

<dependency>
   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-http</artifactId>
   <version>9.4.3.v20170317</version>
</dependency>

<dependency>
   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-io</artifactId>
   <version>9.4.1.v20170120</version>
</dependency>

<dependency>
   <groupId>com.atlassian.jira</groupId>
   <artifactId>jira-rest-java-client-core</artifactId>
   <version>4.0.0</version>
</dependency>    
 
<dependency>
   <groupId>com.google.inject</groupId>
   <artifactId>guice</artifactId>
   <version>3.0</version>
</dependency>  

<dependency>
   <groupId>commons-lang3</groupId>
   <artifactId>commons-lang3</artifactId>
   <version>3.5</version>
<scope>system</scope>
<systemPath>${jar_path}commons-lang3-3.5.jar</systemPath>
</dependency>

<dependency>
   <groupId>net.sourceforge.htmlunit</groupId>
   <artifactId>htmlunit-core-js</artifactId>
   <version>2.26</version>
</dependency>

<dependency>
   <groupId>org.codehaus.groovy</groupId>
   <artifactId>groovy-json</artifactId>
   <version>2.3.2</version>
</dependency>

<dependency>
   <groupId>org.codehaus.groovy</groupId>
   <artifactId>groovy-xml</artifactId>
   <version>2.4.4</version>
</dependency>

<dependency>
   <groupId>com.google.code.gson</groupId>
   <artifactId>gson</artifactId>
   <version>2.8.0</version>
</dependency>

<dependency>
   <groupId>net.sourceforge.htmlunit</groupId>
   <artifactId>htmlunit</artifactId>
   <version>2.26</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>htmlunit-driver</artifactId>
   <version>2.26</version>
</dependency>

<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-annotations</artifactId>
   <version>2.8.3</version>
</dependency>

<dependency>
   <groupId>org.apache.commons</groupId>
   <artifactId>commons-exec</artifactId>
   <version>1.3</version>
</dependency>

<dependency>
   <groupId>org.hamcrest</groupId>
   <artifactId>hamcrest-library</artifactId>
   <version>1.3</version>
  <!--  <scope>test</scope> -->
</dependency>

<dependency>
   <groupId>com.codeborne</groupId>
   <artifactId>phantomjsdriver</artifactId>
   <version>1.4.0</version>
</dependency>

<dependency>
   <groupId>javax.transaction</groupId>
   <artifactId>javax.transaction-api</artifactId>
   <version>1.2</version>
</dependency>
  </dependencies>
</project>
 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ramesh merugu wrote:

Dana Ucaed wrote:You must learn how to run a jar file with dependencies or put the folder where is situated the log4j-1.2-api-2.3.jar at your classpath.



hi this is my pom.xml please check if I have done any mistake in 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>com.MOAPITestAutomation1.com</groupId>
 <artifactId>ODHESTest</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 
 <properties>
   <jar_path>${basedir}\lib\</jar_path>
<exec_dir>C:\Users\MO-Automation-APITest-V1-Execution\</exec_dir>
   <output_dir>${basedir}\BUILD\</output_dir>
</properties>
 
 <build>  
<sourceDirectory>src</sourceDirectory>
  <plugins>
<plugin>    
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
     <version>3.0.2</version>
     <configuration>
       <archive>
         <manifest>  
       <addClasspath>true</addClasspath>
     <classpathPrefix>ODHESTestAutomation_lib/</classpathPrefix>
          <mainClass>com.middleoffice.webservices.DriverScript</mainClass>
</manifest>
       </archive>
     </configuration>
   </plugin>
<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.20.1</version>
       </plugin>

<plugin>
 <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
          <executions>
               <execution>
                   <id>auto-clean</id>
                   <phase>clean</phase>
                   <goals>
                       <goal>clean</goal>
                   </goals>
                  <configuration>
                  <filesets>
<fileset>
<directory>BUILD</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
               </execution>
           </executions>
       </plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<!--here the phase you need-->
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${output_dir}</outputDirectory>
<resources>                
<resource>
<directory>${exec_dir}ext</directory>
<targetPath>${output_dir}ext</targetPath>
<filtering>true</filtering>  
</resource>
<resource>
<directory>${exec_dir}InputData</directory>
<targetPath>${output_dir}InputData</targetPath>
<filtering>true</filtering>  
</resource>

<resource>
<directory>${basedir}\target</directory>
<targetPath>${output_dir}TestOutputFiles</targetPath>
<includes>
<include>*.jar</include>
<filtering>true</filtering>  
</includes>
   </resource>

 
<resource>
<directory>${basedir}</directory>
<targetPath>${output_dir}</targetPath>
<includes>
<include>log4j.properties</include>
<filtering>true</filtering>  
</includes>
</resource>

<resource>
<directory>${exec_dir}</directory>
<targetPath>${output_dir}</targetPath>
<includes>
<include>Execute.Bat</include>
<filtering>true</filtering>  
</includes>
</resource>
</resources>              
</configuration>            
         </execution>
 <execution>
<phase>generate-sources</phase>
           <goals>
             <goal>copy-resources</goal>
           </goals>
           <configuration>
<outputDirectory>${output_dir}\ODHESTestAutomation_lib</outputDirectory>
           <resources>          
               <resource>
                 <directory>lib</directory>
                 <filtering>true</filtering>
               </resource>
             </resources>              
           </configuration>            
         </execution>
 </executions>
</plugin>  
<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-install-plugin</artifactId>
         <version>2.5.2</version>
 <executions>
              <execution>
                 <id>install:com.oracle:ojdbc6:11g</id>
                 <phase>test</phase>
                 <goals>
                    <goal>install-file</goal>
                 </goals>
                 <configuration>
                    <file>${jar_path}ojdbc14.jar</file>
                    <groupId>com.oracle</groupId>
                    <artifactId>ojdbc14</artifactId>
                    <version>14</version>
                    <packaging>jar</packaging>                                        
                 </configuration>
              </execution>
           </executions>  
       </plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
  </plugins>
      </build>
   <dependencies>

<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/exec-maven-plugin -->
<dependency>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>exec-maven-plugin</artifactId>
   <version>1.6.0</version>
</dependency>


<dependency>
        <groupId>aopalliance</groupId>
        <artifactId>aopalliance</artifactId>
        <version>1.0</version>    
        </dependency>

<dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>3.4</version>
    </dependency>
<!-- <dependency>
        <groupId>apache-commons-net</groupId>
        <artifactId>apache-commons-net</artifactId>
        <version>1</version>
<scope>system</scope>
<systemPath>${jar_path}apache-commons-net.jar</systemPath>
    </dependency> -->
<!-- https://mvnrepository.com/artifact/com.ibm/com.ibm.mq -->
<dependency>
   <groupId>com.ibm</groupId>
   <artifactId>com.ibm.mq</artifactId>
   <version>1</version>
<scope>system</scope>
<systemPath>${jar_path}com.ibm.mq.jar</systemPath>
</dependency>


       
<dependency>
        <groupId>org.apache.axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
    </dependency>

<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>3.2.4</version>
        </dependency>

        <!-- <dependency>
        <groupId>com.ibm</groupId>
        <artifactId>com.ibm.mq</artifactId>
        <version>5.3.07</version>
        </dependency> -->

        <dependency>
        <groupId>cssparser</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.22</version>
<scope>system</scope>
<systemPath>${jar_path}cssparser-0.9.22.jar</systemPath>
        </dependency>

        <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}dom4j-1.6.jar</systemPath> -->
        </dependency>

<dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.5.3</version>
        </dependency>

<dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.1</version>
        </dependency>
           
  <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
<version>4.5.3</version>
        </dependency>
 
        <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.54</version>
        </dependency>

        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        </dependency>

        <dependency>
        <groupId>org.python</groupId>
        <artifactId>jython</artifactId>
        <version>2.5.0</version>
        </dependency>

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

        <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.9</version>
        </dependency>
 
        <dependency>
<groupId>poi</groupId>
    <artifactId>poi</artifactId>
        <version>3.14</version>
<scope>system</scope>
<systemPath>${jar_path}poi-3.14.jar</systemPath>  
</dependency>

<dependency>
<groupId>poi-3.8-sources</groupId>
<artifactId>poi-3.8-sources</artifactId>
    <version>3.8</version>
<scope>system</scope>
<systemPath>${jar_path}poi-3.8-sources.jar</systemPath>
</dependency>

        <dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml3.14</artifactId>
<version>3.14</version>
<scope>system</scope>
<systemPath>${jar_path}poi-ooxml-3.14.jar</systemPath>
</dependency>  
 
        <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.5-beta5</version>
        </dependency>

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


<!-- https://mvnrepository.com/artifact/xalan/serializer -->
<dependency>
   <groupId>xalan</groupId>
   <artifactId>serializer</artifactId>
   <version>2.7.2</version>
</dependency>




        <dependency>
        <groupId>com.jayway.restassured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>2.3.2</version>
        </dependency>

        <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-api</artifactId>
        <version>3.4.0</version>
        </dependency>

   <dependency>
   <groupId>selenium-java</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-java-3.4.0.jar</systemPath>
   </dependency>
 
   <dependency>
   <groupId>selenium-ie-driver</groupId>
<artifactId>selenium-ie-driver</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-ie-driver-3.4.0.jar</systemPath>
   </dependency>
 
   <dependency>
   <groupId>selenium-support</groupId>
<artifactId>selenium-support</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-support-3.4.0.jar</systemPath>
   </dependency>
 
  <dependency>
   <groupId>selenium-chrome-driver</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-chrome-driver-3.4.0.jar</systemPath>
   </dependency>
 
   <dependency>
   <groupId>selenium-server-standalone</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>3.4.0</version>
<scope>system</scope>
<systemPath>${jar_path}selenium-server-standalone-3.4.0.jar</systemPath>
   </dependency>  
 
   <dependency>
   <groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>14</version>
   </dependency>  
   
   <!-- <dependency>
   <groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.4</version>
<scope>system</scope>
<systemPath>${jar_path}commons-discovery-0.4.jar</systemPath>
   </dependency>  -->
<!-- https://mvnrepository.com/artifact/commons-discovery/commons-discovery -->
<dependency>
   <groupId>commons-discovery</groupId>
   <artifactId>commons-discovery</artifactId>
   <version>0.4</version>
</dependency>

 
   <dependency>
   <groupId>rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.3.2</version>
<scope>system</scope>
<systemPath>${jar_path}rest-assured-2.3.2.jar</systemPath>
   </dependency>
   <dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.3</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}jackson-databind-2.8.3.jar</systemPath> -->
   </dependency>
 
   <dependency>
   <groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}javax.jms.jar</systemPath>
   </dependency>                  
 
<dependency>
   <groupId>opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.9</version>
<scope>system</scope>
<systemPath>${jar_path}opencsv-3.9.jar</systemPath>
   </dependency>  
   
<dependency>
   <groupId>jira-rest-java-client-core</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
<scope>system</scope>
<systemPath>${jar_path}jira-rest-java-client-core-4.0.0.jar</systemPath>
   </dependency>  
 
   <dependency>
   <groupId>jython</groupId>
<artifactId>jython</artifactId>
<version>2.5.0</version>
<scope>system</scope>
<systemPath>${jar_path}jython-2.5.0.jar</systemPath>
   </dependency>  

<dependency>
   <groupId>confluence</groupId>
<artifactId>confluence</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${jar_path}confluence-1.0.0.jar</systemPath>
   </dependency>    
 
<dependency>
   <groupId>confluence-api</groupId>
<artifactId>confluence-api</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${jar_path}confluence-api-1.0.jar</systemPath>
   </dependency>      
 
<dependency>
   <groupId>com.ibm</groupId>
<artifactId>com.ibm.mqjms</artifactId>
<version>1</version>
       <scope>system</scope>
<systemPath>${jar_path}com.ibm.mqjms.jar</systemPath>
   </dependency>

<dependency>
   <groupId>xmlbeans-2.3.0</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
<scope>system</scope>
<systemPath>${jar_path}xmlbeans-2.3.0.jar</systemPath>
   </dependency>

<dependency>
   <groupId>javax</groupId>
<artifactId>javax</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}javax.jar</systemPath>
   </dependency>  

<!-- <dependency>
   <groupId>jaxrpc-api</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}jaxrpc-api.jar</systemPath>
   </dependency>   -->

  <!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
<dependency>
   <groupId>javax.xml</groupId>
   <artifactId>jaxrpc-api</artifactId>
   <version>1.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
   <groupId>org.apache.poi</groupId>
   <artifactId>poi</artifactId>
   <version>3.14</version>
</dependency>


   <dependency>
   <groupId>javax.resource</groupId>
<artifactId>javax.resource</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${jar_path}javax.resource.jar</systemPath>
   </dependency>  
 
<dependency>
   <groupId>javax.servlet-api</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>system</scope>
<systemPath>${jar_path}javax.servlet-api-3.1.0.jar</systemPath>
   </dependency>

<dependency>
           <groupId>commons-io</groupId>
           <artifactId>commons-io</artifactId>
           <version>2.5</version>
           <!-- <scope>system</scope>
       <systemPath>${jar_path}commons-io-2.5.jar</systemPath>  -->
           </dependency>

<dependency>
           <groupId>websocket-common</groupId>
           <artifactId>websocket-common</artifactId>
           <version>9.4.3.v20170317</version>
       <scope>system</scope>
       <systemPath>${jar_path}websocket-common-9.4.3.v20170317.jar</systemPath>
           </dependency>

           <dependency>
           <groupId>jetty-http</groupId>
           <artifactId>jetty-http</artifactId>
           <version>9.4.3.v20170317</version>
       <scope>system</scope>
       <systemPath>${jar_path}jetty-http-9.4.3.v20170317.jar</systemPath>
           </dependency>

           <dependency>
           <groupId>wsdl4j</groupId>
           <artifactId>wsdl4j</artifactId>
           <version>1.5.1</version>
      <!--  <scope>system</scope>
       <systemPath>${jar_path}wsdl4j-1.5.1.jar</systemPath> -->
           </dependency>

<dependency>
   <groupId>jetty-io</groupId>
   <artifactId>jetty-io</artifactId>
   <version>9.4.1.v20170120</version>
<scope>system</scope>
<systemPath>${jar_path}jetty-io-9.4.1.v20170120.jar</systemPath>
</dependency>

<dependency>
   <groupId>neko-htmlunit</groupId>
   <artifactId>neko-htmlunit</artifactId>
   <version>2.25</version>
<scope>system</scope>
<systemPath>${jar_path}neko-htmlunit-2.25.jar</systemPath>
</dependency>

<dependency>
   <groupId>tagsoup</groupId>
   <artifactId>tagsoup</artifactId>
   <version>1.2.1</version>
<scope>system</scope>
<systemPath>${jar_path}tagsoup-1.2.1.jar</systemPath>
</dependency>

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-api</artifactId>
   <version>1.7.6</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}slf4j-api-1.7.6.jar</systemPath> -->
</dependency>

<dependency>
   <groupId>websocket-api</groupId>
   <artifactId>websocket-api</artifactId>
   <version>9.4.3.v20170317</version>
<scope>system</scope>
<systemPath>${jar_path}websocket-api-9.4.3.v20170317.jar</systemPath>
</dependency>

<dependency>
   <groupId>websocket-client</groupId>
   <artifactId>websocket-client</artifactId>
   <version>9.4.3.v20170317</version>
<scope>system</scope>
<systemPath>${jar_path}websocket-client-9.4.3.v20170317.jar</systemPath>
</dependency>

<dependency>
   <groupId>stax-api</groupId>
   <artifactId>stax-api</artifactId>
   <version>1.0.1</version>
<scope>system</scope>
<systemPath>${jar_path}stax-api-1.0.1.jar</systemPath>
</dependency>

<dependency>
   <groupId>sac</groupId>
   <artifactId>sac</artifactId>
   <version>1.3</version>
<scope>system</scope>
<systemPath>${jar_path}sac-1.3.jar</systemPath>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-chrome-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-edge-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-firefox-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-ie-driver</artifactId>
   <version>3.4.0</version>
</dependency>

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

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-opera-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-remote-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-safari-driver</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-support</artifactId>
   <version>3.4.0</version>
</dependency>

<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-log4j12</artifactId>
   <version>1.6.4</version>
   <!-- <scope>test</scope> -->
</dependency>

<dependency>
   <groupId>xalan</groupId>
   <artifactId>xalan</artifactId>
   <version>2.7.2</version>
</dependency>

<dependency>
   <groupId>xerces</groupId>
   <artifactId>xercesImpl</artifactId>
   <version>2.11.0</version>
</dependency>

<dependency>
   <groupId>xml-apis</groupId>
   <artifactId>xml-apis</artifactId>
   <version>1.4.01</version>
<!-- <scope>system</scope>
<systemPath>${jar_path}xml-apis-1.4.01.jar</systemPath> -->
</dependency>



<dependency>
   <groupId>com.atlassian.confluence.plugins</groupId>
   <artifactId>confluence-api</artifactId>
   <version>5.9.1-issue-CONF-38693-m2</version>
   <scope>provided</scope>
</dependency>

<!-- <dependency>
   <groupId>log4j</groupId>
   <artifactId>log4j</artifactId>
   <version>1.2.14</version>
</dependency> -->
<dependency>
   <groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>4</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
<dependency>
   <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
  <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
   <groupId>commons-logging</groupId>
   <artifactId>commons-logging</artifactId>
   <version>1.2</version>
</dependency>
<!--  https://mvnrepository.com/artifact/commons-logging/commons-logging
<dependency>
   <groupId>commons-logging</groupId>
   <artifactId>commons-logging</artifactId>
   <version>1.1.1</version>
</dependency> -->



<dependency>
   <groupId>org.apache.logging.log4j</groupId>
   <artifactId>log4j-api</artifactId>
   <version>2.3</version>
</dependency>

<dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>2.9.0</version>
   </dependency>

   <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
       <version>2.3</version>
   </dependency>    
 
<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-core</artifactId>
   <version>2.8.3</version>
</dependency>    

<dependency>
   <groupId>ch.qos.logback</groupId>
   <artifactId>logback-core</artifactId>
   <version>0.9.29</version>
</dependency>
 
<dependency>
   <groupId>com.google.guava</groupId>
   <artifactId>guava</artifactId>
   <version>21.0</version>
</dependency>
 
<dependency>
   <groupId>javax.inject</groupId>
   <artifactId>javax.inject</artifactId>
   <version>1</version>
</dependency>

<!-- <dependency>
   <groupId>javax.jms</groupId>
   <artifactId>jms</artifactId>
   <version>1.1</version>
</dependency> -->

<dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>javax.servlet-api</artifactId>
   <version>3.1.0</version>
</dependency>

<dependency>
   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-http</artifactId>
   <version>9.4.3.v20170317</version>
</dependency>

<dependency>
   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-io</artifactId>
   <version>9.4.1.v20170120</version>
</dependency>

<dependency>
   <groupId>com.atlassian.jira</groupId>
   <artifactId>jira-rest-java-client-core</artifactId>
   <version>4.0.0</version>
</dependency>    
 
<dependency>
   <groupId>com.google.inject</groupId>
   <artifactId>guice</artifactId>
   <version>3.0</version>
</dependency>  

<dependency>
   <groupId>commons-lang3</groupId>
   <artifactId>commons-lang3</artifactId>
   <version>3.5</version>
<scope>system</scope>
<systemPath>${jar_path}commons-lang3-3.5.jar</systemPath>
</dependency>

<dependency>
   <groupId>net.sourceforge.htmlunit</groupId>
   <artifactId>htmlunit-core-js</artifactId>
   <version>2.26</version>
</dependency>

<dependency>
   <groupId>org.codehaus.groovy</groupId>
   <artifactId>groovy-json</artifactId>
   <version>2.3.2</version>
</dependency>

<dependency>
   <groupId>org.codehaus.groovy</groupId>
   <artifactId>groovy-xml</artifactId>
   <version>2.4.4</version>
</dependency>

<dependency>
   <groupId>com.google.code.gson</groupId>
   <artifactId>gson</artifactId>
   <version>2.8.0</version>
</dependency>

<dependency>
   <groupId>net.sourceforge.htmlunit</groupId>
   <artifactId>htmlunit</artifactId>
   <version>2.26</version>
</dependency>

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>htmlunit-driver</artifactId>
   <version>2.26</version>
</dependency>

<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-annotations</artifactId>
   <version>2.8.3</version>
</dependency>

<dependency>
   <groupId>org.apache.commons</groupId>
   <artifactId>commons-exec</artifactId>
   <version>1.3</version>
</dependency>

<dependency>
   <groupId>org.hamcrest</groupId>
   <artifactId>hamcrest-library</artifactId>
   <version>1.3</version>
  <!--  <scope>test</scope> -->
</dependency>

<dependency>
   <groupId>com.codeborne</groupId>
   <artifactId>phantomjsdriver</artifactId>
   <version>1.4.0</version>
</dependency>

<dependency>
   <groupId>javax.transaction</groupId>
   <artifactId>javax.transaction-api</artifactId>
   <version>1.2</version>
</dependency>
  </dependencies>
</project>

 
Dana Ucaed
Ranch Hand
Posts: 460
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you run your jar file from command prompt or from editor?

From the image it results that you run from the command prompt.

Means that your jar file didn't contain the log4 jar files.

 
ramesh merugu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dana Ucaed wrote:Did you run your jar file from command prompt or from editor?

From the image it results that you run from the command prompt.

Means that your jar file didn't contain the log4 jar files.



please read carefully

your guess is correct,great...I'm running this jar file from command prompt

My jars in lib folder.
log4j.jar
log4j-core-2.9.0.jar
log4j-1.2-api-2.3.jar


I have added dependencies like this,you can find it in pom.xml

<dependency>
   <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>system</scope>
<systemPath>${jar_path}log4j.jar</systemPath>
  </dependency>
<dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

   <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-1.2-api</artifactId>
       <version>${log4j2.version}</version>
   </dependency>

maven.JPG
[Thumbnail for maven.JPG]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic