Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4230500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T01:52:21+00:00 2026-05-21T01:52:21+00:00

I am trying to build a web interface for an embedded device, that will

  • 0

I am trying to build a web interface for an embedded device, that will display network statistics. I am using Glassfish 3.1 Application Server, and I would like to use jnetpcap to listen to network traffic. jnetpcap relies on the libpcap native libraries. I have tried to find documentation from Oracle about using native libraries with Glassfish, but I haven’t found what I am looking for yet (and I may be looking for the wrong thing).

When my servlet loads it fails with

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jnetpcap.Pcap

which I interpret to mean, that the class loader can find the class (I have specified it as a library when I deploy it) but cannot load it. My first inferences were that it might have been a security policy problem, or that the jvm couldn’t find the libpcap.so.

I set the path for system.library.path in the admin console (ie the web interface) using Configurations->server-config->jvm-settings. In the ‘Path Settings’ tab, I put the path ‘/usr/bin/libpcap.so’ in the Native Library Path Suffix field. When I restarted the Glassfish server, I got the following message:

[#|2011-03-31T13:30:13.962+1100|WARNING|glassfish3.1|null| … GlassFishConfigBean.com.sun.enterprise.config.serverbeans.JavaConfig}, reason = JavaConfig attribute ‘NativeLibraryPathSuffix’ was changed from ‘null’ to ‘/usr/bin/libpcap.so’, when = 1301538613961|#]

and later in the logs the native library path turns up in the path output

-Djava.library.path= … /usr/lib64:/lib64:/lib:/usr/lib:/usr/bin/libpcap.so

so I think the native library is being successfully loaded. Is there a way that I can check that native library is indeed loaded?

I have also disabled the security manager (just for the time being, to try to get the servlet to work; I plan to implement more subtle security policies once it’s working), and that hasn’t fixed the problem either.

Am I trying to load the native library correctly? How can I find out more information about whether the native library is loaded, and about why the org.jnetpcap.Pcap class cannot be initialized?

Thanks,
Tim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T01:52:22+00:00Added an answer on May 21, 2026 at 1:52 am

    Okay, solved.

    Problem was jnetpcap depends on libjnetpcap.so not libpcap.so. My mistake.

    Added the path correct path (/stuff/ … /libjnetpcap-1.3.b4) to the Native Library Path Suffix field of the JVM Path Settings, and it was all systems go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a web application that will use an LDAP server
I'm trying to build a web server in node.js that will support cross-domain scripting,
I'm trying to build a generic web service interface using WCF, to allow 3rd
I'm trying to build a web application that uses an SSL connection. So I
I'm trying to build a 4-tier Web-Application in Java. I'm using the Hibernate Framework
I am trying to build the interface of my WEB site using OOP. For
I am using Maven, Jersey and Jetty server to build a web service interface.
I am trying to build a Web application using jQuery Mobile. When testing on
I am trying to build a web application, where I have abstracted logic in
I'm trying to build a Web page that has a rich text editor. Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.