SOLVED: add jSerialComm maven artifact to extension --> NoClassDefFoundError

Post Reply New Topic
RELATED
PRODUCTS

Post

Hi, i try to include an external .jar into a Bitwig extension to use serial communication between an Arduino microcontroller.

Then I added the maven artifact to the pom.xml file like this:

Code: Select all

<dependencies>
	<dependency>
		<groupId>com.bitwig</groupId>
		<artifactId>extension-api</artifactId>
		<version>7</version>
	</dependency>
	
	<dependency>
		<groupId>com.fazecast</groupId>
		<artifactId>jSerialComm</artifactId>
		<version>2.4.0</version>
	</dependency>
</dependencies>
When building the project in Eclipse, maven seems to download the .jar file and in the project explorer it looks like this:
maven dependencies.JPG
Now I include a class from that .jar file into the extension, e.g.:

Code: Select all

import com.fazecast.jSerialComm.SerialPort;
...and use it in the extension:

Code: Select all

48   SerialPort bla = SerialPort.getCommPort("COM5");
49   host.println(bla.getSystemPortName());
But after installing the Bitwig extension (using the maven install command), I get the following error message:
classdefnotfound error message.JPG
What can I do about that?
You do not have the required permissions to view the files attached to this post.
Last edited by u-u-u on Tue Feb 26, 2019 12:20 am, edited 1 time in total.

Post

You need to use the shade plugin to put all necessary class files into one big jar, which is then renamed to bwextension.
See the DrivenByMoss POM for an example:
https://github.com/git-moss/DrivenByMos ... er/pom.xml

Post

moss wrote: Mon Feb 25, 2019 7:36 pm You need to use the shade plugin to put all necessary class files into one big jar, which is then renamed to bwextension.
See the DrivenByMoss POM for an example:
https://github.com/git-moss/DrivenByMos ... er/pom.xml
Thank you, that worked fine! :D

Post Reply

Return to “Controller Scripting”