Results 1 to 3 of 3
- 03-14-2013, 11:06 PM #1
Member
- Join Date
- Mar 2013
- Posts
- 6
- Rep Power
- 0
Desperation and and misadventures with java.lang.NoClassDefFoundError
Hi fellows! I'm in a bit of a pickle with using our dear POI, for I'm having this dastard error and I really can't identify why it's happening.
Would you guys mind helping me?
My SO is win7(x64) and I have the following libs included on my Eclipse IDE:
poi-3.9-20121203.jar
poi-ooxml-3.9-20121203.jar
poi-ooxml-schemas-3.9-20121203.jar
ooxml-lib\dom4j-1.6.1.jar
xmlbeans-2.3.0.jar
To which, as far as I'm aware, should be more than enough to run the following class:
The following error :Java Code:public class Extracao { public void extrai(List<Noticia> passagem, String chave) throws FileNotFoundException, IOException { XWPFDocument doc = new XWPFDocument(); XWPFParagraph paragrafo = doc.createParagraph(); XWPFRun aplicacao = paragrafo.createRun(); Noticia temporario; System.out.println("Ponto!" + passagem.size()); while(!passagem.isEmpty()) { temporario = passagem.remove(0); aplicacao.setText("Data : " + temporario.getData()); aplicacao.addBreak(); aplicacao = paragrafo.createRun(); aplicacao.setText("Classe : " + temporario.getClasse() + " Setor : " + temporario.getSetor()); aplicacao.addBreak(); aplicacao = paragrafo.createRun(); aplicacao.setText("Tipo : " + temporario.tipoTexto() + " Estado : " + temporario.getEstado()); aplicacao.addBreak(); aplicacao = paragrafo.createRun(); divideTexto(doc,paragrafo, aplicacao, temporario.getNoticia()); aplicacao.addBreak(); aplicacao.addBreak(); aplicacao.addBreak(); } doc.write(new FileOutputStream(new File(chave + "\"" + "arquivoDeSaida.docx"))); } private void divideTexto(XWPFDocument documento, XWPFParagraph paragrafo, XWPFRun app, String alvo) { if(alvo.length() > 50) { int j, limite = 0; for(j = 0; j <= alvo.length(); j += 50) { app.setText(alvo.substring(j, j + 50)); app.addBreak(); app = paragrafo.createRun(); limite = j; } if(limite != alvo.length()) { app.setText(alvo.substring(j - 50, alvo.length())); app.addBreak(); } } else app.setText(alvo); app.addBreak(); } }
is thrown when running the line 18 or, in the current case, the declaration of doc (XWPFDocument doc = ...).Java Code:WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/poi/xwpf/usermodel/XWPFDocument at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
I really am totally lost here guys, please help this lad here: why is the error being thrown? How do I fix it?
- 03-15-2013, 01:26 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Desperation and and misadventures with java.lang.NoClassDefFoundError
Where is this running?
Looks like a server...so have a look in WEB-INF/lib and see whether those libraries are being deployed.
If not then you'll have to look into how the deployment is being determined.Please do not ask for code as refusal often offends.
- 03-15-2013, 06:33 PM #3
Member
- Join Date
- Mar 2013
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
java.lang.NoClassDefFoundError:
By Gowramma in forum New To JavaReplies: 0Last Post: 05-02-2012, 08:57 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum New To JavaReplies: 5Last Post: 06-02-2010, 01:05 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum Advanced JavaReplies: 3Last Post: 06-01-2010, 03:01 PM -
java.lang.NoClassDefFoundError
By noobie in forum Java AppletsReplies: 5Last Post: 04-22-2009, 02:35 AM -
java.lang.NoClassDefFoundError:
By jeepcreep11 in forum New To JavaReplies: 3Last Post: 03-13-2009, 11:58 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks