• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2:NoClassDefFoundError for pdf parsing using itext

 
Greenhorn
Posts: 8
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am trying to Parse a PDF file to text file and store it into the MySQL database using Struts2 and Hibernate.
For PDF parsing I am using itext API.Its not running Showing java.lang.NoClassDefFoundError: com/itextpdf/text/pdf/parser/RenderListener

jars used are-
iText-2.1.5
itextpdf-5.1.1
itextpdf-5.1.1-javadoc
itextpdf-5.1.1-sources
itext-xtra-5.1.1
itext-xtra-5.1.1-javadoc
itext-xtra-5.1.1-sources

Now I'm just trying to convert Pdf to text file the code is-
Question.java


QuestionDTO.java

QuestionDAO.java


QuestionDAOImpl.java


QuestionService.java




QuestionServiceImpl.java



GenericDAO.java


AbstractGenericDaoImpl.java


pdfAction.java


 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you using both iText-2.1.5 and itextpdf-5.1.1 ?
You probably don't need the *-javadoc and -sources JAR files.
 
Poonam Vetal
Greenhorn
Posts: 8
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:Why are you using both iText-2.1.5 and itextpdf-5.1.1 ?
You probably don't need the *-javadoc and -sources JAR files.


Thanks Joe, I removed the itext-2.1.5 n *-javadoc and -sources JAR files
still showing same error java.lang.NoClassDefFoundError: com/itextpdf/text/pdf/parser/RenderListener
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then your problem is either packaging or deploying the application. How are you accomplishing that?
 
Poonam Vetal
Greenhorn
Posts: 8
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:Then your problem is either packaging or deploying the application. How are you accomplishing that?


Sorry Joe, I'm not getting what you have asked? I'm deploying application using tomcat server 6.0 on port 8080 and MySQL as http://localhost:8080/project name/

and packaging Hierarchy is like,

edu.cummins.cts.domain
Question.java
edu.cummins.cts.dto
QuestionDTO.java
edu.cummins.cts.persistence
GenericDAO.java
QuestionDAO.java
edu.cummins.cts.persistence.impl
AbstractGenericDaoImpl.java
QuestionDAOImpl.java
edu.cummins.cts.service
QuestionService.java
edu.cummins.cts.service.impl
QuestionDAOImpl.java
edu.cummins.cts.web
QuestionDAOImpl.java
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you getting your web app on the server? Do you create a WAR and copy it somewhere the server can see it?
You would probably get a lot out of reading the Tomcat Application Developer's Guide.
 
Poonam Vetal
Greenhorn
Posts: 8
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:How are you getting your web app on the server? Do you create a WAR and copy it somewhere the server can see it?
You would probably get a lot out of reading the Tomcat Application Developer's Guide.


Hi Joe,

I'm using the Ant script for the WAR files.
The scripting is like this,
build.xml


build.properties
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming that you have the iText.jar file in WEB-INF/lib, that looks fine.
What is the contents of WEB-INF/lib?
What is the complete stack trace from the server log? I suspect that you may be missing an iText dependency.
 
Poonam Vetal
Greenhorn
Posts: 8
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:Assuming that you have the iText.jar file in WEB-INF/lib, that looks fine.
What is the contents of WEB-INF/lib?
What is the complete stack trace from the server log? I suspect that you may be missing an iText dependency.


Hi Joe,

Thank You so much.I was so stupid I have just included the itext JARs as a Externel Jar in classpath and haven't included in WEB-INF/lib.

Now the error is gone but still not getting the output but thank you so much.gn
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic