Hello everyone,
i've created a simple class reading values from a ModBus PLC.

I'm trying to use it inside Karaf, but at start the class is unable to find
the modbus driver. I've compiled and installed in Karaf the
"driver-s7-feature", with added the modbus driver:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0";
name="driver-s7-feature">
    <feature name="driver-s7-feature" description="PLC4J: Karaf-Features:
S7" version="0.8.0.SNAPSHOT">
        <details>Implementation of the protocol adapters for usage as Java
library.</details>
        <bundle>mvn:org.apache.plc4x/plc4j-osgi/0.8.0-SNAPSHOT</bundle>
        <bundle>mvn:org.osgi/osgi.core/6.0.0</bundle>
        <bundle>mvn:org.apache.plc4x/plc4j-api/0.8.0-SNAPSHOT</bundle>
        <bundle>mvn:org.apache.plc4x/plc4j-spi/0.8.0-SNAPSHOT</bundle>
        <bundle>mvn:io.netty/netty-codec/4.1.47.Final</bundle>
        <bundle>mvn:io.netty/netty-common/4.1.47.Final</bundle>
        <bundle>mvn:io.netty/netty-transport/4.1.47.Final</bundle>
        <bundle>mvn:io.netty/netty-resolver/4.1.47.Final</bundle>
        <bundle>mvn:commons-beanutils/commons-beanutils/1.9.4</bundle>
        <bundle>mvn:commons-logging/commons-logging/1.2</bundle>
        <bundle>mvn:commons-collections/commons-collections/3.2.2</bundle>
        <bundle>mvn:com.github.jinahya/bit-io/1.4.3</bundle>
        <bundle>mvn:commons-codec/commons-codec/1.12</bundle>
        <bundle>mvn:org.apache.plc4x/plc4j-driver-s7/0.8.0-SNAPSHOT</bundle>

<bundle>mvn:org.apache.plc4x/plc4j-driver-modbus/0.8.0-SNAPSHOT</bundle>

<bundle>mvn:org.apache.plc4x/plc4j-transport-tcp/0.8.0-SNAPSHOT</bundle>

<bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/2.10.0</bundle>
        <bundle>mvn:org.apache.commons/commons-lang3/3.9</bundle>
        <bundle>mvn:io.netty/netty-buffer/4.1.47.Final</bundle>
        <bundle>mvn:io.vavr/vavr/0.10.2</bundle>
        <bundle>mvn:io.vavr/vavr-match/0.10.2</bundle>
    </feature>
</features>

Inside Karaf i can find all the active bundles:

152 │ Active   │  80 │ 0.8.0.SNAPSHOT     │ PLC4J: API
153 │ Active   │  80 │ 0.8.0.SNAPSHOT     │ PLC4J: Driver: S7 (Step7)
154 │ Active   │  80 │ 0.8.0.SNAPSHOT     │ PLC4J: OSGi
155 │ Active   │  80 │ 0.8.0.SNAPSHOT     │ PLC4J: SPI
156 │ Active   │  80 │ 0.8.0.SNAPSHOT     │ PLC4J: Transports: TCP
157 │ Active   │  80 │ 6.0.0.201403061837 │ osgi.core
164 │ Active   │  80 │ 1.0                │ edgecontroller Bundle
165 │ Active   │  80 │ 0.8.0.SNAPSHOT     │ PLC4J: Driver: Modbus

Anyway at startup the bundle doesnt find any driver:

2020-06-08T17:47:43,391 | INFO  | FelixStartLevel  | PlcDriverManager
          | 152 - org.apache.plc4x.plc4j-api - 0.8.0.SNAPSHOT |
Instantiating new PLC Driver Manager with class loader
sun.misc.Launcher$AppClassLoader@764c12b6
2020-06-08T17:47:43,391 | INFO  | FelixStartLevel  | PlcDriverManager
          | 152 - org.apache.plc4x.plc4j-api - 0.8.0.SNAPSHOT | Registering
available drivers...
2020-06-08T17:47:43,392 | ERROR | FelixStartLevel  | Activator
           | 164 - edgecontroller - 1.0.0 | Unable to find driver for
protocol 'modbus'

edgecontroller is my bundle, looking at the Karaf log the PlcDriverManager
is unable to find any driver.

I cannot understand were i'm failing, could anyone provide some insight?

Thank you,
Ale

Reply via email to