Libpcap.so not found causing java.lang.UnsatisfiedLinkError


#1

Hi I’m seeing the following error thrown when the build is running a test case. The test runs fine on my local Windows 10 PC. I guess this means libcap-devel isn’t available on the build containers so we need to add this? Is this a change required from Circle CI or a dependency configuration I can specify?

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'queueSizeChecker' defined in com.kenrui.packetbroker.config.AppConfigQueuePacketsTest: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.kenrui.packetbroker.helper.QueueSizeChecker]: Factory method 'queueSizeChecker' threw exception; nested exception is java.lang.UnsatisfiedLinkError: Unable to load library 'pcap': Native library (linux-x86-64/libpcap.so) not found in resource path ([file:/home/circleci/repo/target/surefire/surefirebooter8243125274572291448.jar, file:/home/circleci/.m2/repository/org/jacoco/org.jacoco.agent/0.8.1/org.jacoco.agent-0.8.1-runtime.jar, file:/tmp/byteBuddyAgent694998749224755990.jar])

Thanks.


#2

It’s best to think of your build environment is a Linux virtual machine with a few CircleCI tools, rather than being a CircleCI-specific environment. So your error can probably be fixed by installing the dependency in the usual way on Linux, something like:

apt-get install pcap

I don’t know what the name is, you can find that out with the following command in an SSH session:

apt-cache search pcap

There are a few system-level things you can’t do in the default Docker executor though, by virtue of how Docker works, so if you struggle with this approach, you can switch to the Machine executor (see the manual).


#3

Thanks this works.


#4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.