Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

development environment

<spring-boot.version>3.2.3/spring-boot.version>
<java.version>17</java.version>


  <!--plc-->
  <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-api</artifactId>
      <version>0.12.0</version>
  </dependency>
  <!-- https://mvnrepository.com/artifact/org.apache.plc4x/plc4j-driver-s7 -->
  <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-driver-modbus</artifactId>
      <version>0.12.0</version>
      <scope>runtime</scope>
  </dependency>

log

java.lang.NoClassDefFoundError: org/apache/plc4x/java/api/PlcDriverManager
	at org.apache.hertzbeat.collector.collect.plc.PlcCollectImpl.collect(PlcCollectImpl.java:52)
	at org.apache.hertzbeat.collector.dispatch.MetricsCollect.run(MetricsCollect.java:161)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassNotFoundException: org.apache.plc4x.java.api.PlcDriverManager
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 5 common frames omitted
You must be logged in to vote

I am using PLC4X in a Spring Boot 3 environment. So that shouldn't be the issue.
From your error that it can't find the PlcDriverManager ... this interface is located in plc4j-api ... so there must be something odd with your setup.

Replies: 1 comment · 2 replies

Comment options

I am using PLC4X in a Spring Boot 3 environment. So that shouldn't be the issue.
From your error that it can't find the PlcDriverManager ... this interface is located in plc4j-api ... so there must be something odd with your setup.
image

You must be logged in to vote
2 replies
@ZY945
Comment options

I tried again in a new springboot project and it was indeed possible. I encountered this issue while trying to introduce plc4j into HertzBeat's monitoring collection, perhaps due to a problem with my local environment

@chrisdutz
Comment options

Ok .. glad it worked :-)

Answer selected by sruehl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.