Open jmatta1 opened 3 years ago
I've encountered this NoSuchMethodError when trying to create a new project, from a fresh unzip of labs 1.2.6.
It looks like there is a duplicate FileUtils being pulled in as a part of another dependency: harvey@harvey:~/alchitry-labs-1.2.6$ java -verbose -cp "lib/*" com.alchitry.labs.MainKt lin64 | grep FileUtils [9.135s][info][class,load] org.apache.commons.io.FileUtils source: file:/home/harvey/alchitry-labs-1.2.6/lib/fop-transcoder-allinone-2.2.jar
I didn't go any further to see if this is in fact the problem...but it seems to be... because in my case, the method "missing" is reported as java.lang.NoSuchMethodError: 'void org.apache.commons.io.FileUtils.writeStringToFile(java.io.File, java.lang.String, boolean)'
if you note the method signature, it's File, String, boolean
However, if you dump (via javap) the JAR "fop-transcoder-allinone-2.2.jar" where the classloader told us the "other FileUtils" lives, you see these overloads of the method (NOTE THE SIGNATURES) public static void writeStringToFile(java.io.File, java.lang.String, java.lang.String) throws java.io.IOException; public static void writeStringToFile(java.io.File, java.lang.String) throws java.io.IOException;
So, this suggests that there might be an issue there.
editing the fop-transcoder-allinone-2.2.jar file and deleting the entire commons/io subdir tree allows my slightly different scenario of creating a project to continue without error
Please do not close this bug. This is a hack; it's not even a workaround.
Hi,
I'm trying to run Alchitry Labs on Arch (with OpenJDK 15), and got the same error in the exact same way as harvv, when trying to create a new project. Seeing this thread, I did some experimenting, and found that by deleting entirely fop-transcoder-allinone-2.2.jar
from the lib/
directory, Labs would start and run just fine.
Then, out of curiosity (because it doesn't seem like it should run at all, missing a library), I cloned Labs' source and looked for where fop
was imported. grep
ping for fop
in the repo root found nothing at all, so I looked for apache
. That got me this:
[~/Downloads/Alchitry-Labs] $ grep -r apache *
src/com/alchitry/labs/hardware/usb/ftdi/enums/LineStopbit.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/ChipType.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/LineDatabit.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/PortInterfaceType.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/BitMode.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/BitMode.java:import org.apache.batik.apps.svgbrowser.Application;
src/com/alchitry/labs/hardware/usb/ftdi/enums/FlowControl.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/LineParity.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/hardware/usb/ftdi/enums/LineBreak.java: * http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/widgets/CustomConsole.java:import org.apache.commons.lang3.StringUtils;
src/com/alchitry/labs/gui/NewProjectDialog.kt:import org.apache.commons.io.FileUtils
src/com/alchitry/labs/gui/NewProjectDialog.kt:import org.apache.commons.lang3.RegExUtils
src/com/alchitry/labs/project/CoreGen.java:import org.apache.commons.lang3.exception.ExceptionUtils;
src/com/alchitry/labs/project/VivadoIP.kt:import org.apache.commons.io.FileUtils
src/com/alchitry/labs/project/Project.kt:import org.apache.commons.io.FileUtils
src/com/alchitry/labs/project/Project.kt:import org.apache.commons.lang3.exception.ExceptionUtils
src/com/alchitry/labs/project/builders/ISEBuilder.java:import org.apache.commons.io.FileUtils;
src/com/alchitry/labs/project/builders/IceCubeBuilder.java:import org.apache.commons.io.FileUtils;
src/com/alchitry/labs/project/builders/ProjectBuilder.java:import org.apache.commons.io.FileUtils;
src/com/alchitry/labs/project/builders/VivadoBuilder.java:import org.apache.commons.io.FileUtils;
src/com/alchitry/labs/ExtractUtility.java:import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
src/com/alchitry/labs/ExtractUtility.java:import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
src/com/alchitry/labs/ExtractUtility.java:import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
src/com/alchitry/labs/dictionaries/Dictionary.java:import org.apache.commons.lang3.StringUtils;
src/com/alchitry/labs/UpdateChecker.kt:import org.apache.commons.io.FileUtils
src/com/alchitry/labs/UpdateChecker.kt:import org.apache.commons.io.IOUtils
src/com/alchitry/labs/UpdateChecker.kt:import org.apache.commons.lang3.exception.ExceptionUtils
src/com/alchitry/labs/parsers/InstModule.java:import org.apache.commons.lang3.StringUtils;
src/com/alchitry/labs/parsers/tools/lucid/ConstExprParser.java:import org.apache.commons.text.StringEscapeUtils;
src/com/alchitry/labs/parsers/BigFunctions.java: http://www.apache.org/licenses/LICENSE-2.0
src/com/alchitry/labs/parsers/lucidv2/ExprParser.kt:import org.apache.commons.text.StringEscapeUtils
src/com/alchitry/labs/Util.kt:import org.apache.batik.transcoder.SVGAbstractTranscoder
src/com/alchitry/labs/Util.kt:import org.apache.batik.transcoder.TranscoderException
src/com/alchitry/labs/Util.kt:import org.apache.batik.transcoder.TranscoderInput
src/com/alchitry/labs/Util.kt:import org.apache.batik.transcoder.TranscoderOutput
src/com/alchitry/labs/Util.kt:import org.apache.batik.transcoder.image.PNGTranscoder
src/com/alchitry/labs/Util.kt:import org.apache.commons.io.IOUtils
src/com/alchitry/labs/Util.kt:import org.apache.commons.io.filefilter.DirectoryFileFilter
src/com/alchitry/labs/Util.kt:import org.apache.commons.lang3.exception.ExceptionUtils
If I'm reading this correctly, Labs isn't importing fop
at all, and the only transcoder it's importing is the Batik toolkit (an SVG toolkit, I guess). Even stranger, fop
isn't referenced by any IDE project files, like one might expect from an old dependency. It looks to me like Alchitry mistakenly included an extra JAR in their release (but not their current Git source, which has no fop
JAR), and it's conflicting with the Apache IO functions.
As a solution, this is only slightly better than the JAR-editing hack above. Hopefully by the next release Alchitry doesn't include this file.
I'm not sure if this will fix the original issue, but I've remove all the Batik stuff in 1.2.7.
It appears to be working now. Thanks for making that change---should save folks a lot of confusion!
I am trying to run alchitry-lab on Ubuntu 20.04.2 LTS.
When I click the build button nothing happens in the console. If I go to the terminal (where I ran alchitry-labs from) I see the following exception stack trace:
Steps to reproduce:
Fix attempts:
sudo apt install openjdk-14-jre
sudo apt install libcommons-*
At this point I am at a bit of a loss because neither Java nor Kotlin are among the computer programming languages I have any real familiarity with. Any assistance or suggestions would be welcome!