Hello, Now from zero, with Karaf 4.2.8
1. I made a mistake when testing the libraries, I tested them in the "deploy" and passed them to the "feature". Attached the modified feature. I apologize for that. <feature name='${project.artifactId}' description='${project.name}' version='${project.version}'> <details>${project.description}</details> <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> <bundle>mvn:org.ow2.asm/asm/8.0.1</bundle> <bundle>mvn:org.ow2.asm/asm-util/8.0.1</bundle> <bundle>mvn:org.ow2.asm/asm-tree/8.0.1</bundle> <bundle>mvn:org.ow2.asm/asm-commons/8.0.1</bundle> <bundle>mvn:org.ow2.asm/asm-analysis/8.0.1</bundle> * <bundle>wrap:mvn:org.apache.aries.spifly/org.apache.aries.spifly.weaver-internal/1.3.0/$Export-Package=*;version="1.3.0",!*</bundle> * * <bundle>wrap:mvn:org.apache.aries.spifly/org.apache.aries.spifly.core-internal/1.3.0/$Export-Package=*;version="1.3.0",!*</bundle> * <bundle>mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.0</bundle> </feature> The highlighted packages must be deployed using the wrap protocol (equivalent to placing them in the "deploy" directory). 2. The features are installed and then the app goes to the "deploy" directory. __ __ ____ / //_/____ __________ _/ __/ / ,< / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (4.2.8) Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. karaf@root()> feature:install aries-blueprint karaf@root()> feature:repo-add mvn:com.ceos.merlot/TestPLC4XFeature/0.0.1-SNAPSHOT/xml/features Adding feature url mvn:com.ceos.merlot/TestPLC4XFeature/0.0.1-SNAPSHOT/xml/features karaf@root()> feature:install TestPLC4XFeature karaf@root()> 3. Now everything works karaf@root()> plc4x:read modbus 'modbus:tcp://192.168.1.69' 'coil:1' Find driver service: Modbus Name..:IP/TCP Transport Code..:tcp Synchronous request ... Caso 1: Tiempo en ms: 2903 Close connection... I hope it works in your environment. Sorry for the error, the speed !!!! .... Best regards, El jue., 11 jun. 2020 a las 15:00, Alessio Bernesco Làvore (< alessio.berne...@gmail.com>) escribió: > > We are closer, jeje > ^_^ > > There's still something strange, installing the aries-blueprint feature > there still a "Unsupported 'Bundle-ManifestVersion' value: 1" > Error executing command: Error: > Unable to create resource for bundle > mvn:org.apache.aries.spifly/org.apache.aries.spifly.weaver-internal/1.3.0 > Unable to create resource for bundle > mvn:org.apache.aries.spifly/org.apache.aries.spifly.core-internal/1.3.0 > > Previously i had installed the aries bundle wrapping them, but i cannot > understand why i still had those errors. > > > On Thu, Jun 11, 2020 at 8:37 PM Cesar Garcia <cesar.gar...@ceos.com.ve> > wrote: > > > Hello, > > > > You need install Blueprint feature, is not install by default. > > > > 1. karaf>feature:install aries-blueprint > > > > I see yesterday that new version is out 4.2.9, > > > > But I have not tried it. Still, it's a minor update. From what we said it > > should work, the update of libraries are the same as those of the feature > > that you are displaying... > > > > You can add "aries-blueprint" feature to the app feature. > > > > We are closer, jeje > > > > > > > > El jue., 11 jun. 2020 a las 14:05, Alessio Bernesco Làvore (< > > alessio.berne...@gmail.com>) escribió: > > > > > Hello Cesar, > > > still no luck, i've redone a clean install and a clean installation of > > > Karaf (last version 4.2.9). > > > > > > Which version of Karaf are you using? Cause installing your feature i > > have > > > those errors: > > > > > > Error executing command: Error: > > > Unable to create resource for bundle > > > mvn:org.apache.aries.spifly/org.apache.aries.spifly.core-internal/1.3.0 > > > Unable to create resource for bundle > > > > mvn:org.apache.aries.spifly/org.apache.aries.spifly.weaver-internal/1.3.0 > > > > > > with an exception: > > > > > > Unable to build resource for > > > > > > mvn:org.apache.aries.spifly/org.apache.aries.spifly.weaver-internal/1.3.0: > > > Unsupported 'Bundle-ManifestVersion' value: 1 > > > so i tried to wrap them. > > > > > > This is the list of complete bundles: > > > > > > 22 │ Active │ 80 │ 4.2.9 │ Apache Karaf :: OSGi > Services > > > :: Event > > > 44 │ Active │ 80 │ 2.10.0 │ Jackson-annotations > > > 45 │ Active │ 80 │ 1.4.3 │ bit-io > > > 46 │ Active │ 80 │ 4.1.47.Final │ Netty/Buffer > > > 47 │ Active │ 80 │ 4.1.47.Final │ Netty/Codec > > > 48 │ Active │ 80 │ 4.1.47.Final │ Netty/Common > > > 49 │ Active │ 80 │ 4.1.47.Final │ Netty/Resolver > > > 50 │ Active │ 80 │ 4.1.47.Final │ Netty/Transport > > > 51 │ Active │ 80 │ 0.10.2 │ Vavr > > > 52 │ Active │ 80 │ 0.10.2 │ Vavr Match > > > 53 │ Active │ 80 │ 1.3.0 │ Apache Aries SPI Fly > Dynamic > > > Weaving Bundle > > > 54 │ Active │ 80 │ 3.2.2 │ Apache Commons Collections > > > 55 │ Active │ 80 │ 1.9.4 │ Apache Commons BeanUtils > > > 56 │ Active │ 80 │ 1.12.0 │ Apache Commons Codec > > > 57 │ Active │ 80 │ 3.9.0 │ Apache Commons Lang > > > 58 │ Active │ 80 │ 1.2.0 │ Apache Commons Logging > > > 59 │ Active │ 80 │ 0.8.0.SNAPSHOT │ PLC4J: API > > > 60 │ Active │ 80 │ 0.8.0.SNAPSHOT │ PLC4J: Driver: Modbus > > > 61 │ Active │ 80 │ 0.8.0.SNAPSHOT │ PLC4J: Driver: S7 (Step7) > > > 62 │ Active │ 80 │ 0.8.0.SNAPSHOT │ PLC4J: OSGi > > > 63 │ Active │ 80 │ 0.8.0.SNAPSHOT │ PLC4J: SPI > > > 64 │ Active │ 80 │ 0.8.0.SNAPSHOT │ PLC4J: Transports: TCP > > > 65 │ Active │ 80 │ 8.0.1 │ org.objectweb.asm > > > 66 │ Active │ 80 │ 8.0.1 │ org.objectweb.asm.commons > > > 67 │ Active │ 80 │ 8.0.1 │ org.objectweb.asm.tree > > > 68 │ Active │ 80 │ 8.0.1 │ > > org.objectweb.asm.tree.analysis > > > 69 │ Active │ 80 │ 8.0.1 │ org.objectweb.asm.util > > > 70 │ Active │ 80 │ 6.0.0.201403061837 │ osgi.core > > > 71 │ Active │ 80 │ 0 │ > > > > > > > > > wrap_file__home_ubuntu_.m2_repository_org_apache_aries_spifly_org.apache.aries.spifly.core-internal_1.3.0_org.apache.aries.spifly.core-internal- > > > 72 │ Active │ 80 │ 0 │ > > > > > > > > > wrap_file__home_ubuntu_.m2_repository_org_apache_aries_spifly_org.apache.aries.spifly.weaver-internal_1.3.0_org.apache.aries.spifly.weaver-inter > > > 73 │ Active │ 80 │ 1.0 │ edgecontroller Bundle > > > 74 │ Installed │ 80 │ 0.0.1.SNAPSHOT │ TestPLC4XOsgiWay Blueprint > > > Bundle > > > > > > Launching my bundle there's the same exception: > > > > > > 2020-06-11T17:49:46,506 | ERROR | pipe-bundle:restart edgecontroller | > > > EdgeControllerModbus | 73 - edgecontroller - 1.0.0 | Find > > > driver service: Modbus > > > 2020-06-11T17:49:46,508 | ERROR | pipe-bundle:restart edgecontroller | > > > Activator | 73 - edgecontroller - 1.0.0 | > > > Unsupported transport tcp > > > > > > While starting your: > > > > > > Error executing command: Error executing command on bundles: > > > Error starting bundle 74: Unable to resolve TestPLC4XOsgiWay [74](R > > 74.1): > > > missing requirement [TestPLC4XOsgiWay [74](R 74.1)] > osgi.wiring.package; > > > > > > > > > (&(osgi.wiring.package=org.osgi.service.blueprint)(version>=1.0.0)(!(version>=2.0.0))) > > > Unresolved requirements: [[TestPLC4XOsgiWay [74](R 74.1)] > > > osgi.wiring.package; > > > > > > > > > (&(osgi.wiring.package=org.osgi.service.blueprint)(version>=1.0.0)(!(version>=2.0.0)))] > > > > > > I tried also to add the missing bundle: > > > 75 │ Active │ 80 │ 1.0.2.201505202024 │ > > > org.osgi:org.osgi.service.blueprint > > > > > > but i was still unable to start your bundle, with the same exception. > > > > > > The things that sounds strange to me is that i was unable to do some > > basic > > > operations, like installing the feature. > > > > > > Maybe i'm using a different version of Karaf (4.2.8 and 4.2.9) from > your? > > > > > > Greetings, > > > Alessio > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Jun 11, 2020 at 5:43 PM Cesar Garcia <cesar.gar...@ceos.com.ve > > > > > wrote: > > > > > > > Hello Alessio, > > > > > > > > If the problem is in Karaf, you probably aren't doing a clean boot, > so > > > you > > > > should be using the unmodified version as noted in the previous post. > > > > > > > > 1. Make sure you compiled the PLC4X project with the modification in > > > clean > > > > form ("> mvn clean install -DskipTests"). > > > > 2. Perform a clean boot of Karaf, or preferably delete the "data" and > > > > "system" directories of your installation and run "> karaf clean" > > > > 3. Install the feature and your application. > > > > 4. If it fails you should verify that your Maven installation uses > > > > SNAPSHOTs only from your local repository. > > > > > > > > At this point It should work, > > > > > > > > I'll be waiting for your confirmation, > > > > > > > > Best regards, > > > > > > > > El jue., 11 jun. 2020 a las 7:27, Alessio Bernesco Làvore (< > > > > alessio.berne...@gmail.com>) escribió: > > > > > > > > > Hello Julian, > > > > > > > > > > providing the complete connection string the error is still > present: > > > > > > > > > > karaf@root()> plc4x:read modbus modbus:tcp://192.168.70.73 coil:1 > > > > > > > > > > > > > > > Find driver service: Modbus > > > > > Error executing command: Unsupported transport tcp > > > > > > > > > > During the other test, for example running a local class, the > string > > > > > without the transport code works flawlessly. > > > > > > > > > > Greetings, > > > > > Alessio > > > > > > > > > > > > > > > On Thu, Jun 11, 2020 at 1:05 PM Julian Feinauer < > > > > > j.feina...@pragmaticminds.de> wrote: > > > > > > > > > > > I guess its in your config. If I remember correctly you have to > > state > > > > the > > > > > > transport layer. > > > > > > So in your case: > > > > > > > > > > > > Modbus:tcp://xxx > > > > > > > > > > > > Does that help? > > > > > > > > > > > > Am 11.06.20, 12:13 schrieb "Alessio Bernesco Làvore" < > > > > > > alessio.berne...@gmail.com>: > > > > > > > > > > > > Thank you very much Cesar for your insight and your detailed > > > > > > explanation, > > > > > > much appreciated. > > > > > > I've used your feature to enable your example and my works, > now > > > > they > > > > > > both > > > > > > find the Modbus driver and all the flow seems clear to me. > > > > > > > > > > > > Running your command, but also running my test using an > > > activator, > > > > > > there's > > > > > > a transport error: > > > > > > > > > > > > karaf@root()> plc4x:read modbus modbus://192.168.70.73 > coil:1 > > > > > > > > > > > > > > > > > > Find driver service: Modbus > > > > > > Error executing command: Unsupported transport tcp > > > > > > > > > > > > I cannot understand if it's still related to a > misconfiguration > > > on > > > > my > > > > > > side > > > > > > or with the driver. > > > > > > > > > > > > Greetings, > > > > > > Alessio > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Wed, Jun 10, 2020 at 8:25 AM Cesar Garcia < > > > > > cesar.gar...@ceos.com.ve > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > Hello Alessio, > > > > > > > > > > > > > > As I pointed out, with the new design of the drivers it is > > > > > necessary > > > > > > to > > > > > > > make a few modifications so that the system allows > > > communication > > > > > > with the > > > > > > > OSGi container. > > > > > > > > > > > > > > In a default installation, the load of services in the SPI > > > > services > > > > > > are not > > > > > > > seen between the different bundles, and that is the problem > > > that > > > > is > > > > > > > happening to you and, as Julian pointed out in his email, > the > > > > > Apache > > > > > > Aries > > > > > > > Fly project solves it. > > > > > > > > > > > > > > By default Karaf does not integrate the Aries Fly project > > > > (although > > > > > > the > > > > > > > page indicates that it does), it can be added in a feature > or > > > you > > > > > can > > > > > > > generate your own version of Karaf (I always start from a > > > minimal > > > > > > > installation), so I complement the feature you published > and > > > you > > > > > > can see > > > > > > > in[1]. > > > > > > > > > > > > > > Now each service / consumer must indicate within the > manifest > > > the > > > > > > methods > > > > > > > that it export or import as appropriate. In your case you > > need > > > to > > > > > > specify > > > > > > > the transport services, specifically "PLC4J: Transports: > TCP" > > > and > > > > > the > > > > > > > consumer "PLC4J: SPI", which are what cause the problem. > > > > > > Modifications in > > > > > > > [2] and [3] are made in the POMs. > > > > > > > > > > > > > > At this point you should already see the transport and the > > > > > > registered by > > > > > > > spifly like in [4]. > > > > > > > > > > > > > > Well, here you can already use PLC4X in your bundle, in [5] > > > leave > > > > > an > > > > > > > example code, creating a Karaf command with which you can > > > access > > > > > the > > > > > > Modbus > > > > > > > or S7 driver indifferently (Just test the Modbus). > > > > > > > > > > > > > > This could somehow be treated as a PR for the project, it > > > should > > > > be > > > > > > > evaluated. > > > > > > > > > > > > > > My grain of sand. > > > > > > > > > > > > > > 1. The feature > > > > > > > > > > > > > > <feature name='${project.artifactId}' description='${ > > > > > > project.name}' > > > > > > > version='${project.version}'> > > > > > > > <details>${project.description}</details> > > > > > > > <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> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > * <bundle>mvn:org.ow2.asm/asm/8.0.1</bundle> > > > > > > > <bundle>mvn:org.ow2.asm/asm-util/8.0.1</bundle> > > > > > > > <bundle>mvn:org.ow2.asm/asm-tree/8.0.1</bundle> > > > > > > > <bundle>mvn:org.ow2.asm/asm-commons/8.0.1</bundle> > > > > > > > <bundle>mvn:org.ow2.asm/asm-analysis/8.0.1</bundle> > > <!-- > > > > > > > <bundle>mvn:biz.aQute.bnd/aQute.libg/5.0.1</bundle> > > > > > > > <bundle>mvn:biz.aQute.bnd/biz.aQute.bndlib/5.0.1</bundle> > > > > > --> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <bundle>mvn:org.apache.aries.spifly/org.apache.aries.spifly.weaver-internal/1.3.0</bundle> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <bundle>mvn:org.apache.aries.spifly/org.apache.aries.spifly.core-internal/1.3.0</bundle> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <bundle>mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.0</bundle> > > > > > > > * > > > > > > > > > > > > > > </feature> > > > > > > > > > > > > > > [2] "PLC4J: Transports: TCP" > > > > > > > > > > > > > > <plugin> > > > > > > > <groupId>org.apache.felix</groupId> > > > > > > > <artifactId>maven-bundle-plugin</artifactId> > > > > > > > <extensions>true</extensions> > > > > > > > <configuration> > > > > > > > <instructions> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <Bundle-Activator>org.apache.plc4x.java.osgi.TransportActivator</Bundle-Activator> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > <Export-Service>org.apache.plc4x.java.spi.transport.Transport,org.apache.plc4x.java.transport.tcp.TcpTransport</Export-Service> > > > > > > > * <SPI-Provider>*</SPI-Provider>* > > > > > > > </instructions> > > > > > > > </configuration> > > > > > > > </plugin> > > > > > > > > > > > > > > [3] "PLC4J: SPI" > > > > > > > <plugin> > > > > > > > <groupId>org.apache.felix</groupId> > > > > > > > <artifactId>maven-bundle-plugin</artifactId> > > > > > > > <extensions>true</extensions> > > > > > > > <configuration> > > > > > > > <instructions> > > > > > > > > > > <Export-package>io.netty.bootstrap,*</Export-package> > > > > > > > *<SPI-consumer>*</SPI-consumer>* > > > > > > > </instructions> > > > > > > > </configuration> > > > > > > > </plugin> > > > > > > > </plugins> > > > > > > > > > > > > > > [4] karaf@root()> service:list Transport > > > > > > > [org.apache.plc4x.java.spi.transport.Transport] > > > > > > > ----------------------------------------------- > > > > > > > org.apache.plc4x.transport.code = tcp > > > > > > > org.apache.plc4x.transport.name = IP/TCP Transport > > > > > > > service.bundleid = 89 > > > > > > > service.id = 207 > > > > > > > service.scope = singleton > > > > > > > Provided by : > > > > > > > PLC4J: Transports: TCP (89) > > > > > > > Used by: > > > > > > > TestPLC4XOsgiWay Blueprint Bundle (51) > > > > > > > > > > > > > > [org.apache.plc4x.java.spi.transport.Transport] > > > > > > > ----------------------------------------------- > > > > > > > .org.apache.aries.spifly.provider.discovery.mode = > > > > > > SPI_PROVIDER_HEADER > > > > > > > .org.apache.aries.spifly.provider.implclass = > > > > > > > org.apache.plc4x.java.transport.tcp.TcpTransport > > > > > > > service.bundleid = 89 > > > > > > > service.id = 208 > > > > > > > service.scope = bundle > > > > > > > serviceloader.mediator = 45 > > > > > > > Provided by : > > > > > > > PLC4J: Transports: TCP (89) > > > > > > > > > > > > > > [5] *https://github.com/glcj/TestPLC4X < > > > > > > https://github.com/glcj/TestPLC4X > > > > > > > >* > > > > > > > > > > > > > > > > > > > > > El mar., 9 jun. 2020 a las 5:23, Alessio Bernesco Làvore (< > > > > > > > alessio.berne...@gmail.com>) escribió: > > > > > > > > > > > > > > > Thank you Cesar, > > > > > > > > thanks for your insight, but i think i'm still lost > > > somewhere. > > > > > > > > > > > > > > > > I've registered the driver inside my bundle context, at > > > least i > > > > > > think so: > > > > > > > > > > > > > > > > [org.apache.plc4x.java.api.PlcDriver] > > > > > > > > ------------------------------------- > > > > > > > > org.apache.plc4x.driver.code = modbus > > > > > > > > org.apache.plc4x.driver.name = Modbus > > > > > > > > service.bundleid = 165 > > > > > > > > service.id = 247 > > > > > > > > service.scope = singleton > > > > > > > > Provided by : > > > > > > > > PLC4J: Driver: Modbus (165) > > > > > > > > Used by: > > > > > > > > edgecontroller Bundle (164) <-- > > > > > > > > > > > > > > > > Anyway starting the bundle the PLC Driver Manager is > unable > > > to > > > > > > find the > > > > > > > > driver: > > > > > > > > > > > > > > > > 2020-06-09T09:17:50,132 | INFO | pipe-bundle:update > > > > > > edgecontroller | > > > > > > > > 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-09T09:17:50,132 | INFO | pipe-bundle:update > > > > > > edgecontroller | > > > > > > > > PlcDriverManager | 152 - > > > > > > org.apache.plc4x.plc4j-api - > > > > > > > > 0.8.0.SNAPSHOT | Registering available drivers... > > > > > > > > 2020-06-09T09:17:50,133 | ERROR | pipe-bundle:update > > > > > > edgecontroller | > > > > > > > > Activator | 164 - edgecontroller - > > > > 1.0.0 | > > > > > > Unable > > > > > > > to > > > > > > > > find driver for protocol 'modbus' > > > > > > > > > > > > > > > > Greetings, > > > > > > > > Alessio > > > > > > > > > > > > > > > > On Mon, Jun 8, 2020 at 10:52 PM Cesar Garcia < > > > > > > cesar.gar...@ceos.com.ve> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > Hello Alessio, > > > > > > > > > > > > > > > > > > Perform the test with the "feature" that you put > online, > > > and > > > > I > > > > > > can see > > > > > > > > that > > > > > > > > > the services associated with the drivers are active. > > > > > > > > > > > > > > > > > > karaf@root()> service:list PlcDriver > > > > > > > > > [org.apache.plc4x.java.api.PlcDriver] > > > > > > > > > ------------------------------------- > > > > > > > > > org.apache.plc4x.driver.code = modbus > > > > > > > > > org.apache.plc4x.driver.name = Modbus > > > > > > > > > service.bundleid = 59 > > > > > > > > > service.id = 98 > > > > > > > > > service.scope = singleton > > > > > > > > > Provided by : > > > > > > > > > PLC4J: Driver: Modbus (59) > > > > > > > > > > > > > > > > > > [org.apache.plc4x.java.api.PlcDriver] > > > > > > > > > ------------------------------------- > > > > > > > > > org.apache.plc4x.driver.code = s7 > > > > > > > > > org.apache.plc4x.driver.name = Siemens S7 (Basic) > > > > > > > > > service.bundleid = 60 > > > > > > > > > service.id = 97 > > > > > > > > > service.scope = singleton > > > > > > > > > Provided by : > > > > > > > > > PLC4J: Driver: S7 (Step7) (60) > > > > > > > > > > > > > > > > > > The solution is to use the "BundleContext" with a > filter > > > and > > > > > > take the > > > > > > > > field > > > > > > > > > "org.apache.plc4x.driver.name " or the field > > > > > > > > > "org.apache.plc4x.driver.code" ( They are the same ). I > > > think > > > > > > that is > > > > > > > the > > > > > > > > > way to do it in an OSGi environment. > > > > > > > > > > > > > > > > > > Loading the services with SPI is redundant, and it may > > > happen > > > > > > that the > > > > > > > > SPI > > > > > > > > > service does not see the PlcDriver Services (typical > OSGi > > > > > > problem). > > > > > > > > > > > > > > > > > > My grain of sand, > > > > > > > > > > > > > > > > > > Best regards, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > El lun., 8 jun. 2020 a las 15:41, Alessio Bernesco > Làvore > > > (< > > > > > > > > > alessio.berne...@gmail.com>) escribió: > > > > > > > > > > > > > > > > > > > Thank you Julian, > > > > > > > > > > i've tried to install th Aries SPI Bundle: > > > > > > > > > > > > > > > > > > > > 176 │ Active │ 80 │ 1.3.0 │ Apache > > Aries > > > > SPI > > > > > > Fly > > > > > > > > Dynamic > > > > > > > > > > Weaving Bundle > > > > > > > > > > > > > > > > > > > > But i'm still unable to resolve the drivers. > > > > > > > > > > > > > > > > > > > > Ale > > > > > > > > > > > > > > > > > > > > On Mon, Jun 8, 2020 at 8:13 PM Julian Feinauer < > > > > > > > > > > j.feina...@pragmaticminds.de> > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > Hi Alessio, > > > > > > > > > > > > > > > > > > > > > > if I remember correctly you need the Aries SPI Fly > > > > package > > > > > > loaded. > > > > > > > > > > > In Plain PLC4X we use ServiceLoader to discover > > > drivers. > > > > > > > > > > > If you have nothing like Aries SPI Fly which > mediates > > > and > > > > > > > "immitates" > > > > > > > > > the > > > > > > > > > > > ServiceLoader then you dont get a wiring between > the > > > > > > DriverManager > > > > > > > > and > > > > > > > > > > the > > > > > > > > > > > driver. > > > > > > > > > > > But I don’t checked the lastst implementation to be > > > > honest. > > > > > > > > > > > > > > > > > > > > > > Perhaps @Robinet, Etienne can help? > > > > > > > > > > > > > > > > > > > > > > Julian > > > > > > > > > > > > > > > > > > > > > > Am 08.06.20, 20:00 schrieb "Alessio Bernesco > Làvore" > > < > > > > > > > > > > > alessio.berne...@gmail.com>: > > > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > *CEOS Automatización, C.A.* > > > > > > > > > *GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,* > > > > > > > > > *PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,* > > > > > > > > > > > > > > > > > > *FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. > > > > ANZOATEGUI* > > > > > > > > > *Ing. César García* > > > > > > > > > > > > > > > > > > *Cel: +58 414-760.98.95* > > > > > > > > > > > > > > > > > > *Hotline Técnica SIEMENS: 0800 1005080* > > > > > > > > > > > > > > > > > > *Email: support.aan.automat...@siemens.com > > > > > > > > > <support.aan.automat...@siemens.com>* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > *CEOS Automatización, C.A.* > > > > > > > *GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,* > > > > > > > *PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,* > > > > > > > > > > > > > > *FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. > > ANZOATEGUI* > > > > > > > *Ing. César García* > > > > > > > > > > > > > > *Cel: +58 414-760.98.95* > > > > > > > > > > > > > > *Hotline Técnica SIEMENS: 0800 1005080* > > > > > > > > > > > > > > *Email: support.aan.automat...@siemens.com > > > > > > > <support.aan.automat...@siemens.com>* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > *CEOS Automatización, C.A.* > > > > *GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,* > > > > *PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,* > > > > > > > > *FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. ANZOATEGUI* > > > > *Ing. César García* > > > > > > > > *Cel: +58 414-760.98.95* > > > > > > > > *Hotline Técnica SIEMENS: 0800 1005080* > > > > > > > > *Email: support.aan.automat...@siemens.com > > > > <support.aan.automat...@siemens.com>* > > > > > > > > > > > > > -- > > *CEOS Automatización, C.A.* > > *GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,* > > *PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,* > > > > *FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. ANZOATEGUI* > > *Ing. César García* > > > > *Cel: +58 414-760.98.95* > > > > *Hotline Técnica SIEMENS: 0800 1005080* > > > > *Email: support.aan.automat...@siemens.com > > <support.aan.automat...@siemens.com>* > > > -- *CEOS Automatización, C.A.* *GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,* *PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,* *FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. ANZOATEGUI* *Ing. César García* *Cel: +58 414-760.98.95* *Hotline Técnica SIEMENS: 0800 1005080* *Email: support.aan.automat...@siemens.com <support.aan.automat...@siemens.com>*