Сообщение об ошибке:
Код: Выделить всё
2024-09-17T12:26:53.922+02:00 WARN 2816 --- [tw-check] [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'twCheckTestApplication': Unsatisfied dependency expressed through field 'actionLogger': No qualifying bean of type 'io.github.jspinak.brobot.logging.ActionLogger' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
***************************
APPLICATION FAILED TO START
***************************
Description:
Field actionLogger in com.example.tw.TwCheckTestApplication required a bean of type 'io.github.jspinak.brobot.logging.ActionLogger' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'io.github.jspinak.brobot.logging.ActionLogger' in your configuration.
Код: Выделить всё
package com.example.tw;
import com.example.tw.controller.DatabaseController.DatabaseController;
import com.example.tw.utils.RobotCommands;
import io.github.jspinak.brobot.logging.ActionLogger;
import org.sikuli.script.ImagePath;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import java.sql.Connection;
/**
* The TwCheckTestApplication class is the main class of the project. This is where the database and brobot are configured.
*/
@SpringBootApplication
@ComponentScan(basePackages = {"io.github.jspinak.brobot", "com.example.tw"})
public class TwCheckTestApplication {
public static void main(String[] args) {
Connection dataTable = DatabaseController.connect();
if (dataTable != null) {
ImagePath.setBundlePath("images");
// Add image path for other folders
ImagePath.add("images/guestMode");
ImagePath.add("images/chooseEngine");
ImagePath.add("images/allMovement");
ImagePath.add("images/connectionAndLinkMovement");
ImagePath.add("images/Initiate");
ImagePath.add("images/EditJSON");
ImagePath.add("images/ImportImg");
ImagePath.add("images/Branding");
ImagePath.add("images/addVirtualStaging");
ImagePath.add("images/addOverlays");
ImagePath.add("images/itemVisibility");
ImagePath.add("images/addAudio");
ImagePath.add("images/allAnimations");
ImagePath.add("images/checkTeleport");
ImagePath.add("images/checkTags");
ImagePath.add("images/addImagesAndTexts");
ImagePath.add("images/checkMoveToLink");
SpringApplicationBuilder builder = new SpringApplicationBuilder(TwCheckTestApplication.class);
builder.headless(false);
builder.run(args);
RobotCommands.openChrome();
RobotCommands.enterURL("http://localhost:8080/test-interface");
} else {
System.exit(0);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... n-in-sprin