java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory when i try to run the program from eclipse. Is there something I am missing any comments will be appreciated thanks in advance My code am not showing the packages imported public class TestModules { private static int printDistributedMatrix(DistributedRowMatrix matrix) { Iterator<MatrixSlice> iterator = matrix.iterateAll(); int count = 0; while(iterator.hasNext()) { MatrixSlice slice = iterator.next(); Vector v = slice.vector(); int size = v.size(); for(int i=0;i<size;i++) { Element e = v.getElement(i); count++; System.out.print(e.get()+" "); } System.out.println(); } return count; } public static void Distributed_Matrix_Operations() { Path Input_Test_Matrix_File=new Path("/input/Input_Test_Matrix_V");// we need to write the path for that make sure that the file exists Path Output_Test_Matrix_File=new Path("input/Out_Test_Matrix_V"); DistributedRowMatrix Matrix_v= new DistributedRowMatrix(Input_Test_Matrix_File,Output_Test_Matrix_File, 5, 5); Matrix_v.configure(new JobConf()); System.out.println("original matrix = "); printDistributedMatrix(Matrix_v); // matrix printing class DistributedRowMatrix Matrix_v_Transpose; DistributedRowMatrix Matrix_V_Squared; try { Matrix_v_Transpose = Matrix_v.transpose(); System.out.println("The matrix after transpose "); printDistributedMatrix(Matrix_v_Transpose); Matrix_V_Squared= Matrix_v.times(Matrix_v_Transpose); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("Exception occured on carrying out the transpse"+e.toString()); //e.printStackTrace(); } } public static final String Matrix_V="input/Matrix_V"; public static final double[][] matrixvalues = { {10,4,8,0,5}, {2,3,4,-5,8}, {1,7,4,0,9}, {1,-6,5,8,9}, {1,6,3,1,0} }; public static void WriteDistributedMatrix() throws Exception { Configuration cfg = new Configuration(); FileSystem fs = FileSystem.get(cfg); SequenceFile.Writer writer = SequenceFile.createWriter(fs, cfg, new Path(Matrix_V),IntWritable.class, VectorWritable.class) ; for(int i=0;i<matrixvalues.length;i++) { DenseVector row = new DenseVector(matrixvalues[i]); VectorWritable writtenvector = new VectorWritable(row); writer.append(new IntWritable(i), writtenvector); } writer.close(); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { System.out.println("This is inside main before calling write distributed matrix"); WriteDistributedMatrix(); Distributed_Matrix_Operations(); } catch(Exception e) { System.out.println("This is the exception caught"+e.toString()); } } } The error is Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

mahout-user | ahmed.nagy | 6 years ago
  1. 0

    Error java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    mahout-user | 6 years ago | ahmed.nagy
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory when i try to run the program from eclipse. Is there something I am missing any comments will be appreciated thanks in advance My code am not showing the packages imported public class TestModules { private static int printDistributedMatrix(DistributedRowMatrix matrix) { Iterator<MatrixSlice> iterator = matrix.iterateAll(); int count = 0; while(iterator.hasNext()) { MatrixSlice slice = iterator.next(); Vector v = slice.vector(); int size = v.size(); for(int i=0;i<size;i++) { Element e = v.getElement(i); count++; System.out.print(e.get()+" "); } System.out.println(); } return count; } public static void Distributed_Matrix_Operations() { Path Input_Test_Matrix_File=new Path("/input/Input_Test_Matrix_V");// we need to write the path for that make sure that the file exists Path Output_Test_Matrix_File=new Path("input/Out_Test_Matrix_V"); DistributedRowMatrix Matrix_v= new DistributedRowMatrix(Input_Test_Matrix_File,Output_Test_Matrix_File, 5, 5); Matrix_v.configure(new JobConf()); System.out.println("original matrix = "); printDistributedMatrix(Matrix_v); // matrix printing class DistributedRowMatrix Matrix_v_Transpose; DistributedRowMatrix Matrix_V_Squared; try { Matrix_v_Transpose = Matrix_v.transpose(); System.out.println("The matrix after transpose "); printDistributedMatrix(Matrix_v_Transpose); Matrix_V_Squared= Matrix_v.times(Matrix_v_Transpose); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("Exception occured on carrying out the transpse"+e.toString()); //e.printStackTrace(); } } public static final String Matrix_V="input/Matrix_V"; public static final double[][] matrixvalues = { {10,4,8,0,5}, {2,3,4,-5,8}, {1,7,4,0,9}, {1,-6,5,8,9}, {1,6,3,1,0} }; public static void WriteDistributedMatrix() throws Exception { Configuration cfg = new Configuration(); FileSystem fs = FileSystem.get(cfg); SequenceFile.Writer writer = SequenceFile.createWriter(fs, cfg, new Path(Matrix_V),IntWritable.class, VectorWritable.class) ; for(int i=0;i<matrixvalues.length;i++) { DenseVector row = new DenseVector(matrixvalues[i]); VectorWritable writtenvector = new VectorWritable(row); writer.append(new IntWritable(i), writtenvector); } writer.close(); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { System.out.println("This is inside main before calling write distributed matrix"); WriteDistributedMatrix(); Distributed_Matrix_Operations(); } catch(Exception e) { System.out.println("This is the exception caught"+e.toString()); } } } The error is Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
  2. 0

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    programask.com | 1 year ago
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
  3. 0

    Java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory - www.scriptscoop.net

    scriptscoop.net | 8 months ago
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    Stack Overflow | 3 years ago | Siddhu
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
  6. 0

    HDFS as deepstorage failed to start

    Google Groups | 9 months ago | Unknown author
    java.lang.NoClassDefFoundError: org/apache/commons/collections/map/UnmodifiableMap

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      org/apache/commons/logging/LogFactory when i try to run the program from eclipse. Is there something I am missing any comments will be appreciated thanks in advance My code am not showing the packages imported public class TestModules { private static int printDistributedMatrix(DistributedRowMatrix matrix) { Iterator<MatrixSlice> iterator = matrix.iterateAll(); int count = 0; while(iterator.hasNext()) { MatrixSlice slice = iterator.next(); Vector v = slice.vector(); int size = v.size(); for(int i=0;i<size;i++) { Element e = v.getElement(i); count++; System.out.print(e.get()+" "); } System.out.println(); } return count; } public static void Distributed_Matrix_Operations() { Path Input_Test_Matrix_File=new Path("/input/Input_Test_Matrix_V");// we need to write the path for that make sure that the file exists Path Output_Test_Matrix_File=new Path("input/Out_Test_Matrix_V"); DistributedRowMatrix Matrix_v= new DistributedRowMatrix(Input_Test_Matrix_File,Output_Test_Matrix_File, 5, 5); Matrix_v.configure(new JobConf()); System.out.println("original matrix = "); printDistributedMatrix(Matrix_v); // matrix printing class DistributedRowMatrix Matrix_v_Transpose; DistributedRowMatrix Matrix_V_Squared; try { Matrix_v_Transpose = Matrix_v.transpose(); System.out.println("The matrix after transpose "); printDistributedMatrix(Matrix_v_Transpose); Matrix_V_Squared= Matrix_v.times(Matrix_v_Transpose); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("Exception occured on carrying out the transpse"+e.toString()); //e.printStackTrace(); } } public static final String Matrix_V="input/Matrix_V"; public static final double[][] matrixvalues = { {10,4,8,0,5}, {2,3,4,-5,8}, {1,7,4,0,9}, {1,-6,5,8,9}, {1,6,3,1,0} }; public static void WriteDistributedMatrix() throws Exception { Configuration cfg = new Configuration(); FileSystem fs = FileSystem.get(cfg); SequenceFile.Writer writer = SequenceFile.createWriter(fs, cfg, new Path(Matrix_V),IntWritable.class, VectorWritable.class) ; for(int i=0;i<matrixvalues.length;i++) { DenseVector row = new DenseVector(matrixvalues[i]); VectorWritable writtenvector = new VectorWritable(row); writer.append(new IntWritable(i), writtenvector); } writer.close(); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { System.out.println("This is inside main before calling write distributed matrix"); WriteDistributedMatrix(); Distributed_Matrix_Operations(); } catch(Exception e) { System.out.println("This is the exception caught"+e.toString()); } } } The error is Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

      at org.apache.hadoop.conf.Configuration.<clinit>()
    2. Hadoop
      Configuration.<clinit>
      1. org.apache.hadoop.conf.Configuration.<clinit>(Configuration.java:139)
      1 frame
    3. Unknown
      TestModules.main
      1. TestModules.WriteDistributedMatrix(TestModules.java:107)
      2. TestModules.main(TestModules.java:133)
      2 frames