Service Virtualization

  • 1.  Enabling pcap support on Centos Workstation 10.4.0

    Broadcom Employee
    Posted Feb 15, 2019 02:35 PM

    Hi DevNet Gurus,

     

    Searching past articles, I came across this 2017 post: Problems with recording from PCAP - may be the library? 

     

    I am trying to install the requisite java (jar) and native libraries on a Centos system to enable importing a pcap into the recorder. I am pretty sure that the jar file (jnetpcap-1.4.r1425-1e.jar) is correctly installed (in <LISA_HOME>/lib).

    Creating a new VS image via  [Images Folder]->Create New VS Image->From PCAP  I successfully enter in information up to this point ...

     

     

     

    However after I click NEXT I am presented with the alert dialog (and stack trace)

     

     

    java.lang.UnsatisfiedLinkError: com.slytechs.library.NativeLibrary.dlopen(Ljava/lang/String;)J
    at com.slytechs.library.NativeLibrary.dlopen(Native Method)
    at com.slytechs.library.NativeLibrary.<init>(Unknown Source)
    at com.slytechs.library.JNILibrary.<init>(Unknown Source)
    at com.slytechs.library.JNILibrary.loadLibrary(Unknown Source)
    at com.slytechs.library.JNILibrary.register(Unknown Source)
    at com.slytechs.library.JNILibrary.register(Unknown Source)
    at com.slytechs.library.JNILibrary.register(Unknown Source)
    at org.jnetpcap.PcapBpfProgram.<clinit>(Unknown Source)
    at pcap.reconst.reconstructor.jnetpcap.PCAPProvider.<init>(PCAPProvider.java:34)
    at pcap.reconst.reconstructor.jnetpcap.PcapReconstructor.reconstruct(PcapReconstructor.java:129)
    at com.itko.lisa.vse.stateful.protocol.pcap.VSFromPCAPTransportProtocol.run(VSFromPCAPTransportProtocol.java:181)
    at com.itko.lisa.vse.stateful.protocol.pcap.VSFromPCAPTransportProtocol.beginRecordProcess(VSFromPCAPTransportProtocol.java:146)
    at com.itko.lisa.vse.stateful.protocol.TransportProtocol.startRecording(TransportProtocol.java:645)
    at com.itko.lisa.vse.stateful.recorder.RecordingPanel.startRecording(RecordingPanel.java:267)
    at com.itko.lisa.vse.stateful.recorder.RecordingPanel.activate(RecordingPanel.java:220)
    at com.itko.lisa.gui.WizardPanel.stateChange(WizardPanel.java:587)
    at com.itko.lisa.gui.WizardPanel.nextStep(WizardPanel.java:446)
    at com.itko.lisa.gui.WizardPanel.next(WizardPanel.java:435)
    at com.itko.lisa.gui.WizardPanel$7.actionPerformed(WizardPanel.java:343)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

     

    I think this is related to the Workstation not locating the native library libpcap.so (?)

    I compiled the library (x64) and installed it in various locations after the first failure...

    -rwxr-xr-x 1 root root 1040936 Feb 15 13:56 libpcap.so.1.9.0
    lrwxrwxrwx 1 root root 16 Feb 15 13:56 libpcap.so.1 -> libpcap.so.1.9.0
    lrwxrwxrwx 1 root root 12 Feb 15 13:57 libpcap.so -> libpcap.so.1

    I've tried installing it:

    /usr/local/lib

    <LISA_HOME>/lib/native

    <LISA_HOME>/bin

    <LISA_HOME>/jre/bin

    ... and others I forget

    I've even tried setting LD_LIBRARY_PATH in the bash shell launching Workstation as well as directly in the Workstation launch shell (before calling java).

    When printing the library path in Workstation I see:

    LD_LIBRARY_PATH: /usr/local/CA/DevTest/bin:/usr/local/CA/DevTest/lib/native:

     

    Note that the pcap lib is installed by default on the system:

    [root@servicesim bin]# ldconfig -p | grep libpcap
    libpcap.so.1 (libc6,x86-64) => /lib64/libpcap.so.1 <---- this is version 1.5.3

     

    Has anyone had success importing pcap files on Centos?

    Linux servicesim.ca.com 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    CentOS Linux release 7.3.1611 (Core)

     

    Any help would be appreciated.

    Fred



  • 2.  Re: Enabling pcap support on Centos Workstation 10.4.0

    Broadcom Employee
    Posted Feb 19, 2019 03:52 PM


  • 3.  Re: Enabling pcap support on Centos Workstation 10.4.0

    Broadcom Employee
    Posted Feb 21, 2019 10:56 AM
      |   view attached

    Hi Prema,

    If by steps 6 + 7 you mean ...

    • Select HTTP/S as the transport protocol, and click Configure.
    • Enter the following configuration options:

    ... then yes I did that.

     

    The problem seems related to loading the native pcap library (via dlopen())...  Either the library is not being found, or something to do with the logic that is trying to open it.

    I ran Workstation with LD_DEBUG enabled and got a dump of all attempts to access shared libs (see attached).

    The error I do see relates to JNI_OnLoad_jnetpcap.

     

    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/usr/local/CA/DevTest/jre/lib/amd64/libjava.so [0]
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/lib64/libxcb.so.1 [0]
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/usr/local/CA/DevTest/jre/lib/amd64/libverify.so [0]
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/lib64/libXau.so.6 [0]
    9910: /usr/local/CA/DevTest/jre/bin/java: error: symbol lookup error: undefined symbol: JNI_OnLoad_jnetpcap (fatal)
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/usr/local/CA/DevTest/jre/bin/java [0]
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/lib64/libpthread.so.0 [0]
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/usr/local/CA/DevTest/jre/bin/../lib/amd64/jli/libjli.so [0]
    9910: symbol=JNI_OnLoad_jnetpcap; lookup in file=/lib64/libdl.so.2 [0]

         

     

    Thoughts?

    Attachment(s)