0

I want to decode .pcap file using jnetpcap library.
I am using eclipse to run project and i have set all the environments. When i call java class separably then i am able to decode pcap file but when i am calling that java class throw JSP, then i am getting below error..

================================================================

SEVERE: Servlet.service() for servlet [jsp] in context with path [/ProjectName] threw exception [javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/jnetpcap/packet/JPacketHandler] with root cause
java.lang.NoClassDefFoundError: org/jnetpcap/packet/JPacketHandler
    at org.apache.jsp.NFA_005fHome_jsp._jspService(NFA_005fHome_jsp.java:148)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

================================================================

Waiting for reply Thanks, Laxdeep.

Laxdeep
  • 9
  • 1

2 Answers2

0

The NoClassDefFoundError among other things, could be telling you that something's failing in the loading of a class (might be on the static initializers). A possible reason could be that some configuration file or resource that's present on the classpath when you run the class separately, is no longer present on the classpath when you invoke it from a JSP.

Remember that the classpath of a Java web app is composed by the files you put in the WEB-INF/classes directory and the jars you put in the WEB-INF/lib directory. Check if the content of those directories has what it's supposed to.

Andres
  • 10,561
  • 4
  • 45
  • 63
0

You have to make sure the path of your jar file is that "org/jnetpcap/packet/JPacketHandler"...if not put the right path or verify if library is added in your project. Import de dll to, is important!