Hi Julian, What example did you try? I've never used Jira before, is it free to use? To start I could show you the blueprint I am trying to deploy in my karaf container:
<?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd"> <camelContext id="PLC-Context" xmlns="http://camel.apache.org/schema/blueprint" streamCache="true"> <route id="Route1"> <from uri="plc4x:s7:localhost/1/1"/> <to uri="mock:test"/> </route> </camelContext> </blueprint> It is very simple but I am for now just trying to establish the connection to the PLC via blueprint. What's strange here for me is that I tried your example on git (PLC4X+Karaf) and it worked with the same bundle installed and running (the S7 driver is found). That's why I don't really understand the error I am getting (Unable to find driver for protocol 's7'). Hope my explanation are not too confusing, I am starting my second week only of my internship and it's my first time working with OSGi and blueprints ;-) Etienne On 2020/02/16 19:14:04, Julian Feinauer <[email protected]> wrote: > Hi Etienne, > > sorry for the delay, I was a bit ill the last days. > I will indeed have a closer look on your use case. > I never used Camel in OSGi except for one ver simple blueprint test, so it > could take me some time. > > Would you mind opening a Jira issue for that? > Then I can comment there and hopefully bring in a bit of analysis. > > Thanks! > Julian > > Am 14.02.20, 23:34 schrieb "Etienne Robinet" <[email protected]>: > > Hello everyone, > I've spent some days trying to figure out how to make PLC4X work inside a > karaf container in combination with camel blueprints for routing. > I've downloaded the latest release (0.5.0) and built it with maven. I > then installed the driver-s7-feature and plc4j-apache-camel bundle into my > container and got following bundles running: > > >PLC4J: API > >PLC4J: Driver: S7 > >PLC4J: Protocol: Driver-Base: Base > >PLC4J: Protocol: Driver-Base: TCP > >PLC4J: Protocol: ISO on TCP > >PLC4J: Protocol: ISO TP > >PLC4J: Protocol: S7 > >PLC4j: Utils: Driver Base: Java > >PLC4J: Integrations: Apache Camel > > After trying a simple route with this consumer component: > <from uri="plc4x:s7:localhost/1/1"/> (the address is for testing purpose) > I get the following error: > Error occurred during starting CamelContext: PLC-Context > org.apache.camel.FailedToCreateRouteException: Failed to create route > Route1: Route(Route1)[[From[plc4x:s7:localhost/1/1]] -> [To[mock:tes... > because of Unable to find driver for protocol 's7' > > I've tested numerous version of PLC4X and got the same results, so I > think I might be close to fix it! > Any help would be appreciated! > > Here the full log > > 16:30:45.578 INFO [Blueprint Event Dispatcher: 1] Attempting to start > CamelContext: PLC-Context > 16:30:45.579 INFO [Blueprint Event Dispatcher: 1] Apache Camel 2.24.2 > (CamelContext: PLC-Context) is starting > 16:30:45.580 INFO [Blueprint Event Dispatcher: 1] StreamCaching is > enabled on CamelContext: PLC-Context > 16:30:45.580 INFO [Blueprint Event Dispatcher: 1] JMX is enabled > 16:30:45.600 INFO [Blueprint Event Dispatcher: 1] Instantiating new PLC > Driver Manager with class loader BundleDelegatingClassLoader(plc4j-route.xml > [67]) > 16:30:45.600 INFO [Blueprint Event Dispatcher: 1] Registering available > drivers... > 16:30:45.601 TRACE [Blueprint Event Dispatcher: 1] FindResource: > META-INF/services/org.apache.plc4x.java.spi.PlcDriver > 16:30:45.627 INFO [Blueprint Event Dispatcher: 1] StreamCaching in use > with spool directory: > C:\karaf\bin\..\data\tmp\camel\camel-tmp-00f849ac-0ccf-4b12-822d-dda62267eb6c > and rules: [Spool > 128K body size] > 16:30:45.629 INFO [Blueprint Event Dispatcher: 1] Apache Camel 2.24.2 > (CamelContext: PLC-Context) is shutting down > 16:30:45.639 INFO [Blueprint Event Dispatcher: 1] Apache Camel 2.24.2 > (CamelContext: PLC-Context) uptime 0.060 seconds > 16:30:45.640 INFO [Blueprint Event Dispatcher: 1] Apache Camel 2.24.2 > (CamelContext: PLC-Context) is shutdown in 0.011 seconds > 16:30:45.640 WARN [Blueprint Event Dispatcher: 1] Changing Camel state > for bundle 67 to Failure > 16:30:45.641 ERROR [Blueprint Event Dispatcher: 1] Error occurred during > starting CamelContext: PLC-Context > org.apache.camel.FailedToCreateRouteException: Failed to create route > Route1: Route(Route1)[[From[plc4x:s7:localhost/1/1]] -> [To[mock:tes... > because of Unable to find driver for protocol 's7' > at > org.apache.camel.impl.RouteService.warmUp(RouteService.java:147) ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3954) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3861) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3647) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3488) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3247) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3243) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3266) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3243) > ~[!/:2.24.2] > at > org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3159) > ~[!/:2.24.2] > at > org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:255) > ~[!/:2.24.2] > at > org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:297) > ~[!/:2.24.2] > at > org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) > [!/:2.24.2] > at > org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190) > [!/:1.10.2] > at > org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188) > [!/:1.10.2] > at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) > [?:?] > at java.lang.Thread.run(Thread.java:834) [?:?] > Caused by: org.apache.plc4x.java.api.exceptions.PlcConnectionException: > Unable to find driver for protocol 's7' > at > org.apache.plc4x.java.PlcDriverManager.getDriver(PlcDriverManager.java:98) > ~[?:?] > at > org.apache.plc4x.java.PlcDriverManager.getConnection(PlcDriverManager.java:71) > ~[?:?] > at > org.apache.plc4x.camel.Plc4XConsumer.<init>(Plc4XConsumer.java:57) ~[?:?] > at > org.apache.plc4x.camel.Plc4XEndpoint.createConsumer(Plc4XEndpoint.java:72) > ~[?:?] > at > org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69) > ~[!/:2.24.2] > at > org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:107) > ~[!/:2.24.2] > at > org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:172) > ~[!/:2.24.2] > at > org.apache.camel.impl.RouteService.warmUp(RouteService.java:145) ~[!/:2.24.2] > ... 24 more > > > > >
