My complete application is working perfectly in Eclipse. I generated a jar file by mvn clean package
command in the project directory. The jar file is generated in the target folder.
Now I am executing this jar file by java -jar ScoreExtractionApp.jar
, it is giving the below exceptions:
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appStartupRunner': Unsatisfied dependency expressed through field 'scoreParserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scoreParserServiceImpl': Unsatisfied dependency expressed through field 'decisionAgentService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'decisionAgentServiceImpl' defined in URL [jar:file:/D:/ScoreExtractionGitHub/ScoreExtraction/target/classes/ScoreExtractionApp.jar!/BOOT-INF/classes!/com/alrajhi/score/ScoreExtraction/service/impl/DecisionAgentServiceImpl.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.alrajhi.score.ScoreExtraction.service.impl.DecisionAgentServiceImpl] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@179d3b25]
package com.alrajhi.score.ScoreExtraction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import com.alrajhi.score.ScoreExtraction.service.ScoreParserService;
@Slf4j
@ComponentScan
@Service
public class AppStartupRunner implements ApplicationRunner {
//
@Autowired
ScoreParserService scoreParserService;
//
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("Your application started with option names : {}", args.getOptionNames());
scoreParserService.startExecution();
}
}
Below is the ScoreParserService Interface
package com.alrajhi.score.ScoreExtraction.service;
import java.io.File;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.springframework.stereotype.Service;
@Service
public interface ScoreParserService {
public void startExecution();
public List<File> getInputFiles(String workingDirectory);
public void processInputFiles(List<File> files);
public void saveLogOutputToDB(Date logDate, String logLevel, String logResult, String logType, String logUser, String runStatus,BigDecimal s);
}
Warning Messages during building Jar file
[WARNING] Some problems were encountered while building the effective model for com.alrajhi.score:ScoreExtraction:jar:0.0.1
[WARNING] 'dependencies.dependency.systemPath' for com.experian.appscore:appscore:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/lib/APPSCORE.jar will be unresolvable by dependent projects @ line 133, column 25
[WARNING] 'dependencies.dependency.systemPath' for com.experian.encoder:encoder:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/lib/com.experian.eda.encoder-1.2.1.EDA2-bundle.jar will be unresolvable by dependent projects @ line 142, column 25
[WARNING] 'dependencies.dependency.systemPath' for com.experian.eda.da:Decision.Agent.Bundle:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/lib/DA.jar will be unresolvable by dependent projects @ line 151, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.grlea.Bridge:Log.Bridge:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/lib/log-bridge-1.0.jar will be unresolvable by dependent projects @ line 160, column 25