tomLamprecht / Easy-ML-For-Java

A Java Framework to implement Machine Learning using Neural Networks and a Genetic Algorithm
MIT License
36 stars 5 forks source link

Exception in thread "main" java.lang.BootstrapMethodError: bootstrap method initialization exception #10

Open demaniak opened 1 year ago

demaniak commented 1 year ago

When using NQuantilFitnessLine or WorstFitnessLine graph line plotters, the following exception is raised:

Exception in thread "main" java.lang.BootstrapMethodError: bootstrap method initialization exception
    at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:188)
    at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:315)
    at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:281)
    at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:271)
    at de.fhws.easyml.geneticalgorithm.logger.loggers.graphplotter.lines.NQuantilFitnessLine.lambda$0(NQuantilFitnessLine.java:25)
    at de.fhws.easyml.geneticalgorithm.logger.loggers.graphplotter.lines.LineGenerator.convert(LineGenerator.java:34)
    at de.fhws.easyml.geneticalgorithm.logger.loggers.graphplotter.lines.LineGenerator.log(LineGenerator.java:30)
    at de.fhws.easyml.geneticalgorithm.logger.loggers.graphplotter.GraphPlotLogger.lambda$0(GraphPlotLogger.java:82)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
    at de.fhws.easyml.geneticalgorithm.logger.loggers.graphplotter.GraphPlotLogger.savePopulationValues(GraphPlotLogger.java:82)
    at de.fhws.easyml.geneticalgorithm.logger.loggers.graphplotter.GraphPlotLogger.log(GraphPlotLogger.java:65)
    at de.fhws.easyml.geneticalgorithm.GeneticAlgorithm.lambda$1(GeneticAlgorithm.java:125)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at de.fhws.easyml.geneticalgorithm.GeneticAlgorithm.callLoggers(GeneticAlgorithm.java:125)
    at de.fhws.easyml.geneticalgorithm.GeneticAlgorithm.prepareNextEvolution(GeneticAlgorithm.java:117)
    at de.fhws.easyml.geneticalgorithm.GeneticAlgorithm.nextGen(GeneticAlgorithm.java:103)
    at de.fhws.easyml.geneticalgorithm.GeneticAlgorithm.evolute(GeneticAlgorithm.java:82)
    at de.fhws.easyml.geneticalgorithm.GeneticAlgorithm.solve(GeneticAlgorithm.java:65)
    at za.co.oevents.cify.easyml.Train.main(Train.java:84)
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type class java.lang.Object; not a subtype of implementation type interface de.fhws.easyml.geneticalgorithm.Individual
    at java.base/java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:273)
    at java.base/java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:340)
    at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:134)
    ... 18 more

This can be observed by simply running the snake training example.

Tested on Linux with JDK11 and JDK 17