poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nihali <nihal...@yahoo.com>
Subject Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/ss/formula/udf/IndexedUDFFinder
Date Sun, 02 Feb 2014 04:24:37 GMT
hi,

my jars:
poi-ooxml-schemas-3.8.jar,poi-ooxml-3.10-beta2.jar,poi-3.8.jar,dom4j-1.6.1.jar
and xmlbeans-2.3.0.jar

My code:


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.thomsonreuters.ims.publication.jobs.PublicationDriverAbstract;
public class DemoInLocal {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		File file = new File("/ims/apps/IMS_C_Const/nihali/PreMPR.txt");
		System.out.println("file name"+file);
		BufferedReader bri = new BufferedReader(new FileReader(file));
		System.out.println("BufferedReader name"+bri);
		int linenumber = 0;
		while (bri.readLine() != null) {
			linenumber++;
		}
		System.out.println("line numbers "+linenumber);
		if (linenumber <= 1000000) {
			System.out.println("start of inside if when line num are less than 1
mill");	
			*XSSFWorkbook workbook = new XSSFWorkbook();*
			System.out.println("after Sxssfworkbook"+workbook);	
			XSSFSheet firstSheet = workbook.createSheet();
			System.out.println("after SxssfSheet"+firstSheet);
			bri = new BufferedReader(new FileReader(file));
			int rowIndex = 0;
			String strLine;
			while ((strLine = bri.readLine()) != null) {
				Row row = firstSheet.createRow(rowIndex);
				String[] cellValues = null;
				if (strLine.contains("|")) {
					cellValues = strLine.split("\\|");
					for (int colIndex = 0; colIndex < cellValues.length; colIndex++) {
						Cell cell = row.createCell(colIndex);
						cell.setCellValue(cellValues[colIndex]);
					}
				}
				rowIndex++;
			}
			System.out.println("after while");	
			File output = new File("/ims/apps/IMS_C_Const/nihali/PreMPRoutput.xlsx");
			System.out.println("output path"+output);		
			FileOutputStream OutputFile = new FileOutputStream(output);
			workbook.write(OutputFile);		
			OutputFile.close();
			bri.close();
		}
}
}



and im getting:

file name/ims/apps/IMS_C_Const/nihali/PreMPR.txt
BufferedReader namejava.io.BufferedReader@44fd13b5
line numbers 839490
start of inside if when line num are less than 1 mill
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/poi/ss/formula/udf/IndexedUDFFinder
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:122)
        at DemoInLocal.main(DemoInLocal.java:68)
Caused by: java.lang.ClassNotFoundException:
org.apache.poi.ss.formula.udf.IndexedUDFFinder
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 2 more

Can any one please help.
my exception is generated at the bold line.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Exception-in-thread-main-java-lang-NoClassDefFoundError-org-apache-poi-ss-formula-udf-IndexedUDFFindr-tp5714813.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message