Hi Patrick,
first of all welcome here on our list. We will do our best to assist you.
I did notice a few things:
* You are using the API in version 0.6.0 but the drivers in 0.5.0 … I would
strongly suggest not to mix versions
* The drivers you are using are in version 0.5.0 … I would suggest to
update to version 0.6.0 as the 0.7.0 or 0.8.0-SNAPSHOT version don’t have ADS
support yet
Are you using any form of “Fat-Jar” or shaded archive approach? Cause we have
seen this behavior in these cases. The problem is that every driver has a
property file in “META-INF/services” … each lists only the driver the module
provides. So in case of the default settings the plugins for creating the fat
jars just take one of these property files and skips the rest. You can however
configure it to merge the content. For an example on this please see the
examples pom.xml
<!-- Build a fat jar containing all dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>generate-uber-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers combine.children="append">
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${app.main.class}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Hope that helps, if not … just come back and we’ll try to help you.
Chris
Von: Patrick Boisclair <[email protected]>
Antworten an: "[email protected]" <[email protected]>
Datum: Montag, 10. August 2020 um 20:15
An: "[email protected]" <[email protected]>
Betreff: plc4j-protocol-ads not registering
Hi,
I do have a question about "Ads (Beckhoff) protocol".
Im using S7 and OPCUA, and both are registering in the available drivers.
However, the ads one is not.
Here is my dependecies:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-api</artifactId>
<version>0.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-protocol-ads</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-driver-s7</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-driver-opcua</artifactId>
<version>0.5.0</version>
</dependency>
Here is the error:
main] INFO org.apache.plc4x.java.PlcDriverManager - Instantiating new PLC
Driver Manager with class loader
jdk.internal.loader.ClassLoaders$AppClassLoader@30946e09
[main] INFO org.apache.plc4x.java.PlcDriverManager - Registering available
drivers...
[main] INFO org.apache.plc4x.java.PlcDriverManager - Registering driver for
Protocol s7 (Siemens S7 (Basic))
[main] INFO org.apache.plc4x.java.PlcDriverManager - Registering driver for
Protocol opcua (OPC UA (TCP))
org.apache.plc4x.java.api.exceptions.PlcConnectionException: Unable to find
driver for protocol 'ads'
at
org.apache.plc4x.java.PlcDriverManager.getDriver(PlcDriverManager.java:98)
at
org.apache.plc4x.java.PlcDriverManager.getConnection(PlcDriverManager.java:71)
at PLC4XTest.App.main(App.java:12)
I don't know what I'm doing wrong for the ADS protocols, the other register
just fine.
Can anyone help me pls ?
Thank you very much and best regards
Patrick Boisclair
Analyste - Programmeur senior / Senior Analyst Programmer
[cid:[email protected]]<https://www.noovelia.com/>
462, rue des Forges, Trois-Rivières (Québec) G9A 2H5 CANADA
noovelia.com<https://www.noovelia.com>
"Veuillez noter ma nouvelle adresse courriel. / Please note my new email
address."