java.lang.NoSuchMethodError: org.apache.commons.compress.utils.IOUtils.readFully(Ljava/nio/channels/ReadableByteChannel;Ljava/nio/ByteBuffer;)
Asked Answered
O

2

0

I was using apache commons-compress-1.15.jar and working on mirth connect tool and though the method was found in the java file IOUtils.java still giving out this error in mirth tool readFully(ReadableByteChannel, ByteBuffer) not found. Please help me with this error.

Thank you.

Obeded answered 19/1, 2018 at 14:53 Comment(2)
This typically happens when you run with a different version of the library than was used to compile.Vitellin
@Vitellin thank you for responding, please explain with an example. I didn't get exactly about the versions. Please make it clear and I was using jdk 1.8 and mirth connect version is 3.5.1. Please elaborate on an example. Thank you.Obeded
C
1

Mirth already using commons compress jar. You can find the commons compress version which is being used by mirth on below path.

  • {Mirth Installed Location}/server-lib/commons/commons-compress-{version}.jar
  • {Mirth Installed Location}/client-lib/commons-compress-{version}.jar
Coeternity answered 19/3, 2021 at 10:56 Comment(0)
I
0

Probably, you are not using commons-compress-1.15.jar but using older version because the method has been introduced since 1.15.

Illiberal answered 23/1, 2018 at 4:7 Comment(5)
Hi @KoheiTAMURA, I was using common-compress-1.15.jar and I can find readFully(ReadableByteChannel, ByteBuffer) method in the IOUtils.java file but still, it was returning the NoSuchMethodError while I was running it in mirth connect tool.Obeded
If possible, you might as well extract and decompile IOUtils in common-compress-1.15.jar to check if there is the method in decompiled IOUtils.java.Illiberal
I can make sure there is a method readFully(ReadableByteChannel, ByteBuffer) in IOUtils.java in common-compress-1.15.jar. It runs well and generates output in NetBeans or eclipse but when it was converted into a single jar file and run in mirth connect tool, it throws NoSuchMethodError - readFully(ReadableByteChannel, ByteBuffer) in IOUtils.java.Obeded
Probably, mirth connect tool calls another org.apache.commons.compress.utils.IOUtils not in common-compress-1.15.jar.Illiberal
There is only one version of common compress jar file that is .... common-compress-1.15.jar no other versions are included and how can it deviate from the flow? When I run the application in any ide like NetBeans and Eclipse, it really works well and generating output. But in case of mirth connect while providing the whole java application as the jar file and trying to deploy the channel in Mirth Connect. Then it throws NoSuchMethodError-readFully(ReadableByteChannel, ByteBuffer) even if that method exists inside the jar file. Thank you.Obeded

© 2022 - 2024 — McMap. All rights reserved.